Results 1 to 2 of 2

Thread: GridLayout with GraphicsWidget - problem with specific example

  1. #1
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Question GridLayout with GraphicsWidget - problem with specific example

    Hi all,

    I am using QGraphicsWidgets in a QGraphicsGridLayout. In general, it works, but in one specific aspect, it does not behave as I expect (see screenshots). Can someone help me understand why the layout does what it does? Thanks!

    Text in screenshots specifies horizontal size policy only. I'm fine with the vertical layout.

    This is what I expect:


    This is what I get:


    As you can see, column 2 (with an expanding item) receives only about as much space as the two columns (1 and 3) with "minimum" items. The "minimum" items in columns 1 and 3 definitely have a lower minimum width than shown - they could be shrunk without any problems.

  2. #2
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    12
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: GridLayout with GraphicsWidget - problem with specific example

    I have solved the problem by using the horizontal size policy "Fixed" for the light green items in columns 1 and 3.
    It's not quite what I wanted (the items would be able to grow, if necessary), but it'll do for now.

    I used to think that leftover space would always go to "Expanding" items first, and then to others, but that does not seem to be the case.

Similar Threads

  1. Style3sheet problem, QTreeView for specific object
    By hubbobubbo in forum Qt Programming
    Replies: 2
    Last Post: 11th February 2010, 21:15
  2. Replies: 0
    Last Post: 25th November 2009, 15:07
  3. Problem with specific font
    By ratsrcute in forum Qt Programming
    Replies: 1
    Last Post: 21st February 2009, 14:57
  4. Prob: Adding SpinBox to the GraphicsWidget
    By ashishsaryar in forum Qt Programming
    Replies: 1
    Last Post: 20th May 2008, 09:00
  5. does gridlayout really lay out?
    By illuzioner in forum Newbie
    Replies: 2
    Last Post: 26th February 2006, 00:57

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.