Results 1 to 20 of 20

Thread: Delegate editor sizing problem

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    8
    Thanked 541 Times in 521 Posts

    Default Re: Delegate editor sizing problem

    Sorry about that... sizeHint is a wrong path.

    Try overriding QItemDelegate::updateEditorGeometry(...);
    Like this:

    Qt Code:
    1. [COLOR=#8B0000][FONT='Courier New,courier'][I][/I][/FONT][/COLOR]void MyDelegate::updateEditorGeometry( QWidget* editor, const QStyleOptionViewItem &option, const QModelIndex &index )
    2. {
    3. editor->setGeometry( option.rect );
    4. }
    To copy to clipboard, switch view to plain text mode 

    Using option.rect should resize your editor to fit perfectly into the cell.

    Regards

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

    smacchia (8th April 2007)

Similar Threads

  1. Grid Layout Problem
    By Seema Rao in forum Qt Programming
    Replies: 2
    Last Post: 4th May 2006, 12:45
  2. Problem in Cut Operation
    By ankurjain in forum Qt Programming
    Replies: 4
    Last Post: 14th April 2006, 12:23
  3. Problem with bitBlt
    By yellowmat in forum Newbie
    Replies: 1
    Last Post: 5th April 2006, 14:08
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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.