Results 1 to 2 of 2

Thread: Qt widget ratio

  1. #1
    Join Date
    Jul 2012
    Posts
    20
    Thanks
    8
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4

    Default Qt widget ratio

    I create a pushButton and a lineEdit, then put them into a horizontalLayout.
    Is there a way to set pushButton.width() : lineEdit.width() = 1 : 7 ??? (without hard pixel for each)

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Qt widget ratio

    Yes, use the second argument to your addWidget() calls. See the [doc=/layout.html#stretch-factors]Layout Management[/docs] for more on stretch factors.

Similar Threads

  1. Printing and Aspect ratio
    By cpt4 in forum Qwt
    Replies: 9
    Last Post: 30th September 2011, 14:28
  2. Replies: 1
    Last Post: 3rd August 2011, 10:34
  3. Expand and keep ratio
    By nifei in forum Qt Programming
    Replies: 1
    Last Post: 8th September 2009, 16:19
  4. QProcess+mPlayer+Aspect Ratio
    By IGHOR in forum Qt Programming
    Replies: 0
    Last Post: 22nd March 2008, 03:14
  5. aspect ratio of top-level widgets
    By urbangipsy in forum Qt Programming
    Replies: 3
    Last Post: 16th January 2007, 21:49

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.