Results 1 to 14 of 14

Thread: slider control and combo box in grid view

Threaded View

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

    Default Re: slider control and combo box in grid view

    Quote Originally Posted by steg90 View Post
    Thanks for that. I guess I create a delegate for the drop down box derived from QItemDelegate
    You can create a single delegate for all types of editors. Just return a different widget depending on index.column() value.

    I would need to provide setEditorData method and setModelData and updateEditorGeometry methods?
    The default updateEditorGeometry() should be fine. As for the other two methods you should reimplement them. Again, depending on the column number cast the editor to a proper class, fetch the value and update the model (or vice versa).

    How do I set the above delegate for say the first column of the table view?
    QAbstractItemView::setItemDelegate(), QAbstractItemView::setItemDelegateForColumn(), QAbstractItemView::setItemDelegateForRow()

  2. The following 2 users say thank you to wysota for this useful post:

    bkastel1 (20th November 2007), steg90 (20th November 2007)

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.