Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. Chinese
  4. qt for android show Rectangle not true
Qt 6.11 is out! See what's new in the release blog

qt for android show Rectangle not true

Scheduled Pinned Locked Moved Unsolved Chinese
2 Posts 1 Posters 990 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.
  • X Offline
    X Offline
    xueke
    wrote on last edited by
    #1

    Windows is normal, Android is very small and very careful to be seen. What should I do to be consistent with the size of the windows PC display?

    1 Reply Last reply
    0
    • X Offline
      X Offline
      xueke
      wrote on last edited by
      #2
      import QtQuick 2.2
      import QtQuick.Controls 1.1
      import QtQuick.Layouts 1.0
      import QtQuick.Window 2.2
      ApplicationWindow {
          id:root;
          title: qsTr("Hello World")
          width: Screen.width
          height: Screen.height
          visible: true
          property real dpScale:  1.5;
          readonly property real dpi: Math.max(Screen.pixelDensity * 25.4 / 160 * dpScale, 1);
          Rectangle{
              anchors.fill:parent;
              z:1;
              RowLayout{
                  spacing:1*dpi;
                   anchors.bottom:parent.bottom;
                  Rectangle{
                      width:(Screen.width/3)*dpi;
                      height:20*dpi;
                      color:"blue";
                      Image{
      
                      }
                  }
                  Rectangle{
                      width:(Screen.width/3)*dpi;
                      height:20*dpi;
                      color:"red";
                      Image{
      
                      }
                  }
                  Rectangle{
                      width:(Screen.width/3)*dpi;
                      height:20*dpi;
                      color:"blue";
                      Image{
      
                      }
                  }
              }
          }
      }
      
      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