Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QML Window.with in android
QtWS25 Last Chance

QML Window.with in android

Scheduled Pinned Locked Moved Solved Mobile and Embedded
2 Posts 2 Posters 360 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.
  • M Offline
    M Offline
    msauer75
    wrote on last edited by
    #1

    Hello,

    in my qml application I use window.with to determine the window resolution. On my linux pc I will get the correct value, but on an android device I will get 0 for width.
    Do you know how can I get the window resolution in qml?

    Thank you for your help
    BR
    martin

    J.HilkJ 1 Reply Last reply
    0
    • M msauer75

      Hello,

      in my qml application I use window.with to determine the window resolution. On my linux pc I will get the correct value, but on an android device I will get 0 for width.
      Do you know how can I get the window resolution in qml?

      Thank you for your help
      BR
      martin

      J.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on last edited by
      #2

      hi @msauer75

      Screen should help you

      import QtQuick.Window 2.13
      ...
      ...
      Component.onCompleted:{
           console.log(Screen.desktopAvailableHeight, Screen.desktopAvailableWidth, Screen.devicePixelRatio, Screen.pixelDensity)
      }
      

      Reference:
      https://doc.qt.io/qt-5/qml-qtquick-window-screen.html


      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      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