Results 1 to 2 of 2

Thread: QHeaderView resize problems...

  1. #1
    Join Date
    Jul 2009
    Location
    Valladolid, Spain
    Posts
    125
    Thanks
    16
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default QHeaderView resize problems...

    I have some rows and 3 columns.

    Some rows have a picture in the first columns, and some doesn't have one.
    I'm trying to make the header resize itself to fit the content of the row, so, reading the docs, the most logical option is

    Qt Code:
    1. header.resizeSections(3)
    To copy to clipboard, switch view to plain text mode 

    But this way the items that have a picture in the first column are somehow resized so the picture isn't visible.

    How can I fix that?

    btw, I'm adding the pictures with DecorativeRole. And every column in each row is a QStandardItem.

    Thanks

  2. #2
    Join Date
    Jul 2009
    Location
    Valladolid, Spain
    Posts
    125
    Thanks
    16
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QHeaderView resize problems...

    I'll remake my question :/

    Is possible to hide column 0 of each parent and show it on each child?
    Something like "if item.hasChildren() = False: item.showColumn(0) ; else item.hideColumn(0)"

    Or maybe... Set the resizeMode to fill the contents on the first column, but fit the available sapce on the other columns?
    Last edited by alexandernst; 7th August 2009 at 18:10.

Similar Threads

  1. flicker and wierd resize problems ...
    By momesana in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2008, 18:00
  2. Replies: 2
    Last Post: 22nd January 2008, 16:10
  3. Replies: 2
    Last Post: 14th August 2007, 15:16
  4. Custom Shape Widget (resize)
    By PiXeL16 in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2007, 07:00
  5. postponing resize event
    By Honestmath in forum Qt Programming
    Replies: 11
    Last Post: 26th February 2006, 00:32

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.