Results 1 to 2 of 2

Thread: Can't change items aligment in QGraphicsLinearLayout

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Location
    Wroclaw, Poland
    Posts
    72
    Thanks
    6
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Can't change items aligment in QGraphicsLinearLayout

    I create one QGraphicsWidget inside which in two columns I want to place circles.
    So inside this widget tree layout are created. One main to store two vertical Layouts.


    Qt Code:
    1. m_hbMainLayout = new QGraphicsLinearLayout(Qt::Horizontal);
    2. vbLeftLayout = new QGraphicsLinearLayout(Qt::Vertical);
    3. vbRightLayout = new QGraphicsLinearLayout(Qt::Vertical);
    4.  
    5. m_hbMainLayout->addItem(vbLeftLayout);
    6. m_hbMainLayout->addItem(vbRightLayout);
    7.  
    8. if (layout())
    9. delete layout();
    10. setLayout(m_hbMainLayout);
    To copy to clipboard, switch view to plain text mode 

    Then I add circles by
    Qt Code:
    1. vbLeftLayout->addItem(devGUIChild);
    2. vbLeftLayout->setAlignment(devGUIChild,Qt::AlignVCenter);
    To copy to clipboard, switch view to plain text mode 

    But at the end circles aren't placed as I expect.


    Those circles should be placed vertically evenly and in the middle. Right ones are placed evenly, but the left one isn't placed in the middle.
    This approach works fine when I work with normal widgets and layout. Could some one tell me how to fix it?
    Last edited by T4ng10r; 22nd December 2009 at 12:47.

Similar Threads

  1. Replies: 5
    Last Post: 27th November 2009, 13:57
  2. Some menubar items can not be clicked
    By richardander in forum Qt Programming
    Replies: 4
    Last Post: 11th March 2009, 00:26
  3. Use delegate to draw different type of items
    By nifei in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2009, 13:16
  4. Light items for the graphicsView
    By maverick_pol in forum Qt Programming
    Replies: 12
    Last Post: 1st November 2007, 18:51
  5. Selective highlighting of Items
    By Kapil in forum Qt Programming
    Replies: 3
    Last Post: 26th May 2006, 12: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.