Results 1 to 3 of 3

Thread: Setting Delegates per Column

  1. #1
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Setting Delegates per Column

    I have created a QTableView/QAbstractTableModel pair that I am using to display various types of data. Most of my columns display QString data, and when the user double-clicks that column the standard editing delegate (seems like a QLineEdit) works fine. Some of my other columns display QDate data and for editing those I would like to use a custom control I have written. I expected to be able to use the setItemDelegate method for this, but that applies the delegate to the entire QTableView. Is there any way for me to set a delegate specifically for one column in the table?

    Jimmy

  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: Setting Delegates per Column

    No, "there can be only One!"

    But don't loose hope You can return different editors from the delegate depending on the column of the view.

    BTW. You might want to search through the forum, as this issue has already been brought up some time ago.

  3. #3
    Join Date
    Jan 2006
    Location
    Edmonton, Canada
    Posts
    101
    Thanks
    13
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Setting Delegates per Column

    Whoops - I did search the forum and skipped right over the thread you're referring to.

    Thanks wysota

Similar Threads

  1. Delegates and Table
    By ankurjain in forum Qt Programming
    Replies: 8
    Last Post: 18th May 2006, 19:47
  2. QTable column stretchable with minimum Width
    By sunil.thaha in forum Qt Programming
    Replies: 0
    Last Post: 24th April 2006, 13:17
  3. QTableWidget column and row sizes
    By Arthur in forum Qt Programming
    Replies: 4
    Last Post: 27th January 2006, 11:03
  4. hidden QListView column suddenly visible
    By edb in forum Qt Programming
    Replies: 10
    Last Post: 27th January 2006, 08:00
  5. How to dispay an icon in the first column of QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2006, 15:51

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.