Q1:我对qml,quick1.0和quick2.0感到困惑.它们之间有什么区别.
我使用基于qt 5.1.1的qt creator 2.8.1.我想开发一个桌面程序,我应该使用哪种技术?
Q2:如何将数据导出到快速程序?我只找到关于qml的文档v 4.7.
我见过引用所有三个在Qt的网站的各个部分,这些应用程序的,但我在它们之间,以及他们是否实际上是不同的东西或者只是叫法不同同样的事情,或者名称随时间变化的具体差异完全不明?或者是不再支持?与这些有什么关系?
我是Qt-Quick的初学者.我不知道Qt是QML的基础.而且我也不熟悉C++,它也是Qt和QML的主要支持语言.我知道JS可以在QML层中做很多逻辑.但是如果我们需要与OS进行交互,那么我们必须使用一些基本语言.由于我对Python感到满意,我正在计划" QML-JS-Python "组合.
所以,我的问题:
抱歉,如果我愚蠢地提出这些问题.但我想提出建议和意见.
编辑:此组合QML-JS-Python的任何限制
提前致谢
我真的很喜欢QML.我喜欢如何定义组件(与类相比)及其属性,并从其他地方(与对象相比)实例化它们.
我可以说,一个按钮,有一些外观和感觉,上面有标签文字.例如,可以使用此组件定义(Button.qml)来完成此操作:
Item {
    id: button
    property string label
    anchors.fill: parent
    Rectangle {
        anchors.fill: parent
        radius: 10
        color: "gray"
        Text {
            anchors.centerIn: parent
            font.pixelSize: 20
            text: button.label
            color: "white"
        }
    }
}
并在此主文件(main.qml)中实例化:
Rectangle {
    width: 300
    height: 200
    Button {
        anchors.centerIn: parent
        anchors.margins: 50
        label: "Hello button!"
    }
}
但我看到以下限制:我只能定义一个带有一些属性的按钮模板,而不是一些占位符.实例中定义的所有子项都是直接子项,至少是默认值,我想更改此行为.
假设我想在按钮中放置一个项目(让我们说一个图像,但我不想告诉Button它将是一个图像的定义).我想象这样的事情:
Item {
    id: button
    property Item contents   <-- the client can set the placeholder content here
    anchors.fill: parent …有没有办法让qml应用程序的窗口透明?
我正在寻找有关如何使用qml绘制简单形状的详细说明,同时使应用程序的窗口透明,以及背景.一个工作源代码演示将是非常棒的.
我有一个MouseArea,我想开始居中,然后按下上/下/左/右键后有一个绝对位置.我的问题是我不知道如何清除MouseArea上的锚点,以便我可以指定一个绝对位置:
import QtQuick 2.0
import QtQuick.Window 2.0
Window {
    id: screen
    width: 360
    height: 360
    visible: true
    Rectangle {
        anchors.fill: parent
        states: [
            State {
                name: "moved"
                AnchorChanges {
                    target: mouseArea
                    anchors.bottom: undefined
                    anchors.left: undefined
                    anchors.right: undefined
                    anchors.top: undefined
                }
            }
        ]
        MouseArea {
            id: mouseArea
            anchors.centerIn: parent
            width: 250
            height: 250
            focus: true
            onClicked: console.log("clicked!")
            onPositionChanged: console.log("position changed!")
            function moveMouseArea(x, y) {
                mouseArea.x += x;
                mouseArea.y += y;
                mouseArea.state = "moved";
                mouseAreaPosText.text = 'Mouse area was moved... new pos: …我只想知道我们在QML中是否有像QML中的私有属性那样的概念访问说明符.
如果不是,如果我想知道我的QML组件中有大约10个属性,但我必须限制只有2个属性的访问权限.我们怎样才能实现这种情况.
我有一个桌面的QtQuick项目.这很简单:
// import QtQuick 1.0 // to target S60 5th Edition or Maemo 5
import QtQuick 1.1
Rectangle {
    width: 360
    height: 360
    Grid
    {
        id: xGrid
        width: parent.width
        height: parent.height
        columns: 2
        spacing: 1
        Rectangle
        {
            height: parent.height
            width: 10
            color: "#ff0000"
            Text {
                id: xText
                text: qsTr("t\na\ns")
            }
        }
        TextEdit
        {
            id: xTextEdit
            height: parent.height
            width: 350
            Keys.onEnterPressed: {
                console.log(event.key)
                xText.text = (qsTr("A"))
            }
        }
    }
}
我的代码没有像我想的那样运行.在Keys.onEnterPressed似乎从来没有被捕获,所以我尝试Keys.onPressed它的工作,但不知道为什么,当我按下Enter,则even.key返回16777220.  
有谁得到这个问题?我该如何解决?
感谢您的回答!
我目前正在使用Qt 5.2.1 ......我有一个(也许是愚蠢的?)问题:QQuickView和之间的区别是什么QQuickWindow?
我看了文档,但我还不清楚......
qt-quick ×10
qml ×9
qt ×8
c++ ×2
qtquick2 ×2
position ×1
python ×1
qt-creator ×1
qt-designer ×1
qt5 ×1
transparent ×1