Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to keep ApplicationWindow aspect ratio
Forum Updated to NodeBB v4.3 + New Features

How to keep ApplicationWindow aspect ratio

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 503 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.
  • R Offline
    R Offline
    RedEx 0
    wrote on last edited by RedEx 0
    #1

    I want keep aspect ratio (16:9) for a ApplicationWindow.
    Resizing the window until the user releases the mouse button does not work.

    Qt 5.13, Windows, Linux, Mac OS

    Example:

    ApplicationWindow {
        readonly property real aspectRatio: 16.0/ 9.0
        //...
        onHeightChanged: {
            width = height * aspectRatio
        }
        
    }
    

    Is'n work.
    Any attempts to resize from the code (QML or C++) do not work while the user resizes the window.

    1 Reply Last reply
    0
    • K Offline
      K Offline
      Karasikq
      wrote on last edited by
      #2

      Is it any solution for this?

      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