Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Maintain aspect ratio of application
Forum Update on Monday, May 27th 2025

Maintain aspect ratio of application

Scheduled Pinned Locked Moved Unsolved General and Desktop
qlayout
2 Posts 2 Posters 466 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    arjun98
    wrote on last edited by
    #1

    I am trying to create a web application with multiple pages and widget. I would like to know how to use Qt designer to get the following effect. If the page is 800 by 480, I want widget 1 to be 200,120 (ie 0.25 * screenwidth, 0.25*screenheight) at 600 120,(ie 0.75 * screenwidth, 0.25 *screenheight) , widget 2 to be 400, 48(ie 0.5 * screenwidth, 0.1 *screenheight) at 200, 240,(0.25 *screenwidth, 0.5 *screenheight) . Thus if the page was resized to 1600, 960, the page and widget would be moved and resized such that widget1 would be 400,240 at position 1200, 240 and widget 2 would be 800, 96 at position 400, 480.
    Moreover I don't want to create a fixed window size as in once the application, I want to widgets to move and be resize as the window is resized.
    Is this best achieved using layouts, if so how does one achieve this?
    Thanks,
    Arjun

    1 Reply Last reply
    0
    • nageshN Offline
      nageshN Offline
      nagesh
      wrote on last edited by
      #2

      @arjun98 I think this can be achieved In the layout by setting the strech factor

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved