Results 1 to 8 of 8

Thread: problem while resizing mainwindow.

  1. #1
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default problem while resizing mainwindow.

    in my main window i've 5 lables in a horaizenatllayout. all lable sizepolicy are setting to Prefered.
    in my ctor i did like
    Qt Code:
    1. ui->horizontalLayout->setSizeConstraint(QLayout::SetDefaultConstraint);
    To copy to clipboard, switch view to plain text mode 
    But the lables size are not resizing with the main window.
    I've attched the ui. plz help me how to solve it. Thank u all.
    Attached Files Attached Files
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: problem while resizing mainwindow.

    Quote Originally Posted by phillip_Qt View Post
    But the lables size are not resizing with the main window.
    You have forgot to add a main layout of the dialog, I corrected that. Please see the attched UI file.
    Attached Files Attached Files

  3. #3
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem while resizing mainwindow.

    Quote Originally Posted by yogeshgokul View Post
    You have forgot to add a main layout of the dialog, I corrected that. Please see the attched UI file.
    Thank you veru much. It worked perfectly. Can u plz tell me how to add main layout using designer.?
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  4. #4
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: problem while resizing mainwindow.

    Quote Originally Posted by phillip_Qt View Post
    Thank you veru much. It worked perfectly. Can u plz tell me how to add main layout using designer.?
    Its easy, just right the widget/dialog/mainWindow (what ever you are designing using designer) and select any layout from submenu or use keyboard shortcuts.

  5. #5
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem while resizing mainwindow.

    Quote Originally Posted by yogeshgokul View Post
    Its easy, just right the widget/dialog/mainWindow (what ever you are designing using designer) and select any layout from submenu or use keyboard shortcuts.
    Thank u yogesh. But i problem i faced like once i've added the layout i cannt change the size of widget i'm adding to the main window. i 've 2 add a tree widget in left hand side and a group box in right side like i've added in the attched one. can u plz chk it out, how to do so?
    Last edited by phillip_Qt; 10th November 2009 at 06:05. Reason: to give more explantion
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  6. #6
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: problem while resizing mainwindow.

    Quote Originally Posted by phillip_Qt View Post
    Thank u yogesh. But i problem i faced like once i've added the layout i cannt change the size of widget i'm adding to the main window. i 've 2 add a tree widget in left hand side and a group box in right side like i've added in the attched one. can u plz chk it out, how to do so?
    You should add the main lay out at the last of your design.
    Steps:
    1. Create an empty dialog.
    2. Add few widgets to it by dragging and dropping.
    3. Add those widgets in some layout, lets say in grid layout.
    4. At last, right click on dialog and select a layout. This layout will be the main layout of the dialog and should be added at last only.
    Please clean your hands on Qt-Designer, do some more practice, its a great tool.

  7. #7
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: problem while resizing mainwindow.

    Quote Originally Posted by yogeshgokul View Post
    You should add the main lay out at the last of your design.
    Steps:
    1. Create an empty dialog.
    2. Add few widgets to it by dragging and dropping.
    3. Add those widgets in some layout, lets say in grid layout.
    4. At last, right click on dialog and select a layout. This layout will be the main layout of the dialog and should be added at last only.
    Please clean your hands on Qt-Designer, do some more practice, its a great tool.
    Hi Yogesh.
    Thanx 4 quick reply. I tried the way 2 told, but still its not working. Can u plz chk the attched attched ui?
    Attached Files Attached Files
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  8. #8
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: problem while resizing mainwindow.

    Thank yoy Yogesh. I sorted out this problem. Thank u very much.
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

Similar Threads

  1. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  2. Steps in solving a programming problem?
    By triperzonak in forum General Programming
    Replies: 8
    Last Post: 5th August 2008, 08:47
  3. mainwindow modality
    By user in forum Qt Programming
    Replies: 0
    Last Post: 11th July 2008, 00:54
  4. Replies: 2
    Last Post: 14th August 2007, 15:16
  5. Widget resizing problem
    By fwohlfert in forum Qt Programming
    Replies: 3
    Last Post: 23rd February 2006, 08:16

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.