查看完整版本: [-- QML 里如何实现Combox旋转90度后单击combox横向展开 --]

QTCN开发网 -> Qt嵌入式开发 -> QML 里如何实现Combox旋转90度后单击combox横向展开 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

wang6354 2021-03-27 00:07

QML 里如何实现Combox旋转90度后单击combox横向展开

我想把界面旋转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",]
            }
        }
    }
}





求大神帮忙看一下,


查看完整版本: [-- QML 里如何实现Combox旋转90度后单击combox横向展开 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled