Results 1 to 4 of 4

Thread: inserting combo box in table ..

  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default inserting combo box in table ..

    hi friends,
    is there a way to insert a QComboBox in QTable column ... please help .
    "Behind every great fortune lies a crime" - Balzac

  2. #2
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: inserting combo box in table ..

    Quote Originally Posted by wagmare View Post
    hi friends,
    is there a way to insert a QComboBox in QTable column ... please help .
    (QTable == QTableWidget) ? use QTableWidget::setCellWidget() : specify(Qt3?);

    EDIT: in Qt3 there is also Q3Table::cellWidget()...

  3. The following user says thank you to Lykurg for this useful post:

    wagmare (29th May 2009)

  4. #3
    Join Date
    Mar 2009
    Location
    Italy
    Posts
    7
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: inserting combo box in table ..

    Quote Originally Posted by wagmare View Post
    hi friends,
    is there a way to insert a QComboBox in QTable column ... please help .
    Hi,

    what is the use of QComboBox inside the QTable column? Is it for editing the content of model? If yes, a good approach is to implement a custom Delegate for editing the column. This delegate will create the QComboBox as editor for each column cell, will fill the QComboBox with the relevant items and manages the set of current value inside the QComboBox, retrieve the user selection and set it as current value inside the table.

    Bye.

    Alessandro

  5. The following user says thank you to Zuzzu for this useful post:

    wagmare (2nd June 2009)

  6. #4
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: inserting combo box in table ..

    custom Delegate ..
    yes this one is the better one ... thank you
    "Behind every great fortune lies a crime" - Balzac

Similar Threads

  1. Postgresql QSqlRelationalTableModel empty table
    By RolandHughes in forum Qt Programming
    Replies: 0
    Last Post: 12th November 2008, 17:18
  2. Replies: 3
    Last Post: 5th October 2008, 23:41
  3. Inserting Table
    By dreamer in forum Qt Programming
    Replies: 5
    Last Post: 16th May 2008, 10:10
  4. Inserting Integer Values to table.
    By kenny_isles in forum Newbie
    Replies: 2
    Last Post: 22nd February 2007, 07:17
  5. displaying any table on a qdatatable
    By Philip_Anselmo in forum Newbie
    Replies: 4
    Last Post: 9th May 2006, 22:12

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.