Results 1 to 2 of 2

Thread: QItemDelegate

  1. #1
    Join Date
    Oct 2008
    Posts
    20
    Thanks
    1
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Thumbs down QItemDelegate

    Hi. I'm trying to calculate height of an item in QListView in QComboBox.
    I need height of a single item (n) and height of the whole drop-down box. I tried to make a descendant from QItemDelegate and implement the paint function in order to try and get the rect property though it doesn't even called when I show the items.

    So I made a descendant class object and called Combo->setItemDelegate(obj).

    Thanks in advance.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QItemDelegate

    Quote Originally Posted by Alex_123 View Post
    I tried to make a descendant from QItemDelegate and implement the paint function in order to try and get the rect property though it doesn't even called when I show the items.
    The function signature must match, including constness. Perhaps you forgot the last "const":
    Qt Code:
    1. void paint(QPainter* painter, const QStyleOptionViewItem& option, const QModelIndex& index) const;
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

Similar Threads

  1. Help needed with QItemDelegate
    By cyberboy in forum Qt Programming
    Replies: 3
    Last Post: 9th July 2008, 18:21
  2. QItemDelegate
    By cyberboy in forum Qt Programming
    Replies: 10
    Last Post: 27th June 2008, 17:41
  3. Completer on QItemDelegate
    By gemidjy in forum Qt Programming
    Replies: 6
    Last Post: 31st March 2008, 10:29
  4. Return a pointer from a QItemdelegate
    By SailinShoes in forum Qt Programming
    Replies: 5
    Last Post: 12th March 2008, 20:07
  5. premature call to setmodeldata with QItemDelegate
    By placebo in forum Qt Programming
    Replies: 1
    Last Post: 25th November 2007, 17:39

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.