查看完整版本: [-- qml QtQuick.Controls 2.0 与之前版本怎样整合 --]

QTCN开发网 -> Qt QML开发 -> qml QtQuick.Controls 2.0 与之前版本怎样整合 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

dyongfly 2016-09-08 00:17

qml QtQuick.Controls 2.0 与之前版本怎样整合

    现在遇到一个问题,ExculiveGroup这个方法的时候,Qt文档明确说明导入 import QtQuick.Controls 1.4, 但是我的qml文件中已经导入了2.0 版本的Controller(必须使用这个版本) ,如果两个都导入的话只会识别最后一次导入的。但ExculiveGroup这个我也要在同一个qml文件中使用,请问大家,这个该怎么解决呢?

lemonzll 2016-09-08 08:29
import QtQuick 2.4
import QtQuick.Controls 2.0
import QtQuick.Controls 1.4 as Controls
import QtQuick.Layouts 1.2

ApplicationWindow {
    visible: true
    width: 640
    height: 480
    title: qsTr("Hello World")


    ColumnLayout {
        anchors.fill: parent
        anchors.margins: 6

        Button {                               //2.0版本的
            text: "Button A"
        }

        Controls.Button {             //1.4版本的
            text: "Button B"
        }
        Item {
            Layout.fillHeight: true
        }
    }
}

dyongfly 2016-09-08 22:11
lemonzll:import QtQuick 2.4
import QtQuick.Controls 2.0
import QtQuick.Controls 1.4 as Controls
import QtQuick.Layouts 1.2
....... (2016-09-08 08:29) 

明白了,谢谢

神经023 2017-02-16 09:26
多谢


查看完整版本: [-- qml QtQuick.Controls 2.0 与之前版本怎样整合 --] [-- top --]



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