Results 1 to 19 of 19

Thread: How to create a Combo box in a Tablview Model

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: How to create a Combo box in a Tablview Model

    The way a view's cells are drawn is provided by a default QStyledItemDelegate. If you want to change the way the data appears when it is not being editted, or if you want to provide a combo box as the editor, then you need to provide the view with customised (subclassed) QStyledItemDelegate with the paint() and/or createEditor() functions reimplemented. The mechanism is described in the docs.
    http://doc.qt.io/qt-5/qstyleditemdelegate.html#details
    http://doc.qt.io/qt-5/qtwidgets-item...e-example.html

  2. The following user says thank you to ChrisW67 for this useful post:


Similar Threads

  1. Create Complex combo control
    By frsdot in forum General Programming
    Replies: 1
    Last Post: 20th October 2013, 15:14
  2. Replies: 1
    Last Post: 11th June 2013, 16:56
  3. Value from combo box to LCD
    By dayo30 in forum Qwt
    Replies: 4
    Last Post: 1st February 2013, 00:40
  4. How to create Combo box using QML in Qt
    By Channareddy in forum Newbie
    Replies: 0
    Last Post: 4th July 2011, 05:47
  5. Is it possible to create a combo with paper sizes?
    By aekilic in forum Qt Programming
    Replies: 10
    Last Post: 19th January 2010, 09:16

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.