Results 1 to 4 of 4

Thread: Applying the horizontal and vertical layouts ensures that the application UI scales

  1. #1
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Applying the horizontal and vertical layouts ensures that the application UI scales

    I'm newbie with some programming experience. I downloaded QTCreator 2.0.1 on a Ubuntu box. I'm doing the tutorial "Creating a Qt C++ Application" from the from the QT Creator Documentation.

    I've created my label, LineEditor and TextBox, Applied both the Vertical and Horizontal Layout as explained on the tutorial, When I compile and execute the program. I drag to increase the main box, The widgets I created don't scale (stretch) like I expected them to.

    I'm doing something wrong.

  2. #2
    Join Date
    May 2010
    Location
    Romania
    Posts
    1,021
    Thanks
    62
    Thanked 260 Times in 246 Posts
    Qt products
    Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Applying the horizontal and vertical layouts ensures that the application UI scal

    Show some code... or attach a little sample that replicate the problem you have.

    Also are you creating the layouts with Designer or code?
    If you use the Designer apply a layout by selecting the "form" in the "background" of the QLabel, QLineEdit and other QWidgets.
    If you are creating with code make sure that the layout is properly parented, i meant that you have a QWidget to act as a "form" and this is the parent to layout and this will be the widget you show()...

  3. #3
    Join Date
    Nov 2010
    Posts
    97
    Thanks
    6
    Thanked 11 Times in 11 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Applying the horizontal and vertical layouts ensures that the application UI scal

    Quote Originally Posted by robertomason@gmail.com View Post
    I'm newbie with some programming experience. I downloaded QTCreator 2.0.1 on a Ubuntu box. I'm doing the tutorial "Creating a Qt C++ Application" from the from the QT Creator Documentation.

    I've created my label, LineEditor and TextBox, Applied both the Vertical and Horizontal Layout as explained on the tutorial, When I compile and execute the program. I drag to increase the main box, The widgets I created don't scale (stretch) like I expected them to.

    I'm doing something wrong.
    My guess is that you either didn't set the layout for the window or you didn't add your objects to the layout.
    This rude guy who doesn't want you to answer his questions.

    Note: An "expert" here is just someone that's posted a lot.

    "The fact of where you do the encapsulation is meaningless." - Qt Certified Developer and forum moderator

  4. #4
    Join Date
    Jan 2011
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Applying the horizontal and vertical layouts ensures that the application UI scal

    Thanks for you quick answer. I was using the Designer. It now works. I selected the Form and I applied the layout to the form.

    Thanks

Similar Threads

  1. Applying Layouts causes screen mess-up
    By mpp03 in forum Qt Programming
    Replies: 4
    Last Post: 22nd November 2010, 14:56
  2. Vertical and horizontal QDockWidget, priority?
    By Teuniz in forum Qt Programming
    Replies: 1
    Last Post: 14th June 2010, 10:25
  3. Resize a vertical an horizontal scrollbar.
    By IRON_MAN in forum Qt Programming
    Replies: 3
    Last Post: 19th April 2010, 15:45
  4. How to get vertical/horizontal zoom box?
    By knicewar in forum Qwt
    Replies: 3
    Last Post: 23rd March 2010, 04:09
  5. QGraphicsItem Horizontal/Vertical move only
    By prashant in forum Qt Programming
    Replies: 2
    Last Post: 9th November 2009, 09:02

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.