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. problem with Screen.width
Forum Updated to NodeBB v4.3 + New Features

problem with Screen.width

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

    Hello,

    I have an main app which run another app, I need to place this second app properly according to the main app. for this I use in my second app the code :
    x : Screen.width * 15/100
    y : Screen.height * 50/100

    and the app is properly located.

    My problem and that if I run my main app in another computer with a screen size different, the second app is wrong located when I run it.

    I suppose that during the compilation the variable Screen.width reccords the size of the screen currently, but how can I do to take the size of the screen when I run my second app whatever if I change of computer.

    I hope you understand my problem.

    thanks

    1 Reply Last reply
    0
    • dheerendraD Offline
      dheerendraD Offline
      dheerendra
      Qt Champions 2022
      wrote on last edited by
      #2

      During the compilation you cannot record the width and height of the screen. Best thing is that when the first app runs read the screen sizes and pass this as command line parameters to second app. Parameters you can pass are relative to first App.

      Dheerendra
      @Community Service
      Certified Qt Specialist
      http://www.pthinks.com

      1 Reply Last reply
      1

      • Login

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