Merge remote-tracking branch 'origin/4.5'
Change-Id: I0194bdeda71e33fd5bc9cb3eb7a9198ae72815ed
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of Qt Creator
|
** This file is part of Qt Creator
|
||||||
@@ -48,9 +48,8 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.7
|
import QtQuick 2.9
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls 2.2
|
||||||
import QtQuick.Layouts 1.0
|
|
||||||
|
|
||||||
Image {
|
Image {
|
||||||
source: "Bluebubble.svg"
|
source: "Bluebubble.svg"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of Qt Creator
|
** This file is part of Qt Creator
|
||||||
@@ -47,14 +47,21 @@
|
|||||||
** $QT_END_LICENSE$
|
** $QT_END_LICENSE$
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
import QtQuick 2.9
|
||||||
|
import QtQuick.Controls 2.2
|
||||||
|
|
||||||
import QtQuick 2.7
|
Page {
|
||||||
import QtQuick.Controls 2.0
|
width: 600
|
||||||
import QtQuick.Layouts 1.0
|
height: 400
|
||||||
|
|
||||||
Item {
|
|
||||||
property alias mainWindow: mainWindow
|
|
||||||
property alias bubble: bubble
|
property alias bubble: bubble
|
||||||
|
property alias mainWindow: mainWindow
|
||||||
|
|
||||||
|
header: Label {
|
||||||
|
text: qsTr("Page 1")
|
||||||
|
font.pixelSize: Qt.application.font.pixelSize * 2
|
||||||
|
padding: 10
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: mainWindow
|
id: mainWindow
|
||||||
color: "#ffffff"
|
color: "#ffffff"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of Qt Creator
|
** This file is part of Qt Creator
|
||||||
@@ -47,9 +47,21 @@
|
|||||||
** $QT_END_LICENSE$
|
** $QT_END_LICENSE$
|
||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
import QtQuick 2.9
|
||||||
|
import QtQuick.Controls 2.2
|
||||||
|
|
||||||
import QtQuick 2.7
|
Page {
|
||||||
|
width: 600
|
||||||
Page1Form {
|
height: 400
|
||||||
|
|
||||||
|
header: Label {
|
||||||
|
text: qsTr("Page 2")
|
||||||
|
font.pixelSize: Qt.application.font.pixelSize * 2
|
||||||
|
padding: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("You are on Page 2.")
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@@ -1,17 +1,7 @@
|
|||||||
QT += qml quick sensors svg xml
|
QT += quick sensors svg xml
|
||||||
|
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
|
|
||||||
SOURCES += main.cpp
|
|
||||||
|
|
||||||
RESOURCES += qml.qrc
|
|
||||||
|
|
||||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
|
||||||
QML_IMPORT_PATH =
|
|
||||||
|
|
||||||
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
|
||||||
QML_DESIGNER_IMPORT_PATH =
|
|
||||||
|
|
||||||
# The following define makes your compiler emit warnings if you use
|
# The following define makes your compiler emit warnings if you use
|
||||||
# any feature of Qt which as been marked deprecated (the exact warnings
|
# any feature of Qt which as been marked deprecated (the exact warnings
|
||||||
# depend on your compiler). Please consult the documentation of the
|
# depend on your compiler). Please consult the documentation of the
|
||||||
@@ -23,7 +13,25 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
|||||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
|
SOURCES += main.cpp
|
||||||
|
|
||||||
|
RESOURCES += qml.qrc
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||||
|
QML_IMPORT_PATH =
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
||||||
|
QML_DESIGNER_IMPORT_PATH =
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
!isEmpty(target.path): INSTALLS += target
|
!isEmpty(target.path): INSTALLS += target
|
||||||
|
|
||||||
|
ios {
|
||||||
|
QTPLUGIN += qsvg qsvgicon qtsensors_ios
|
||||||
|
QMAKE_INFO_PLIST = Info.plist
|
||||||
|
}
|
||||||
|
|
||||||
|
DISTFILES += \
|
||||||
|
Bluebubble.svg
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of Qt Creator
|
** This file is part of Qt Creator
|
||||||
@@ -54,10 +54,13 @@
|
|||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||||
|
if (engine.rootObjects().isEmpty())
|
||||||
|
return -1;
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of Qt Creator
|
** This file is part of Qt Creator
|
||||||
@@ -48,10 +48,9 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick 2.7
|
import QtQuick 2.9
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick.Controls 2.2
|
||||||
import QtQuick.Layouts 1.0
|
import QtSensors 5.9
|
||||||
import QtSensors 5.7
|
|
||||||
|
|
||||||
ApplicationWindow {
|
ApplicationWindow {
|
||||||
visible: true
|
visible: true
|
||||||
@@ -59,8 +58,12 @@ ApplicationWindow {
|
|||||||
height: 480
|
height: 480
|
||||||
title: qsTr("Accelerate Bubble")
|
title: qsTr("Accelerate Bubble")
|
||||||
|
|
||||||
Page1 {
|
SwipeView {
|
||||||
|
id: swipeView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
currentIndex: tabBar.currentIndex
|
||||||
|
|
||||||
|
Page1Form {
|
||||||
bubble {
|
bubble {
|
||||||
id: bubble
|
id: bubble
|
||||||
centerX: mainWindow.width / 2
|
centerX: mainWindow.width / 2
|
||||||
@@ -84,6 +87,22 @@ ApplicationWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Page2Form {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
footer: TabBar {
|
||||||
|
id: tabBar
|
||||||
|
currentIndex: swipeView.currentIndex
|
||||||
|
|
||||||
|
TabButton {
|
||||||
|
text: qsTr("Page 1")
|
||||||
|
}
|
||||||
|
TabButton {
|
||||||
|
text: qsTr("Page 2")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Accelerometer {
|
Accelerometer {
|
||||||
id: accel
|
id: accel
|
||||||
dataRate: 100
|
dataRate: 100
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>main.qml</file>
|
|
||||||
<file>Page1.qml</file>
|
|
||||||
<file>Page1Form.ui.qml</file>
|
<file>Page1Form.ui.qml</file>
|
||||||
|
<file>Page2Form.ui.qml</file>
|
||||||
<file>qtquickcontrols2.conf</file>
|
<file>qtquickcontrols2.conf</file>
|
||||||
<file>Bubble.qml</file>
|
<file>Bubble.qml</file>
|
||||||
<file>Bluebubble.svg</file>
|
<file>Bluebubble.svg</file>
|
||||||
|
<file>main.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
; This file can be edited to change the style of the application
|
; This file can be edited to change the style of the application
|
||||||
; See Styling Qt Quick Controls 2 in the documentation for details:
|
; Read "Qt Quick Controls 2 Configuration File" for details:
|
||||||
; http://doc.qt.io/qt-5/qtquickcontrols2-styles.html
|
; http://doc.qt.io/qt-5/qtquickcontrols2-configuration.html
|
||||||
|
|
||||||
[Controls]
|
[Controls]
|
||||||
Style=Default
|
Style=Default
|
||||||
|
|
||||||
[Universal]
|
|
||||||
Theme=Light
|
|
||||||
;Accent=Steel
|
|
||||||
|
|
||||||
[Material]
|
|
||||||
Theme=Light
|
|
||||||
;Accent=BlueGrey
|
|
||||||
;Primary=BlueGray
|
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
import QtQuick 2.7
|
|
||||||
|
|
||||||
Page1Form {
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,66 @@
|
|||||||
import QtQuick 2.7
|
/****************************************************************************
|
||||||
import QtQuick.Controls 2.0
|
**
|
||||||
import QtQuick.Layouts 1.3
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** BSD License Usage
|
||||||
|
** Alternatively, you may use this file under the terms of the BSD license
|
||||||
|
** as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
import QtQuick 2.9
|
||||||
|
import QtQuick.Controls 2.2
|
||||||
|
|
||||||
Item {
|
Page {
|
||||||
id: page
|
id: page
|
||||||
width: 300
|
width: 600
|
||||||
height: 300
|
height: 400
|
||||||
|
|
||||||
|
header: Label {
|
||||||
|
text: qsTr("Page 1")
|
||||||
|
font.pixelSize: Qt.application.font.pixelSize * 2
|
||||||
|
padding: 10
|
||||||
|
}
|
||||||
|
|
||||||
property alias icon: icon
|
property alias icon: icon
|
||||||
property alias topLeftRect: topLeftRect
|
property alias topLeftRect: topLeftRect
|
||||||
property alias bottomLeftRect: bottomLeftRect
|
property alias bottomLeftRect: bottomLeftRect
|
||||||
|
|||||||
67
doc/examples/transitions/Page2Form.ui.qml
Normal file
@@ -0,0 +1,67 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** BSD License Usage
|
||||||
|
** Alternatively, you may use this file under the terms of the BSD license
|
||||||
|
** as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
import QtQuick 2.9
|
||||||
|
import QtQuick.Controls 2.2
|
||||||
|
|
||||||
|
Page {
|
||||||
|
width: 600
|
||||||
|
height: 400
|
||||||
|
|
||||||
|
header: Label {
|
||||||
|
text: qsTr("Page 2")
|
||||||
|
font.pixelSize: Qt.application.font.pixelSize * 2
|
||||||
|
padding: 10
|
||||||
|
}
|
||||||
|
|
||||||
|
Label {
|
||||||
|
text: qsTr("You are on Page 2.")
|
||||||
|
anchors.centerIn: parent
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,13 +1,66 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** BSD License Usage
|
||||||
|
** Alternatively, you may use this file under the terms of the BSD license
|
||||||
|
** as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
#include <QQmlApplicationEngine>
|
#include <QQmlApplicationEngine>
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
|
||||||
|
|
||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
engine.load(QUrl(QLatin1String("qrc:/main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
|
||||||
|
if (engine.rootObjects().isEmpty())
|
||||||
|
return -1;
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,68 @@
|
|||||||
import QtQuick 2.7
|
/****************************************************************************
|
||||||
|
**
|
||||||
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
|
** Contact: https://www.qt.io/licensing/
|
||||||
|
**
|
||||||
|
** This file is part of Qt Creator
|
||||||
|
**
|
||||||
|
** $QT_BEGIN_LICENSE:BSD$
|
||||||
|
** Commercial License Usage
|
||||||
|
** Licensees holding valid commercial Qt licenses may use this file in
|
||||||
|
** accordance with the commercial license agreement provided with the
|
||||||
|
** Software or, alternatively, in accordance with the terms contained in
|
||||||
|
** a written agreement between you and The Qt Company. For licensing terms
|
||||||
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
||||||
|
** information use the contact form at https://www.qt.io/contact-us.
|
||||||
|
**
|
||||||
|
** BSD License Usage
|
||||||
|
** Alternatively, you may use this file under the terms of the BSD license
|
||||||
|
** as follows:
|
||||||
|
**
|
||||||
|
** "Redistribution and use in source and binary forms, with or without
|
||||||
|
** modification, are permitted provided that the following conditions are
|
||||||
|
** met:
|
||||||
|
** * Redistributions of source code must retain the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer.
|
||||||
|
** * Redistributions in binary form must reproduce the above copyright
|
||||||
|
** notice, this list of conditions and the following disclaimer in
|
||||||
|
** the documentation and/or other materials provided with the
|
||||||
|
** distribution.
|
||||||
|
** * Neither the name of The Qt Company Ltd nor the names of its
|
||||||
|
** contributors may be used to endorse or promote products derived
|
||||||
|
** from this software without specific prior written permission.
|
||||||
|
**
|
||||||
|
**
|
||||||
|
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||||
|
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||||
|
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||||
|
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
|
||||||
|
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
|
||||||
|
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||||
|
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||||
|
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||||
|
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
|
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
|
||||||
|
**
|
||||||
|
** $QT_END_LICENSE$
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
import QtQuick.Controls 2.0
|
import QtQuick 2.9
|
||||||
import QtQuick.Layouts 1.3
|
import QtQuick.Controls 2.2
|
||||||
|
|
||||||
ApplicationWindow {
|
ApplicationWindow {
|
||||||
visible: true
|
visible: true
|
||||||
width: 640
|
width: 640
|
||||||
height: 480
|
height: 480
|
||||||
title: qsTr("Transitions")
|
title: qsTr("Tabs")
|
||||||
|
|
||||||
|
SwipeView {
|
||||||
|
id: swipeView
|
||||||
|
anchors.fill: parent
|
||||||
|
currentIndex: tabBar.currentIndex
|
||||||
|
|
||||||
Page1Form {
|
Page1Form {
|
||||||
anchors.fill: parent
|
|
||||||
id: page
|
id: page
|
||||||
|
|
||||||
mouseArea {
|
mouseArea {
|
||||||
@@ -24,6 +76,10 @@ ApplicationWindow {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Page2Form {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
StateGroup {
|
StateGroup {
|
||||||
id: stateGroup
|
id: stateGroup
|
||||||
states: [
|
states: [
|
||||||
@@ -71,4 +127,16 @@ ApplicationWindow {
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
footer: TabBar {
|
||||||
|
id: tabBar
|
||||||
|
currentIndex: swipeView.currentIndex
|
||||||
|
|
||||||
|
TabButton {
|
||||||
|
text: qsTr("Page 1")
|
||||||
|
}
|
||||||
|
TabButton {
|
||||||
|
text: qsTr("Page 2")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>main.qml</file>
|
<file>main.qml</file>
|
||||||
<file>Page1.qml</file>
|
|
||||||
<file>Page1Form.ui.qml</file>
|
<file>Page1Form.ui.qml</file>
|
||||||
|
<file>Page2Form.ui.qml</file>
|
||||||
|
<file>main.qml</file>
|
||||||
<file>qtquickcontrols2.conf</file>
|
<file>qtquickcontrols2.conf</file>
|
||||||
<file>qt-logo.png</file>
|
<file>qt-logo.png</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
|
|||||||
@@ -1,15 +1,6 @@
|
|||||||
; This file can be edited to change the style of the application
|
; This file can be edited to change the style of the application
|
||||||
; See Styling Qt Quick Controls 2 in the documentation for details:
|
; Read "Qt Quick Controls 2 Configuration File" for details:
|
||||||
; http://doc.qt.io/qt-5/qtquickcontrols2-styles.html
|
; http://doc.qt.io/qt-5/qtquickcontrols2-configuration.html
|
||||||
|
|
||||||
[Controls]
|
[Controls]
|
||||||
Style=Default
|
Style=Default
|
||||||
|
|
||||||
[Universal]
|
|
||||||
Theme=Light
|
|
||||||
;Accent=Steel
|
|
||||||
|
|
||||||
[Material]
|
|
||||||
Theme=Light
|
|
||||||
;Accent=BlueGrey
|
|
||||||
;Primary=BlueGray
|
|
||||||
|
|||||||
@@ -1,17 +1,6 @@
|
|||||||
QT += qml quick
|
QT += quick
|
||||||
|
|
||||||
CONFIG += c++11
|
CONFIG += c++11
|
||||||
|
|
||||||
SOURCES += main.cpp
|
|
||||||
|
|
||||||
RESOURCES += qml.qrc
|
|
||||||
|
|
||||||
# Additional import path used to resolve QML modules in Qt Creator's code model
|
|
||||||
QML_IMPORT_PATH =
|
|
||||||
|
|
||||||
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
|
||||||
QML_DESIGNER_IMPORT_PATH =
|
|
||||||
|
|
||||||
# The following define makes your compiler emit warnings if you use
|
# The following define makes your compiler emit warnings if you use
|
||||||
# any feature of Qt which as been marked deprecated (the exact warnings
|
# any feature of Qt which as been marked deprecated (the exact warnings
|
||||||
# depend on your compiler). Please consult the documentation of the
|
# depend on your compiler). Please consult the documentation of the
|
||||||
@@ -23,6 +12,16 @@ DEFINES += QT_DEPRECATED_WARNINGS
|
|||||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
|
||||||
|
|
||||||
|
SOURCES += main.cpp
|
||||||
|
|
||||||
|
RESOURCES += qml.qrc
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules in Qt Creator's code model
|
||||||
|
QML_IMPORT_PATH =
|
||||||
|
|
||||||
|
# Additional import path used to resolve QML modules just for Qt Quick Designer
|
||||||
|
QML_DESIGNER_IMPORT_PATH =
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
else: unix:!android: target.path = /opt/$${TARGET}/bin
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 7.8 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 8.5 KiB |
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 9.2 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 27 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 76 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 51 KiB |
|
Before Width: | Height: | Size: 4.0 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 54 KiB |
@@ -44,12 +44,6 @@
|
|||||||
The Ministro tool downloads the necessary Qt libraries from a
|
The Ministro tool downloads the necessary Qt libraries from a
|
||||||
repository of your choice.
|
repository of your choice.
|
||||||
|
|
||||||
\li As an incomplete APK that is suitable for testing and debugging
|
|
||||||
applications on a device connected to the development host. The APK
|
|
||||||
relies on the device containing the Qt libraries in the correct
|
|
||||||
location. \QC copies the libraries to that location the first time
|
|
||||||
you deploy the application.
|
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
To specify settings for application packages, select \uicontrol Projects >
|
To specify settings for application packages, select \uicontrol Projects >
|
||||||
|
|||||||
@@ -107,18 +107,20 @@
|
|||||||
Use \QD forms to design a Qt widget based user interface for the
|
Use \QD forms to design a Qt widget based user interface for the
|
||||||
desktop and C++ to implement the application logic
|
desktop and C++ to implement the application logic
|
||||||
|
|
||||||
\li Qt Quick Application
|
\li Qt Quick Application - Empty
|
||||||
|
|
||||||
|
Create an empty Qt Quick application that uses Qt Quick 2 types.
|
||||||
|
|
||||||
Create a Qt Quick application that contains both QML and C++
|
|
||||||
code. The project includes a QQuickView.
|
|
||||||
You can build the application and deploy it to desktop,
|
You can build the application and deploy it to desktop,
|
||||||
embedded, and mobile target platforms.
|
embedded, and mobile target platforms.
|
||||||
|
|
||||||
\li Qt Quick Controls 2 Application
|
\li Qt Quick Application - Scroll, Stack, or Swipe
|
||||||
|
|
||||||
Create a Qt Quick application using
|
Create a Qt Quick application that uses
|
||||||
\l{http://doc.qt.io/qt-5/qtquickcontrols2-index.html}
|
\l{http://doc.qt.io/qt-5/qtquickcontrols2-index.html}
|
||||||
{Qt Quick Controls 2} (requires Qt 5.7 or later)
|
{Qt Quick Controls 2} to implement a scrollable list (requires
|
||||||
|
Qt 5.9 or later) or a set of pages with a stack-based or
|
||||||
|
swipe-based navigation model (requires Qt 5.7 or later).
|
||||||
|
|
||||||
\li Qt Canvas 3D Application
|
\li Qt Canvas 3D Application
|
||||||
|
|
||||||
|
|||||||
@@ -82,14 +82,14 @@
|
|||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li In the \uicontrol Projects view, double-click the Page1Form.ui.qml
|
\li In the \uicontrol Projects view, double-click the \e Page1Form.ui.qml
|
||||||
file to open it in \QMLD.
|
file to open it in \QMLD.
|
||||||
|
|
||||||
\li In the \uicontrol Navigator, select \uicontrol RowLayout and press
|
\li In the \uicontrol Navigator, select \uicontrol Label and press
|
||||||
\key Delete to delete it.
|
\key Delete to delete it.
|
||||||
|
|
||||||
\li In \uicontrol Library > \uicontrol {QML Types}, select
|
\li In \uicontrol Library > \uicontrol {QML Types}, select
|
||||||
\uicontrol Rectangle and drag and drop it to the \uicontrol Item in
|
\uicontrol Rectangle and drag and drop it to the \uicontrol Page in
|
||||||
the navigator.
|
the navigator.
|
||||||
|
|
||||||
\li Select the rectangle in the navigator to edit its properties:
|
\li Select the rectangle in the navigator to edit its properties:
|
||||||
@@ -137,39 +137,32 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\QC creates a reference to the Bubble type in Page1Form.ui.qml.
|
\QC creates a reference to the Bubble type in \e Page1Form.ui.qml.
|
||||||
|
|
||||||
To check your code, you can compare Page1Form.ui.qml with the
|
To check your code, you can compare \e Page1Form.ui.qml with the
|
||||||
\l{accelbubble/Page1Form.ui.qml}{Page1Form.ui.qml} example file and
|
\l{accelbubble/Page1Form.ui.qml}{Page1Form.ui.qml} example file and
|
||||||
Bubble.qml with the \l{accelbubble/Bubble.qml}{Bubble.qml} example file.
|
\e Bubble.qml with the \l{accelbubble/Bubble.qml}{Bubble.qml} example file.
|
||||||
|
|
||||||
The UI is now ready and you can switch to editing the Page1.qml and
|
The UI is now ready and you can switch to editing the \e Bubble.qml and
|
||||||
Bubble.qml files in the \uicontrol {Text Editor}, as described in the
|
\e main.qml files in the \uicontrol {Text Editor}, as described in the
|
||||||
following section.
|
following section.
|
||||||
|
|
||||||
\section1 Moving the Bubble
|
\section1 Moving the Bubble
|
||||||
|
|
||||||
The new project wizard adds boilerplate code to the main.qml file to create
|
In the \uicontrol {Text Editor}, edit \e Bubble.qml to add properties that we
|
||||||
menu items and push buttons. Modify the boilerplate code by removing
|
will use to position the image:
|
||||||
obsolete code and by adding new code. You removed the push buttons from the
|
|
||||||
UI Form, so you also need to remove the corresponding code from Page1.qml
|
|
||||||
(or the application cannot be built).
|
|
||||||
|
|
||||||
In the \uicontrol {Text Editor}, edit Bubble.qml to add properties that we
|
|
||||||
use to will position the image:
|
|
||||||
|
|
||||||
\quotefromfile accelbubble/Bubble.qml
|
\quotefromfile accelbubble/Bubble.qml
|
||||||
\skipto Image
|
\skipto Image
|
||||||
\printuntil }
|
\printuntil }
|
||||||
|
|
||||||
In the \uicontrol {Text Editor}, edit main.qml to specify the application
|
In the \uicontrol {Text Editor}, edit \e main.qml to specify the application
|
||||||
title, as illustrated by the following code snippet:
|
title, as illustrated by the following code snippet:
|
||||||
|
|
||||||
\quotefromfile accelbubble/main.qml
|
\quotefromfile accelbubble/main.qml
|
||||||
\skipto ApplicationWindow
|
\skipto ApplicationWindow
|
||||||
\printuntil title
|
\printuntil title
|
||||||
|
|
||||||
Remove the rest of the boilerplate code in main.qml, except the Page1 type.
|
|
||||||
Specify bubble properties to position the image:
|
Specify bubble properties to position the image:
|
||||||
|
|
||||||
\printuntil bubbleCenter
|
\printuntil bubbleCenter
|
||||||
@@ -183,10 +176,10 @@
|
|||||||
Then add code to move the bubble based on Accelerometer sensor values:
|
Then add code to move the bubble based on Accelerometer sensor values:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
\li Add the following import statement to main.qml:
|
\li Add the following import statement to \e main.qml:
|
||||||
|
|
||||||
\code
|
\code
|
||||||
import QtSensors 5.7
|
import QtSensors 5.9
|
||||||
\endcode
|
\endcode
|
||||||
|
|
||||||
\li Add the \l{Accelerometer} type with the necessary properties:
|
\li Add the \l{Accelerometer} type with the necessary properties:
|
||||||
|
|||||||
@@ -26,13 +26,13 @@
|
|||||||
/*!
|
/*!
|
||||||
//! [qt quick application]
|
//! [qt quick application]
|
||||||
|
|
||||||
\section1 Creating Qt Quick Controls 2 Applications
|
\section1 Creating the Project
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||||
\uicontrol Application > \uicontrol {Qt Quick Controls 2 Application}
|
\uicontrol Application > \uicontrol {Qt Quick Application - Swipe} >
|
||||||
> \uicontrol Choose.
|
\uicontrol Choose.
|
||||||
|
|
||||||
\li In the \uicontrol Name field, enter a name for the application.
|
\li In the \uicontrol Name field, enter a name for the application.
|
||||||
|
|
||||||
@@ -66,10 +66,11 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\QC generates a UI file, \e Page1Form.ui.qml, that you can modify in the
|
\QC generates two UI files, \e Page1Form.ui.qml and \e Page2Form.ui.qml,
|
||||||
\QMLD \uicontrol {Form Editor} and two QML files, \e Page1.qml and
|
and a QML file, \e main.qml. You can modify \e Page1Form.ui.qml in the
|
||||||
\e main.qml, that you can modify in the \uicontrol {Text Editor} to add the
|
\uicontrol {Form Editor} to create the application main view and \e main.qml
|
||||||
application logic.
|
in the \uicontrol {Text Editor} to add the application logic. For the
|
||||||
|
purposes of this example, you can ignore \e Page2Form.ui.qml.
|
||||||
|
|
||||||
//! [qt quick application]
|
//! [qt quick application]
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -73,10 +73,10 @@
|
|||||||
|
|
||||||
\image qmldesigner-tutorial-design-mode.png "Transitions project in Design Mode"
|
\image qmldesigner-tutorial-design-mode.png "Transitions project in Design Mode"
|
||||||
|
|
||||||
\li In the \uicontrol Navigator, select \uicontrol RowLayout and press
|
\li In the \uicontrol Navigator, select \uicontrol Label and press
|
||||||
\key Delete to delete it.
|
\key Delete to delete it.
|
||||||
|
|
||||||
\li Select \uicontrol Item in the navigator, and enter \e page in the
|
\li Select \uicontrol Page in the navigator, and enter \e page in the
|
||||||
\uicontrol Id field.
|
\uicontrol Id field.
|
||||||
|
|
||||||
\li In \uicontrol Library > \uicontrol Resources, select qt-logo.png and
|
\li In \uicontrol Library > \uicontrol Resources, select qt-logo.png and
|
||||||
@@ -242,6 +242,7 @@
|
|||||||
expressions for the x and y properties, as illustrated by the
|
expressions for the x and y properties, as illustrated by the
|
||||||
following code snippet:
|
following code snippet:
|
||||||
|
|
||||||
|
\skipto StateGroup
|
||||||
\printuntil ]
|
\printuntil ]
|
||||||
|
|
||||||
\li Press \key {Ctrl+R} to run the application.
|
\li Press \key {Ctrl+R} to run the application.
|
||||||
|
|||||||
@@ -45,15 +45,25 @@
|
|||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
\li \uicontrol {Qt Quick Application} creates a Qt Quick 2 application
|
\li \uicontrol {Qt Quick Application - Empty} creates a Qt Quick 2
|
||||||
project that can contain both QML and C++ code. The project includes
|
application project that can contain both QML and C++ code. You can
|
||||||
a QQuickView. You can build the application and deploy it to desktop,
|
build the application and deploy it to desktop, embedded, and mobile
|
||||||
embedded, and mobile target platforms.
|
target platforms.
|
||||||
|
|
||||||
\li \uicontrol {Qt Quick Controls 2 Application} is like
|
\li \uicontrol {Qt Quick Application - Scroll} uses the
|
||||||
\uicontrol {Qt Quick Application}, but using
|
\l{http://doc.qt.io/qt-5/qml-qtquick-controls2-scrollview.html}
|
||||||
\l{http://doc.qt.io/qt-5/qtquickcontrols2-index.html}
|
{ScrollView} type to implement a scrollable list view
|
||||||
{Qt Quick Controls 2} (requires Qt 5.7 or later).
|
(requires Qt 5.9 or later).
|
||||||
|
|
||||||
|
\li \uicontrol {Qt Quick Application - Stack} uses the
|
||||||
|
\l{http://doc.qt.io/qt-5/qml-qtquick-controls2-stackview.html}
|
||||||
|
{StackView} type to implement a set of pages with a stack-based
|
||||||
|
navigation model (requires Qt 5.7 or later).
|
||||||
|
|
||||||
|
\li \uicontrol {Qt Quick Application - Swipe} uses the
|
||||||
|
\l{http://doc.qt.io/qt-5/qml-qtquick-controls2-swipeview.html}
|
||||||
|
{SwipeWiew} type to implement a set of pages with a swipe-based
|
||||||
|
navigation model (requires Qt 5.7 or later).
|
||||||
|
|
||||||
\li \uicontrol {Qt Canvas 3D Application} creates a Qt Quick application
|
\li \uicontrol {Qt Canvas 3D Application} creates a Qt Quick application
|
||||||
that imports the Qt Canvas 3D module and, optionally, includes
|
that imports the Qt Canvas 3D module and, optionally, includes
|
||||||
@@ -85,12 +95,12 @@
|
|||||||
\QC creates the necessary boilerplate files. Some of the files are
|
\QC creates the necessary boilerplate files. Some of the files are
|
||||||
specific to a particular target platform.
|
specific to a particular target platform.
|
||||||
|
|
||||||
\section1 Creating Qt Quick Applications
|
\section1 Creating Empty Qt Quick Applications
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||||
\uicontrol Application > \uicontrol {Qt Quick Application} >
|
\uicontrol Application > \uicontrol {Qt Quick Application - Empty} >
|
||||||
\uicontrol Choose.
|
\uicontrol Choose.
|
||||||
|
|
||||||
\li In the \uicontrol Name field, enter a name for the application.
|
\li In the \uicontrol Name field, enter a name for the application.
|
||||||
@@ -110,11 +120,9 @@
|
|||||||
The Qt version determines the Qt Quick imports that are used in the
|
The Qt version determines the Qt Quick imports that are used in the
|
||||||
QML files.
|
QML files.
|
||||||
|
|
||||||
\li Select the
|
\li Select the \uicontrol {Use Qt Virtual Keyboard} check box to add
|
||||||
\uicontrol {With .ui.qml file} check box to create an UI
|
support for \l{http://doc.qt.io/qt-5/qtvirtualkeyboard-index.html}
|
||||||
form that can contain a subset of the QML language. Similarly as
|
{Qt Virtual Keyboard} to the application.
|
||||||
with the UI forms for \QD, it is recommended that you use \QMLD to
|
|
||||||
edit the UI forms. For more information, see \l{Qt Quick UI Forms}.
|
|
||||||
|
|
||||||
\li Select \uicontrol Next.
|
\li Select \uicontrol Next.
|
||||||
|
|
||||||
@@ -130,13 +138,60 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\QC generates a UI file, \e Page1Form.ui.qml, that you can modify in the
|
\QC generates a QML file, \e main.qml, that you can modify in \QMLD.
|
||||||
\QMLD \uicontrol {Form Editor} and two QML files, \e Page1.qml and
|
|
||||||
\e main.qml, that you can modify in the \uicontrol {Text Editor} to add the
|
|
||||||
application logic. The \e .ui.qml file is created if you selected the
|
|
||||||
\uicontrol {With .ui.qml file} check box.
|
|
||||||
|
|
||||||
\include creator-tutorial-create-qq-project.qdocinc qt quick application
|
\section1 Creating Qt Quick Controls 2 Applications
|
||||||
|
|
||||||
|
\list 1
|
||||||
|
|
||||||
|
\li Select \uicontrol File > \uicontrol {New File or Project} >
|
||||||
|
\uicontrol Application > \uicontrol {Qt Quick Application - Scroll},
|
||||||
|
\uicontrol {Qt Quick Application - Stack}, or
|
||||||
|
\uicontrol {Qt Quick Application - Swipe} > \uicontrol Choose.
|
||||||
|
|
||||||
|
\li In the \uicontrol Name field, enter a name for the application.
|
||||||
|
|
||||||
|
\li In the \uicontrol {Create in} field, enter the path for the project
|
||||||
|
files, and then select \uicontrol Next (or \uicontrol Continue on
|
||||||
|
\macos).
|
||||||
|
|
||||||
|
\li In the \uicontrol {Build system} field, select the build system to
|
||||||
|
use for building and running the project: \l qmake,
|
||||||
|
\l {Setting Up CMake}{CMake}, or \l {Setting Up Qbs}{Qbs}.
|
||||||
|
|
||||||
|
\li In the \uicontrol {Qt Quick Controls 2 Style} field, select one of
|
||||||
|
the predefined \l{Styling Qt Quick Controls 2}{UI styles} to use,
|
||||||
|
and then select \uicontrol Next.
|
||||||
|
|
||||||
|
\li Select the \uicontrol {Use Qt Virtual Keyboard} check box to add
|
||||||
|
support for \l{http://doc.qt.io/qt-5/qtvirtualkeyboard-index.html}
|
||||||
|
{Qt Virtual Keyboard} to the application.
|
||||||
|
|
||||||
|
\li Select \l{glossary-buildandrun-kit}{kits} for the platforms that
|
||||||
|
you want to build the application for. To build applications for
|
||||||
|
mobile devices, select kits for Android ARM and iPhone OS, and
|
||||||
|
click \uicontrol{Next}.
|
||||||
|
|
||||||
|
\note Kits are listed if they have been specified in \uicontrol
|
||||||
|
Tools > \uicontrol Options > \uicontrol {Build & Run} >
|
||||||
|
\uicontrol Kits (on Windows and Linux) or in \uicontrol {Qt Creator}
|
||||||
|
> \uicontrol Preferences \uicontrol {Build & Run} > \uicontrol Kits
|
||||||
|
(on \macos).
|
||||||
|
|
||||||
|
\li Select \uicontrol Next.
|
||||||
|
|
||||||
|
\li Review the project settings, and click \uicontrol{Finish} (or
|
||||||
|
\uicontrol Done on \macos).
|
||||||
|
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
For the Scroll application, \QC creates a QML file, \e main.qml, that you
|
||||||
|
can modify in \QMLD.
|
||||||
|
|
||||||
|
For the Stack and Swipe applications, \QC generates two UI files,
|
||||||
|
\e Page1Form.ui.qml and \e Page2Form.ui.qml, that you can modify in the
|
||||||
|
\QMLD \uicontrol {Form Editor} and a QML file, \e main.qml, that you can
|
||||||
|
modify in the \uicontrol {Text Editor} to add the application logic.
|
||||||
|
|
||||||
\section1 Creating Qt Quick UI Projects
|
\section1 Creating Qt Quick UI Projects
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
** Copyright (C) 2017 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -120,8 +120,8 @@
|
|||||||
When you copy an item, all its child items are also copied. When
|
When you copy an item, all its child items are also copied. When
|
||||||
you remove an item, the child items are also removed.
|
you remove an item, the child items are also removed.
|
||||||
|
|
||||||
You can show and hide items to focus on specific parts of the application.
|
You can show and hide items on the canvas to focus on specific parts of the
|
||||||
Click the \inlineimage icon_color_none.png
|
application. Click the \inlineimage icon_color_none.png
|
||||||
(\uicontrol Transparent) button to change the visibility of an item on the
|
(\uicontrol Transparent) button to change the visibility of an item on the
|
||||||
canvas. To change the
|
canvas. To change the
|
||||||
visibility of an item in the application, select the \uicontrol Visibility
|
visibility of an item in the application, select the \uicontrol Visibility
|
||||||
@@ -134,6 +134,9 @@
|
|||||||
As all properties, visibility and opacity are inherited from the parent
|
As all properties, visibility and opacity are inherited from the parent
|
||||||
item. To hide or show child items, edit the properties of the parent item.
|
item. To hide or show child items, edit the properties of the parent item.
|
||||||
|
|
||||||
|
To hide invisible items in the navigator, click \inlineimage filtericon.png
|
||||||
|
(\uicontrol {Filter Tree}) and select \uicontrol {Show only visible items}.
|
||||||
|
|
||||||
To reset item size, position, or anchors, select context menu commands. To
|
To reset item size, position, or anchors, select context menu commands. To
|
||||||
change the source of an Image type, select \uicontrol {Change Source URL} in
|
change the source of an Image type, select \uicontrol {Change Source URL} in
|
||||||
the context menu.
|
the context menu.
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import QtQuick.Controls.Styles 1.0
|
|||||||
import "../common"
|
import "../common"
|
||||||
|
|
||||||
import QtQuick.Layouts 1.0
|
import QtQuick.Layouts 1.0
|
||||||
import "../propertyEditorQmlSources/HelperWidgets"
|
import HelperWidgets 2.0
|
||||||
|
|
||||||
import QtQuickDesignerTheme 1.0
|
import QtQuickDesignerTheme 1.0
|
||||||
|
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
|
|
||||||
import QtQuick 2.1
|
import QtQuick 2.1
|
||||||
import QtQuick.Controls 1.0 as Controls
|
import QtQuick.Controls 1.0 as Controls
|
||||||
import "../../common/"
|
import "../../../common/"
|
||||||
|
|
||||||
Controls.ScrollView {
|
Controls.ScrollView {
|
||||||
style: DesignerScrollViewStyle {
|
style: DesignerScrollViewStyle {
|
||||||
|
Before Width: | Height: | Size: 80 B After Width: | Height: | Size: 80 B |
|
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 112 B |
|
Before Width: | Height: | Size: 129 B After Width: | Height: | Size: 129 B |
|
Before Width: | Height: | Size: 398 B After Width: | Height: | Size: 398 B |
|
Before Width: | Height: | Size: 798 B After Width: | Height: | Size: 798 B |
|
Before Width: | Height: | Size: 157 B After Width: | Height: | Size: 157 B |
|
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 310 B |
|
Before Width: | Height: | Size: 135 B After Width: | Height: | Size: 135 B |
|
Before Width: | Height: | Size: 107 B After Width: | Height: | Size: 107 B |
|
Before Width: | Height: | Size: 167 B After Width: | Height: | Size: 167 B |
|
Before Width: | Height: | Size: 148 B After Width: | Height: | Size: 148 B |
|
Before Width: | Height: | Size: 218 B After Width: | Height: | Size: 218 B |
|
Before Width: | Height: | Size: 101 B After Width: | Height: | Size: 101 B |
|
Before Width: | Height: | Size: 121 B After Width: | Height: | Size: 121 B |
@@ -26,7 +26,7 @@
|
|||||||
import QtQuick 2.2
|
import QtQuick 2.2
|
||||||
import QtQuick.Controls 1.1
|
import QtQuick.Controls 1.1
|
||||||
import QtQuick.Controls.Styles 1.1
|
import QtQuick.Controls.Styles 1.1
|
||||||
import "../propertyEditorQmlSources/HelperWidgets"
|
import HelperWidgets 2.0
|
||||||
import QtQuickDesignerTheme 1.0
|
import QtQuickDesignerTheme 1.0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|||||||