Results 1 to 12 of 12

Thread: Editable QComboBox with QItemDelegate

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2008
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1

    Default Re: Editable QComboBox with QItemDelegate

    It is probably a noobish question, but how do I installEventFilter within createEditor, because since createEditor is const, calling myLineEdit->installEventFilter(this) produces an error...

    I doesn't know why it is so complicated to put a simple QComboBox into a cell

    Anyway, I tested with having persistent editors : it seems to work, but the method of showing an editor when needed is much better...
    Coding for Actionaz 3

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

    Default Re: Editable QComboBox with QItemDelegate

    You have to cheat using const_cast(). You can take a look at the implementation of QItemDelegate and the factory class it uses to see how it is internally implemented. With all the event filters and stuff.

  3. #3
    Join Date
    Jul 2008
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    1

    Default Re: Editable QComboBox with QItemDelegate

    I will look at it, thanks
    Coding for Actionaz 3

  4. #4
    Join Date
    Dec 2008
    Location
    Irkutsk, Russia
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Editable QComboBox with QItemDelegate

    Excuse me, may be it's easy, but what is CustomRoles?

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

    Default Re: Editable QComboBox with QItemDelegate

    Quote Originally Posted by faraslacks View Post
    Excuse me, may be it's easy, but what is CustomRoles?
    [WIKI=QAbstractItemModel#Custom_item_roles]Custom item roles in ItemViews[/WIKI]

Similar Threads

  1. QComboBox drop list button events
    By maird in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2007, 19:25

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.