Results 1 to 5 of 5

Thread: Edit items on QTreeView + QDirModel

  1. #1

    Default Edit items on QTreeView + QDirModel

    Hey guys,

    i am wondering how to edit items within a QTreeView + QDirModel. Editing items is -by default- on doubleClick. That works. However since i want to use the doubleClick to open the selected files i need to have the renaming functionality on a rightClickEvent.

    Unfortunately i can't find the right way. Can anybody give me a hand on that?

    Thanks guys.
    Junior0007

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Edit items on QTreeView + QDirModel

    Change the editTriggers property of the view.

  3. #3
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Edit items on QTreeView + QDirModel

    By defalut editing is not on double click but on click selected - those two are different actions that can be used together.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Edit items on QTreeView + QDirModel

    Quote Originally Posted by mchara View Post
    By defalut editing is not on double click but on click selected - those two are different actions that can be used together.
    To be exact, any QAbstractItemView uses edit triggers
    Qt Code:
    1. QAbstractItemView::DoubleClicked|QAbstractItemView::EditKeyPressed
    To copy to clipboard, switch view to plain text mode 
    by default, and QTableView adds
    Qt Code:
    1. editTriggers|QAbstractItemView::AnyKeyPressed
    To copy to clipboard, switch view to plain text mode 
    to that.
    J-P Nurmi

  5. #5
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Edit items on QTreeView + QDirModel

    So my mistake, sorry.
    but QAbstractItemView::SelectedClicked (| QAbstractItemView::EditKeyPressed) editTrigger is windows default behavior so there's no need to edit items on rightClicks.
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

Similar Threads

  1. QTreeView and QDirModel Header Sort Question
    By jimroos in forum Qt Programming
    Replies: 1
    Last Post: 20th March 2007, 08:04
  2. Replies: 1
    Last Post: 15th March 2007, 20:45
  3. Drag & drop items on the same QTreeView
    By wind in forum Qt Programming
    Replies: 2
    Last Post: 11th October 2006, 14:29
  4. QDirModel and a QTreeView.
    By jamd in forum Qt Programming
    Replies: 1
    Last Post: 21st June 2006, 09:41
  5. How to clear All items on QTreeView ?
    By qintm in forum Qt Programming
    Replies: 1
    Last Post: 26th March 2006, 11:39

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.