Results 1 to 3 of 3

Thread: How to define object position unchangeable ?

  1. #1
    Join Date
    Jul 2011
    Location
    BRAZIL-RIO DE JANEIRO
    Posts
    47
    Thanks
    33
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default How to define object position unchangeable ?

    Hi friends,


    I placed 3 buttons vertically on a GroupBox.
    When I hide the 1rst one, the others move up, as if were justified to top.
    Qt Code:
    1. ui->button1->hide() ;
    To copy to clipboard, switch view to plain text mode 

    How could I avoid that ?


    +++

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: How to define object position unchangeable ?

    GroupBox? What's that? Perhaps you mean QGroupBox.

    QGroupBox behaves that way, and usually it is sensible and really how it should work. After all, when you placed your buttons in the QGroupBox, you didn't define their absolute positions -- you let the box decide.

    But if you want to define absolute positions, don't use QGroupBox or a layout -- just place the buttons individually where you want.

  3. The following user says thank you to mvuori for this useful post:

    andre_teprom (26th July 2013)

  4. #3
    Join Date
    Apr 2011
    Posts
    124
    Thanks
    1
    Thanked 10 Times in 10 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Symbian S60

    Default Re: How to define object position unchangeable ?

    Yep, just place the buttons where you want them, without a layout manager. Or create your own layout manager that does what you want.

  5. The following user says thank you to DanH for this useful post:

    andre_teprom (26th July 2013)

Similar Threads

  1. How define an interface for a Qt object
    By hubbobubbo in forum Qt Programming
    Replies: 7
    Last Post: 24th August 2013, 12:37
  2. Replies: 4
    Last Post: 15th July 2011, 18:31
  3. Replies: 4
    Last Post: 20th August 2010, 13:07
  4. Replies: 4
    Last Post: 3rd August 2010, 12:30
  5. where should i put #define in QtDesigner?
    By nass in forum Qt Tools
    Replies: 1
    Last Post: 16th October 2006, 15:52

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.