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. UI element size as a fraction of window size in qtdesigner
Qt 6.11 is out! See what's new in the release blog

UI element size as a fraction of window size in qtdesigner

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 735 Views 1 Watching
  • 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.
  • canellasC Offline
    canellasC Offline
    canellas
    wrote on last edited by canellas
    #1

    Hi,
    Is it possible to define the size of a UI control, a QFrame, for example, as a fraction, or percentage, of the window size? Something like '0.6 * MainWindow.width()', but not in the constructor of the 'MainWindow', or in response to a resize event, but in QtDesigner?

    Thanks!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      AFAIK, no, it's not possible.

      That's usually something you can do using the stretch factor on the layout you use.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • canellasC Offline
        canellasC Offline
        canellas
        wrote on last edited by
        #3

        I'll take a deeper look at the stretch factor.

        Thanks!

        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