qt for android show Rectangle not true



  • 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?



  • 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{
    
                    }
                }
            }
        }
    }
    

Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.