• 1395阅读
  • 0回复

[提问]QML 里如何实现Combox旋转90度后单击combox横向展开 [复制链接]

上一主题 下一主题
离线wang6354
 

只看楼主 倒序阅读 楼主  发表于: 2021-03-27
我想把界面旋转90度使用,父控件设置rotation: 90,但在加入Combox后,Combox是旋转了,但发现单击combox弹出的界面没有同步旋转,依然是竖向显示的,如何改成横向显示呢?


源码如下:
import QtQuick 2.12
import QtQuick.Window 2.12
import QtQuick.Controls 2.5
Window {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")
    Rectangle{
        anchors.fill: parent
        rotation: 90
        GroupBox{
            width: 240
            height: 120
            anchors.centerIn: parent
            title: qsTr("Sensor Number")

            ComboBox{
                anchors.fill:parent
                editable: false
                model: ["1","2","3","4","5","6","7","8","9","10","11","12",]
            }
        }
    }
}





求大神帮忙看一下,
快速回复
限100 字节
 
上一个 下一个