Results 1 to 11 of 11

Thread: Multiple clicks required to get into edit mode on QTreeView

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2008
    Location
    Ann Arbor Michigan
    Posts
    6
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Multiple clicks required to get into edit mode on QTreeView

    Hello:

    I have a QTreeView (rootIsDecorated=false) with a QItemDelegate on the first column that uses a QLineEdit for editing. I have set editTriggers to QAbstractItemView::AllEditTriggers.

    PROBLEM: In order to get into edit mode on that column I sometimes need to click up to 3 times.


    Is there any technique to ensure that I get edit mode the very first time I click in the cell?

    The flags returned by my model are:
    Qt Code:
    1. if (0 == index.column())
    2. {
    3. return flags | Qt::ItemIsSelectable | Qt::ItemIsEditable | Qt::ItemIsEnabled;
    4. }
    To copy to clipboard, switch view to plain text mode 

    It may even be ideal if that column was always in edit mode?

    I set up a custom widget that uses vector if QLineEdits in a QVBoxLayout positioned next to a QTreeView for this effect, but then I must synchronize the vector of QLineEdits and the Model-View. Not exactly ideal...

    Any help would be greatly appreciated.

    best regards,
    Jon K.
    Ann Arbor Michigan U.S.A.
    Last edited by jpn; 7th August 2008 at 14:16. Reason: missing [code] tags

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.