Results 1 to 7 of 7

Thread: Qt resize child Window...

  1. #1
    Join Date
    Oct 2009
    Posts
    70
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Qt resize child Window...

    Hi, I have this problem:
    How to resize child tab widget which width must be 100% of MainWindow width...I tried: setGeometry(QRect(0,0,rect().width(),150)); But it just set up this width, when I resize window MainWindow, inherited by QMainWindow, then width is constant...do you have any solutions...I was looking on the google and nothing...

  2. #2
    Join Date
    Oct 2009
    Posts
    70
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Qt resize child Window...


  3. #3
    Join Date
    Nov 2009
    Posts
    15

    Default Re: Qt resize child Window...

    I don't know if you want to do this but... Why don't you lay out the tab widget?

  4. #4
    Join Date
    Oct 2009
    Posts
    70
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Qt resize child Window...

    It still doesn't work ...I used QVBoxLayout and it doesn't work...do you have any idea how can I do it?

  5. #5
    Join Date
    Nov 2009
    Posts
    15

    Default Re: Qt resize child Window...

    Quote Originally Posted by Peppy View Post
    It still doesn't work ...I used QVBoxLayout and it doesn't work...do you have any idea how can I do it?
    I think that your code is incomplete.

    This works for me:

    Qt Code:
    1. horizontalLayout = new QHBoxLayout();
    2. tabWidget = new QTabWidget();
    3. tab = new QWidget();
    4. tabWidget->addTab(tab, QString());
    5. tab_2 = new QWidget();
    6. tabWidget->addTab(tab_2, QString());
    7. horizontalLayout->addWidget(tabWidget);
    To copy to clipboard, switch view to plain text mode 

    Then you can set sizePolicy and/or max-min Size for the tabWidget (or add vertical spacer) if you don't want to lay out all the height.

  6. #6
    Join Date
    Oct 2009
    Posts
    70
    Thanks
    2
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: Qt resize child Window...

    It doesn't help me.

  7. #7
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt resize child Window...

    Quote Originally Posted by Peppy View Post
    It doesn't help me.
    In what way?

Similar Threads

  1. Replies: 2
    Last Post: 9th August 2009, 22:08
  2. QWorkspace: child window layouts?
    By LiCodeX in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2008, 07:50
  3. connecting child to parent window...
    By sumit in forum Qt Programming
    Replies: 1
    Last Post: 19th October 2008, 21:28
  4. How to close parent window from child window?
    By montylee in forum Qt Programming
    Replies: 5
    Last Post: 14th October 2008, 11:40
  5. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 09:30

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.