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. Compute window size for a custom dialog based application
Forum Updated to NodeBB v4.3 + New Features

Compute window size for a custom dialog based application

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 932 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.
  • C Offline
    C Offline
    cristeab
    wrote on last edited by
    #1

    Hi

    I am writting in QML a dialog based application for multiple OSs (Windows, OSX, Linux). The problem I am facing is how to set the window size in order to have a pleasing aspect on different screens:
    I have tried the following:

    width: 55Screen.pixelDensity
    height: 110
    Screen.pixelDensity

    where 55x110 should be the desired window size in mm, but the resulting size is not fixed on different screen resolutions. Could you recommend another approach for computing the window size ?

    thanks
    Bogdan

    1 Reply Last reply
    0
    • JeroentjehomeJ Offline
      JeroentjehomeJ Offline
      Jeroentjehome
      wrote on last edited by
      #2

      Hi, I don't know if QML has simular events, but in C++ there are events/slots called (can't remember if it are slots or events):
      sizeForHeight and sizeForWidth
      There you're able to set the desired size for a set value.

      Greetz, Jeroen

      1 Reply Last reply
      0
      • C Offline
        C Offline
        cristeab
        wrote on last edited by
        #3

        Yes, but I am facing a different problem: how to compute width and height so that my window has the same size on different screen resolutions

        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