Results 1 to 3 of 3

Thread: QItemDelegate use in QTableWidget

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QItemDelegate use in QTableWidget

    in QCLDelegate::createEditor you should write additional condition
    Qt Code:
    1. QWidget *QCLDelegate::createEditor(QWidget *parent,
    2. const QStyleOptionViewItem & /* option */,
    3. const QModelIndex &index) const
    4. {
    5. if (index.column() == 2 || index.column() == 3 || index.column() == 4) {
    6. //creating and customization of comboboxes
    7. return comboBox;
    8. }
    9.  
    10. return new QLineEdit(parent);
    11. }
    To copy to clipboard, switch view to plain text mode 
    you also should be careful in other Delegate's method where an editor is used as method's parameter, you should cast each editor to concert type, because now you have two different editor's type -- QComboBox and QLineEdit.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

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

    arpspatel (27th October 2009)

Similar Threads

  1. QComboBox in QTableWidget : display troubles.
    By Nyphel in forum Qt Programming
    Replies: 2
    Last Post: 13th October 2007, 23:29
  2. QTableWidget issues
    By Djony in forum Qt Programming
    Replies: 42
    Last Post: 19th December 2006, 23:27
  3. print QTableWidget
    By chak_med in forum Qt Programming
    Replies: 3
    Last Post: 4th November 2006, 18:46
  4. QTableWidget editing question
    By Trasmeister in forum Qt Programming
    Replies: 1
    Last Post: 20th September 2006, 18:46
  5. Replies: 6
    Last Post: 5th March 2006, 21:05

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.