Results 1 to 3 of 3

Thread: How to get QComboBox selected item text to use in setModelData?

  1. #1
    Join Date
    Feb 2008
    Posts
    79
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default How to get QComboBox selected item text to use in setModelData?

    Hello,

    I am writing custom delegate to show qcombobox when user wants to edit specific cell. I am using qsqltablemodel assigned to qtableview. My update mode is OnFieldChange. I notice that when I try to change value of qcombobox it is always reverted back to default mode. So setModelData of my delegate obviously cannot extract selected value and update database accordingly. I looked at default implementation of setModelData and figured out that qcombobox probably does not have property marked with USER flag. What am I missing here??

  2. #2
    Join Date
    Feb 2008
    Posts
    79
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to get QComboBox selected item text to use in setModelData?

    Bump. Bump.

  3. #3
    Join Date
    Feb 2010
    Posts
    4
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to get QComboBox selected item text to use in setModelData?

    qDebug(model->item(row,column)->text());

Similar Threads

  1. Replies: 1
    Last Post: 17th May 2010, 00:40
  2. popupmenu for QTreeWidget's item when a particular item selected.
    By vinod sharma in forum Best Practices in Qt Programming
    Replies: 1
    Last Post: 22nd January 2010, 11:45
  3. Replies: 1
    Last Post: 20th January 2010, 09:38
  4. QListview set selected item
    By Freeman551 in forum Qt Programming
    Replies: 1
    Last Post: 25th December 2009, 01:17
  5. How to set selected item of a QListWidget?
    By Lawand in forum Qt Programming
    Replies: 9
    Last Post: 5th April 2009, 12:23

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.