Results 1 to 2 of 2

Thread: QComboBox in QTreeView on Edit?

  1. #1
    Join Date
    Apr 2010
    Posts
    11
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QComboBox in QTreeView on Edit?

    Hi,

    I have an QTreeView with an QAbstractItemModel.
    In one of my columns I'd like to display a QComboBox when editing instead of the normal text-editing (like in the QtDesigner for some values).

    How would I do this?

    Cheers,
    Aya

  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: QComboBox in QTreeView on Edit?

    Provide a custom delegate that will create a combobox as an editor for the view. Have a look at the spinbox delegate example that comes with Qt.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Multiple clicks required to get into edit mode on QTreeView
    By JonInAnnArbor in forum Qt Programming
    Replies: 10
    Last Post: 26th November 2012, 18:59
  2. QTreeView edit() not working.
    By billw in forum Qt Programming
    Replies: 0
    Last Post: 20th August 2010, 17:26
  3. Replies: 1
    Last Post: 15th January 2009, 10:34
  4. QTreeView - how to force an end to a user edit
    By onamatic in forum Qt Programming
    Replies: 2
    Last Post: 17th November 2008, 21:21
  5. Edit items on QTreeView + QDirModel
    By junior0007 in forum Qt Programming
    Replies: 4
    Last Post: 23rd November 2007, 07:16

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.