Results 1 to 3 of 3

Thread: How do I change the options for a custom QComboBox delegate?

  1. #1
    Join Date
    Jun 2014
    Posts
    30
    Thanks
    4
    Qt products
    Qt5

    Default How do I change the options for a custom QComboBox delegate?

    I wrote a custom delegate that renders a QComboBox. I installed it to a column with QTableView::setItemDelegateForColumn().

    At some point later, I need to update the options in the combo box. How would I do this?

  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: How do I change the options for a custom QComboBox delegate?

    Access the editor and modify it. What's the problem?
    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.


  3. #3
    Join Date
    Jun 2014
    Posts
    30
    Thanks
    4
    Qt products
    Qt5

    Default Re: How do I change the options for a custom QComboBox delegate?

    The key was discovering QAbstractItemView::itemDelegateForColumn. Somehow I had missed this when glancing over the API docs.

Similar Threads

  1. Replies: 1
    Last Post: 17th April 2014, 12:12
  2. Replies: 5
    Last Post: 19th March 2014, 12:05
  3. setEditorData() for QComboBox Delegate
    By fatecasino in forum Newbie
    Replies: 10
    Last Post: 6th April 2011, 02:00
  4. Custom Model? Custom View? Custom Delegate?
    By Doug Broadwell in forum Newbie
    Replies: 4
    Last Post: 11th February 2010, 20:23
  5. Replies: 0
    Last Post: 1st February 2010, 11:00

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.