Results 1 to 11 of 11

Thread: QStyledItemDelegate and editor pointer

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: QStyledItemDelegate and editor pointer

    Actually there's no need at all to store the pointer of the widget or the size hint etc...

    Just use the model index in the sizeHint to get the needed data.

    Qt Code:
    1. QSize CheckBoxDelegate::sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index ) const
    2. {
    3. CheckBoxDelegateWidget *editor = new CheckBoxDelegateWidget(index.data(...));
    4.  
    5. return editor->sizeHint();
    6. }
    To copy to clipboard, switch view to plain text mode 

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

    Nero (13th September 2010)

Similar Threads

  1. QStandardItem, QStyledItemDelegate, and QWebView
    By enlightened_j in forum Newbie
    Replies: 1
    Last Post: 16th August 2010, 08:44
  2. QStyledItemDelegate with custom QWidget editor
    By stefanadelbert in forum Qt Programming
    Replies: 3
    Last Post: 14th July 2010, 23:19
  3. Setting Format in a QStyledItemDelegate
    By Airswoop1 in forum Qt Programming
    Replies: 0
    Last Post: 1st June 2009, 22:01
  4. Replies: 5
    Last Post: 30th March 2008, 16:53
  5. Replies: 6
    Last Post: 22nd June 2007, 22:20

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.