diff --git a/doc/qtcreator/examples/transitions/Page1Form.ui.qml b/doc/qtcreator/examples/transitions/Page1Form.ui.qml deleted file mode 100644 index 5e478504244..00000000000 --- a/doc/qtcreator/examples/transitions/Page1Form.ui.qml +++ /dev/null @@ -1,138 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 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.12 -import QtQuick.Controls 2.5 - -Page { - id: page - width: 600 - height: 400 - property alias mouseArea2: mouseArea2 - property alias mouseArea1: mouseArea1 - property alias mouseArea: mouseArea - property alias icon: icon - property alias bottomLeftRect: bottomLeftRect - property alias middleRightRect: middleRightRect - property alias topLeftRect: topLeftRect - - header: Label { - text: qsTr("Page 1") - font.pixelSize: Qt.application.font.pixelSize * 2 - padding: 10 - } - - Image { - id: icon - x: 10 - y: 20 - source: "qt-logo.png" - fillMode: Image.PreserveAspectFit - } - - Rectangle { - id: topLeftRect - width: 55 - height: 41 - color: "#00000000" - border.color: "#808080" - anchors.left: parent.left - anchors.leftMargin: 10 - anchors.top: parent.top - anchors.topMargin: 20 - - MouseArea { - id: mouseArea - anchors.fill: parent - } - } - - Rectangle { - id: middleRightRect - width: 55 - height: 41 - color: "#00000000" - border.color: "#808080" - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: 10 - MouseArea { - id: mouseArea1 - anchors.fill: parent - } - } - - Rectangle { - id: bottomLeftRect - width: 55 - height: 41 - color: "#00000000" - border.color: "#808080" - anchors.bottom: parent.bottom - anchors.bottomMargin: 20 - anchors.left: parent.left - anchors.leftMargin: 10 - MouseArea { - id: mouseArea2 - anchors.fill: parent - } - } - - NumberAnimation { - id: numberAnimation - } -} - -/*##^## -Designer { - D{i:0;formeditorZoom:0.75}D{i:4;anchors_height:100;anchors_width:100}D{i:6;anchors_height:100;anchors_width:100} -D{i:8;anchors_height:100;anchors_width:100} -} -##^##*/ - diff --git a/doc/qtcreator/examples/transitions/Page2Form.ui.qml b/doc/qtcreator/examples/transitions/Page2Form.ui.qml deleted file mode 100644 index 57178073caf..00000000000 --- a/doc/qtcreator/examples/transitions/Page2Form.ui.qml +++ /dev/null @@ -1,67 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2020 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.12 -import QtQuick.Controls 2.5 - -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 - } -} diff --git a/doc/qtcreator/examples/transitions/main.cpp b/doc/qtcreator/examples/transitions/main.cpp index 9fb84582842..fa832817aa3 100644 --- a/doc/qtcreator/examples/transitions/main.cpp +++ b/doc/qtcreator/examples/transitions/main.cpp @@ -1,73 +1,19 @@ -/**************************************************************************** -** -** Copyright (C) 2020 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 #include int main(int argc, char *argv[]) { - if (qEnvironmentVariableIsEmpty("QTGLESSTREAM_DISPLAY")) { - qputenv("QT_QPA_EGLFS_PHYSICAL_WIDTH", QByteArray("213")); - qputenv("QT_QPA_EGLFS_PHYSICAL_HEIGHT", QByteArray("120")); - - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); - } + QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); QQmlApplicationEngine engine; const QUrl url(QStringLiteral("qrc:/main.qml")); QObject::connect(&engine, &QQmlApplicationEngine::objectCreated, - &app, [url](QObject *obj, const QUrl &objUrl) { - if (!obj && url == objUrl) - QCoreApplication::exit(-1); - }, Qt::QueuedConnection); + &app, [url](QObject *obj, const QUrl &objUrl) { + if (!obj && url == objUrl) + QCoreApplication::exit(-1); + }, Qt::QueuedConnection); engine.load(url); return app.exec(); diff --git a/doc/qtcreator/examples/transitions/main.qml b/doc/qtcreator/examples/transitions/main.qml index f49672d803f..1072e85ffeb 100644 --- a/doc/qtcreator/examples/transitions/main.qml +++ b/doc/qtcreator/examples/transitions/main.qml @@ -1,141 +1,214 @@ -/**************************************************************************** -** -** Copyright (C) 2020 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.12 -import QtQuick.Controls 2.5 +import QtQuick 2.14 -ApplicationWindow { - visible: true +Rectangle { + id: page width: 640 height: 480 - title: qsTr("Tabs") + visible: true + border.color: "#808080" + state: "State1" - SwipeView { - id: swipeView - anchors.fill: parent - currentIndex: tabBar.currentIndex + Image { + id: icon + x: 10 + y: 20 + source: "qt-logo.png" + fillMode: Image.PreserveAspectFit + } - Page1Form { - id: page - mouseArea { - onClicked: stateGroup.state = ' ' - } - mouseArea1 { - onClicked: stateGroup.state = 'State1' - } - mouseArea2 { - onClicked: stateGroup.state = 'State2' - } - } + Rectangle { + id: topLeftRect + width: 55 + height: 41 + color: "#00000000" + border.color: "#808080" + anchors.left: parent.left + anchors.top: parent.top + anchors.leftMargin: 10 + anchors.topMargin: 20 - Page2Form { + MouseArea { + id: mouseArea + anchors.fill: parent + + Connections { + target: mouseArea + onClicked: page.state = "State1" + } } } - StateGroup { - id: stateGroup - states: [ - State { - name: "State1" + Rectangle { + id: middleRightRect + width: 55 + height: 41 + color: "#00000000" + border.color: "#808080" + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: 10 + MouseArea { + id: mouseArea1 + anchors.fill: parent - PropertyChanges { - target: page.icon - x: page.middleRightRect.x - y: page.middleRightRect.y + Connections { + target: mouseArea1 + onClicked: page.state = "State2" + } + } + } + + Rectangle { + id: bottomLeftRect + width: 55 + height: 41 + color: "#00000000" + border.color: "#808080" + anchors.left: parent.left + anchors.bottom: parent.bottom + anchors.bottomMargin: 20 + MouseArea { + id: mouseArea2 + anchors.fill: parent + + Connections { + target: mouseArea2 + onClicked: page.state = "State3" + } + } + anchors.leftMargin: 10 + } + states: [ + State { + name: "State1" + + PropertyChanges { + target: icon + x: 10 + y: 20 + } + }, + State { + name: "State2" + + PropertyChanges { + target: icon + x: 575 + y: 219 + } + }, + State { + name: "State3" + PropertyChanges { + target: icon + x: 10 + y: 419 + } + } + ] + transitions: [ + Transition { + id: toState1 + ParallelAnimation { + SequentialAnimation { + PauseAnimation { + duration: 50 + } + + PropertyAnimation { + target: icon + property: "x" + easing.bezierCurve: [0.2,0.2,0.8,0.8,1,1] + duration: 152 + } } - }, - State { - name: "State2" - PropertyChanges { - target: page.icon - x: page.bottomLeftRect.x - y: page.bottomLeftRect.y + SequentialAnimation { + PauseAnimation { + duration: 52 + } + + PropertyAnimation { + target: icon + property: "y" + easing.bezierCurve: [0.2,0.2,0.8,0.8,1,1] + duration: 152 + } } } - ] + to: "State1" + from: "State2,State3" + }, + Transition { + id: toState2 + ParallelAnimation { + SequentialAnimation { + PauseAnimation { + duration: 50 + } - transitions: [ - Transition { - from: "*"; to: "State1" - NumberAnimation { - easing.type: Easing.OutBounce - properties: "x,y"; - duration: 1000 + PropertyAnimation { + target: icon + property: "x" + easing.bezierCurve: [0.233,0.161,0.264,0.997,0.393,0.997,0.522,0.997,0.555,0.752,0.61,0.75,0.664,0.748,0.736,1,0.775,1,0.814,0.999,0.861,0.901,0.888,0.901,0.916,0.901,0.923,0.995,1,1] + duration: 951 + } } - }, - Transition { - from: "*"; to: "State2" - NumberAnimation { - properties: "x,y"; - easing.type: Easing.InOutQuad; + + SequentialAnimation { + PauseAnimation { + duration: 50 + } + + PropertyAnimation { + target: icon + property: "y" + easing.bezierCurve: [0.233,0.161,0.264,0.997,0.393,0.997,0.522,0.997,0.555,0.752,0.61,0.75,0.664,0.748,0.736,1,0.775,1,0.814,0.999,0.861,0.901,0.888,0.901,0.916,0.901,0.923,0.995,1,1] + duration: 951 + } + } + } + to: "State2" + from: "State1,State3" + }, + Transition { + id: toState3 + ParallelAnimation { + SequentialAnimation { + PauseAnimation { + duration: 0 + } + + PropertyAnimation { + target: icon + property: "x" + easing.bezierCurve: [0.25,0.46,0.45,0.94,1,1] duration: 2000 + } + } + + SequentialAnimation { + PauseAnimation { + duration: 0 + } + + PropertyAnimation { + target: icon + property: "y" + easing.bezierCurve: [0.25,0.46,0.45,0.94,1,1] + duration: 2000 + } } - }, - Transition { - NumberAnimation { - properties: "x,y"; - duration: 200 - } } - ] - } - - footer: TabBar { - id: tabBar - currentIndex: swipeView.currentIndex - - TabButton { - text: qsTr("Page 1") + to: "State3" + from: "State1,State2" } - TabButton { - text: qsTr("Page 2") - } - } + ] } + +/*##^## +Designer { + D{i:0;formeditorZoom:0.6600000262260437}D{i:17;transitionDuration:2000}D{i:25;transitionDuration:2000} +D{i:33;transitionDuration:2000} +} +##^##*/ diff --git a/doc/qtcreator/examples/transitions/qml.qrc b/doc/qtcreator/examples/transitions/qml.qrc index 299ee42d859..1cca02ca098 100644 --- a/doc/qtcreator/examples/transitions/qml.qrc +++ b/doc/qtcreator/examples/transitions/qml.qrc @@ -1,10 +1,6 @@ main.qml - Page1Form.ui.qml - Page2Form.ui.qml - main.qml - qtquickcontrols2.conf qt-logo.png diff --git a/doc/qtcreator/examples/transitions/qtquickcontrols2.conf b/doc/qtcreator/examples/transitions/qtquickcontrols2.conf deleted file mode 100644 index 75b2cb8fffb..00000000000 --- a/doc/qtcreator/examples/transitions/qtquickcontrols2.conf +++ /dev/null @@ -1,6 +0,0 @@ -; This file can be edited to change the style of the application -; Read "Qt Quick Controls 2 Configuration File" for details: -; http://doc.qt.io/qt-5/qtquickcontrols2-configuration.html - -[Controls] -Style=Default diff --git a/doc/qtcreator/examples/transitions/transitions.pro b/doc/qtcreator/examples/transitions/transitions.pro index 70f8fe7f3b6..34ba75e4077 100644 --- a/doc/qtcreator/examples/transitions/transitions.pro +++ b/doc/qtcreator/examples/transitions/transitions.pro @@ -2,15 +2,8 @@ QT += quick CONFIG += c++11 -# The following define makes your compiler emit warnings if you use -# any Qt feature that has been marked deprecated (the exact warnings -# depend on your compiler). Refer to the documentation for the -# deprecated API to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS - -# You can also make your code fail to compile if it uses deprecated APIs. +# You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. -# 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 SOURCES += \ @@ -28,5 +21,3 @@ QML_DESIGNER_IMPORT_PATH = qnx: target.path = /tmp/$${TARGET}/bin else: unix:!android: target.path = /opt/$${TARGET}/bin !isEmpty(target.path): INSTALLS += target - -DISTFILES += diff --git a/doc/qtcreator/images/qmldesigner-tutorial-connections.png b/doc/qtcreator/images/qmldesigner-tutorial-connections.png new file mode 100644 index 00000000000..7a2eab87362 Binary files /dev/null and b/doc/qtcreator/images/qmldesigner-tutorial-connections.png differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial-design-mode.png b/doc/qtcreator/images/qmldesigner-tutorial-design-mode.png deleted file mode 100644 index 4ee7dd0880e..00000000000 Binary files a/doc/qtcreator/images/qmldesigner-tutorial-design-mode.png and /dev/null differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial-easing-curves.png b/doc/qtcreator/images/qmldesigner-tutorial-easing-curves.png new file mode 100644 index 00000000000..96cf5687c59 Binary files /dev/null and b/doc/qtcreator/images/qmldesigner-tutorial-easing-curves.png differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial-quick-toolbar.png b/doc/qtcreator/images/qmldesigner-tutorial-quick-toolbar.png deleted file mode 100644 index 37b973f3a9e..00000000000 Binary files a/doc/qtcreator/images/qmldesigner-tutorial-quick-toolbar.png and /dev/null differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial-states.png b/doc/qtcreator/images/qmldesigner-tutorial-states.png new file mode 100644 index 00000000000..decec3cb77f Binary files /dev/null and b/doc/qtcreator/images/qmldesigner-tutorial-states.png differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial-topleftrect-layout.png b/doc/qtcreator/images/qmldesigner-tutorial-topleftrect-layout.png index 95124cb58dd..59f7fa0d7f1 100644 Binary files a/doc/qtcreator/images/qmldesigner-tutorial-topleftrect-layout.png and b/doc/qtcreator/images/qmldesigner-tutorial-topleftrect-layout.png differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial-topleftrect.png b/doc/qtcreator/images/qmldesigner-tutorial-topleftrect.png index 8b9da56106c..31e36f7f561 100644 Binary files a/doc/qtcreator/images/qmldesigner-tutorial-topleftrect.png and b/doc/qtcreator/images/qmldesigner-tutorial-topleftrect.png differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial-transition-settings.png b/doc/qtcreator/images/qmldesigner-tutorial-transition-settings.png new file mode 100644 index 00000000000..8bae83bd047 Binary files /dev/null and b/doc/qtcreator/images/qmldesigner-tutorial-transition-settings.png differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial-transitions.png b/doc/qtcreator/images/qmldesigner-tutorial-transitions.png new file mode 100644 index 00000000000..548f7ab2d32 Binary files /dev/null and b/doc/qtcreator/images/qmldesigner-tutorial-transitions.png differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial-ui-ready.png b/doc/qtcreator/images/qmldesigner-tutorial-ui-ready.png index ad1abb2ce42..e8a6102abe2 100644 Binary files a/doc/qtcreator/images/qmldesigner-tutorial-ui-ready.png and b/doc/qtcreator/images/qmldesigner-tutorial-ui-ready.png differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial-user-icon.png b/doc/qtcreator/images/qmldesigner-tutorial-user-icon.png index d8f6efea1c6..a50a258bc9f 100644 Binary files a/doc/qtcreator/images/qmldesigner-tutorial-user-icon.png and b/doc/qtcreator/images/qmldesigner-tutorial-user-icon.png differ diff --git a/doc/qtcreator/images/qmldesigner-tutorial.png b/doc/qtcreator/images/qmldesigner-tutorial.png index b04131330d3..1885b4af5b4 100644 Binary files a/doc/qtcreator/images/qmldesigner-tutorial.png and b/doc/qtcreator/images/qmldesigner-tutorial.png differ diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc index 511a0c61c3c..8faa7f8b325 100644 --- a/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-app-tutorial.qdoc @@ -23,12 +23,6 @@ ** ****************************************************************************/ -// ********************************************************************** -// NOTE: the sections are not ordered by their logical order to avoid -// reshuffling the file each time the index order changes (i.e., often). -// Run the fixnavi.pl script to adjust the links to the index order. -// ********************************************************************** - /*! \previouspage creator-tutorials.html \example transitions @@ -40,7 +34,6 @@ \l{Qt Quick}. For more information about the UI choices you have, see \l{User Interfaces}. - This tutorial describes how to use \QC to implement Qt Quick states and transitions. We create an application that displays a Qt logo that moves between three rectangles on the page when you click them. @@ -52,39 +45,45 @@ For examples of using Qt Quick Controls, see \l{Qt Quick Controls Examples}. - \include creator-tutorial-create-qq-project.qdocinc qt quick application + \include qtquick-tutorial-create-empty-project.qdocinc qtquick empty application + + \QC generates a QML file, \e main.qml, and opens it in + \uicontrol {Text Editor}. The wizard template uses the \l Window type, + which does not support adding states. Because we want to use states in + this example, we first replace the Window type with a \l Rectangle type. + We must also remove the line that sets the \c title property, which the + Rectangle type does not have. If you change the value of the + \uicontrol Type property in the \uicontrol Properties view, \QC offers + to automatically remove the \c title property. \section1 Creating the Main View - The main view of the application displays a Qt logo in the top left corner - of the view and two empty rectangles. + The main view of the application displays a Qt logo inside a rectangle in + the top left corner of the view and two empty rectangles. - To use the \e qt-logo.png image in your application, you must copy it from - the Qt examples directory to the project directory (same subdirectory as - the QML file). The image appears in \uicontrol Assets. You can also use + We use the \e qt-logo.png image in this tutorial, but you can also use any other image or a QML type, instead. + \note If a view is hidden, you can show it by selecting \uicontrol View > + \uicontrol Views. + \list 1 - \li In the \uicontrol Projects view, double-click the \e Page1Form.ui.qml - file to open it in the Design mode. + \li Select \uicontrol Rectangle in \uicontrol Navigator, and enter + \e page in the \uicontrol Id field in the \uicontrol Properties + view. - \image qmldesigner-tutorial-design-mode.png "Transitions project in Design Mode" + \li Select \uicontrol Library > \uicontrol Assets > + \uicontrol {Add New Assets} to locate qt-logo.png (or your own + image) and add it to the project folder. - \note If a view is hidden, you can show it by selecting - \uicontrol View > \uicontrol Views. - - \li In the \uicontrol Navigator, select \uicontrol Label and press - \key Delete to delete it. - - \li Select \uicontrol Page in \uicontrol Navigator, and enter \e page in - the \uicontrol Id field in the \uicontrol Properties view. - - \li In \uicontrol Library > \uicontrol Assets, select qt-logo.png and - drag and drop it to the \e page in \uicontrol Navigator. + \li Drag and drop the image from \uicontrol Assets to \e page in + \uicontrol Navigator. \image qmldesigner-tutorial-user-icon.png "Image properties" + \li In \uicontrol Properties, edit image properties: + \list a \li In the \uicontrol Id field, enter \e icon. @@ -94,17 +93,14 @@ \endlist - \li In the \uicontrol Projects view, right-click the resource file, - qml.qrc, and select \uicontrol {Add Existing File} to add - qt-logo.png to the resource file for deployment. - \li In \uicontrol Library > \uicontrol {QML Types} > - \uicontrol {Qt Quick - Basic}, select \uicontrol Rectangle, - drag and drop it to \e page in \uicontrol Navigator, and - edit its properties in the \uicontrol Properties view. + \uicontrol {Qt Quick - Basic}, select \uicontrol Rectangle and + drag and drop it to \e page in \uicontrol Navigator. \image qmldesigner-tutorial-topleftrect.png "Rectangle properties" + \li In \uicontrol Properties, edit rectangle properties: + \list a \li In the \uicontrol Id field, enter \e topLeftRect. @@ -118,8 +114,9 @@ (\uicontrol Transparent) button to make the rectangle transparent. - \li In the \uicontrol {Border color} field, set the border color to - \e #808080. + \li In the \uicontrol {Border color} field, set the border + color to \e #808080 to make the rectangle visible on + the white background. \li Click \uicontrol {Layout}, and then click the \inlineimage anchor-top.png @@ -182,130 +179,133 @@ \endlist - \li In the \uicontrol Navigator, select the - \inlineimage export_unchecked.png - (\uicontrol Export) button for each type to export all types as - properties. This enables you to use the properties in the - \e main.qml file. - \li Press \key {Ctrl+S} to save the changes. \endlist - To check your code, you can view your \e {Page1Form.ui.qml} file in the - \uicontrol {Text Editor} and compare it with the \e {Page1Form.ui.qml} + To check your code, you can view your \e {main.qml} file in the + \uicontrol {Text Editor} and compare it with the \e {main.qml} example file. - The new project wizard adds boilerplate code to the \e Page1.qml file to - create menu items and push buttons. Modify the boilerplate code by removing - obsolete code. You removed the push buttons from the - UI form, so you also need to remove the corresponding code from - \e Page1.qml (or the application cannot be built). - - The UI is now ready and you can switch to editing the \e main.qml file in - the \uicontrol {Text Editor} to add animation to the application, as described - in the following section. + The UI design is now ready. \image qmldesigner-tutorial-ui-ready.png "Transitions UI" - \section1 Adding Application Logic + For more information about the views you used, see: - Edit the \e main.qml file to add pointers to two additional states: \e State1 - and \e State2. You cannot use the \uicontrol {Form Editor} to add states for - a Window QML type. Use the \uicontrol {Text Editor} to add the states inside - a StateGroup QML type and refer to them by using the id of the state group. + \list + \li \l{Creating Components} + \li \l{Managing Item Hierarchy} + \li \l{Specifying Item Properties} + \endlist + + Next, we will make the image move between the rectangles when users click + them by adding states and by connecting mouse clicks to state changes. + + \section1 Connecting Mouse Clicks to State Changes + + To make the image move between the rectangles when users click them, we add + states, where we change the values of the \c x and \c y properties of + \e icon to match those of the middle right and top left rectangles. Then, + we connect the \c onClicked signals of the mouse areas to the state changes. + + To make sure that the image is displayed within the rectangle when the view + is scaled on different sizes of screens, we bind the values of the \c x and + \c y properties of \e icon to those of the rectangles. \list 1 - - \li Specify an id for the Page1 type to be able to use the properties - that you exported in \e Page1Form.ui.qml: - - \quotefromfile transitions/main.qml - \skipto ApplicationWindow - \printuntil page - - \li Add a pointer to the clicked expressions in \uicontrol mouseArea: - - \printuntil } - - The expression sets the state to the base state and returns the - image to its initial position. - - \li Add a pointer to a clicked expression to \uicontrol mouseArea1 - to set the state to \e State1: - - \printuntil } - - \li Add a pointer to a clicked expression to \uicontrol mouseArea2 to - set the state to \e State2: - - \printuntil } - \printuntil } - - \li Bind the position of the Qt logo to the - rectangle to make sure that the logo is displayed within the - rectangle when the view is scaled on different sizes of screens. Set - expressions for the x and y properties, as illustrated by the - following code snippet: - - \skipto StateGroup - \printuntil ] - + \li In the \uicontrol States view, click the \inlineimage plus.png + button three times to create \e State1, \e State2, and \e State3. + \li Select \e State1 in \uicontrol States. + \li Select \inlineimage icons/action-icon.png + to open the \uicontrol Actions menu, and then select + \uicontrol {Set as Default} to display \e State1 when + the application starts. + \li Select \e State2 in \uicontrol States. + \li Select \e icon in \uicontrol Navigator and drag it on top of the + middle left rectangle in \uicontrol {Form Editor}. This changes the + \c x and \c y property values of \e icon to match those of + \e middleRightRect in \e State2. + \image qmldesigner-tutorial-states.png "States view" + \li Select \e State3 in \uicontrol States, and drag \e icon on top of + the bottom left rectangle in \uicontrol {Form Editor}. + \li In the \uicontrol Connections view, click the \inlineimage plus.png + button to create a new connection. + \image qmldesigner-tutorial-connections.png "Connections tab" + \li Double-click the value in the \uicontrol Target column, and select + \e mouseArea in the list. + \li In the \uicontrol {Signal Handler} column, select \e onClicked. + \li In the \uicontrol Action column, select \e {page.state = 'State1'}. + \li Create two more connections to connect the \c onClicked signal of + \uicontrol mouseArea1 to State2, and that of \uicontrol mouseArea2 + to State3. \li Press \key {Ctrl+R} to run the application. - \endlist Click the rectangles to move the Qt logo from one rectangle to another. - \section1 Adding Animation to the View + For more information about the views you used, see: - Add transitions inside the state group to define how the properties change - when the Qt logo moves - between states. The transitions apply animations to the Qt logo. For example, - the Qt logo bounces back when it moves to the middleRightRect and eases into - bottomLeftRect. + \list + \li \l{Adding States} + \li \l{Connecting Objects to Signals} + \endlist + + \section1 Animating Transitions + + We will now create transitions to apply animation to the image. For example, + the image bounces back when it moves to \e middleRightRect and eases into + \e bottomLeftRect. \list 1 - - \li In the \uicontrol {Text Editor}, add the following code to specify - that when moving to State1, the x and y coordinates of the Qt logo - change linearly over a duration of 1 second: - - \printuntil }, - - \li You can use the Qt Quick toolbar for animation to change the easing - curve type from linear to OutBounce: - - \list a - - \li Click \uicontrol NumberAnimation in the \uicontrol {Text Editor} - to display the \inlineimage refactormarker.png - icon, and then click the icon to open the toolbar: - - \image qmldesigner-tutorial-quick-toolbar.png "Qt Quick toolbar for animation" - - \li In the \uicontrol Easing field, select \uicontrol Bounce. - - \li In the \uicontrol Subtype field, select \uicontrol Out. - - \endlist - - \li Add the following code to specify that when moving to State2, the x - and y coordinates of the Qt logo change over a duration of 2 - seconds, and an InOutQuad easing function is used: - - \dots - \printuntil }, - - \li Add the following code to specify that for any other state changes, - the x and y coordinates of the Qt logo change linearly over a - duration of 200 milliseconds: - - \dots - \printuntil ] - + \li In the \uicontrol {Transition Editor} view, click the + \inlineimage plus.png + button to create a new transition. + \li Click the \inlineimage animation.png + button to specify transitions for switching to each state. + \image qmldesigner-tutorial-transition-settings.png "Transition Settings dialog" + \li In the \uicontrol {Transition ID} field, enter \e toState1. + \li In the \uicontrol From field, select \e State2 and \e State3. + \li In the \uicontrol To field, select \e State1. + \li Click \inlineimage plus.png + to add transitions for switching to \e State2 and \e State3, with + the IDs \e toState2 and \e toState3. + \li Select \uicontrol Close to save the settings and return to + \uicontrol {Transition Editor}. + \li Select \e toState2 in the list of transitions. + \image qmldesigner-tutorial-transitions.png "Transition Editor view" + \li Pull the right edge of the blue bar next to \e icon to frame 1000 + to specify that the x and y coordinates of the image change + linearly over a duration of 1 second. + \li Select the \uicontrol x property, and click + \inlineimage curve_editor.png + to change the easing curve type from linear to easeOutBounce + (\c{[0.233,0.161,0.264,0.997,0.393,0.997,0.522,0.997,0.555,0.752, + 0.61,0.75,0.664,0.748,0.736,1,0.775,1,0.814,0.999,0.861,0.901,0.888, + 0.901,0.916,0.901,0.923,0.995,1,1]}) + in \uicontrol {Easing Curve Editor}. + \image qmldesigner-tutorial-easing-curves.png "Easing Curve Editor" + \li Select the \uicontrol y property and set the easing curve for it, + too. + \li Close \uicontrol {Easing Curve Editor} to return to + \uicontrol {Transition Editor}, and select \e toState3 + in the list of transitions. + \li Pull the right edge of the blue bar next to \e icon to frame 2000 + to specify that the x and y coordinates of the image change + linearly over a duration of 2 seconds. + \li In \uicontrol {Easing Curve Editor}, change the easing curve type + from linear to easeInOutQuad (\c{[0.455,0.03,0.515,0.955,1,1]}). + \li Select \e toState1 in the list of transitions, and pull the blue + bar to frame 200 to specify that the x and y coordinates of the + image change linearly over a duration of 200 milliseconds. \li Press \key {Ctrl+R} to run the application. + \endlist + For more information about the views you used, see: + + \list + \li \l{Editing Easing Curves} + \li \l{Animating Transitions Between States} \endlist Click the rectangles to view the animated transitions. diff --git a/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc b/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc new file mode 100644 index 00000000000..fdc1ef2b69c --- /dev/null +++ b/doc/qtcreator/src/qtquick/creator-only/qtquick-tutorial-create-empty-project.qdocinc @@ -0,0 +1,84 @@ +/**************************************************************************** +** +** Copyright (C) 2020 The Qt Company Ltd. +** Contact: https://www.qt.io/licensing/ +** +** This file is part of the Qt Creator documentation. +** +** 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. +** +** GNU Free Documentation License Usage +** Alternatively, this file may be used under the terms of the GNU Free +** Documentation License version 1.3 as published by the Free Software +** Foundation and appearing in the file included in the packaging of +** this file. Please review the following information to ensure +** the GNU Free Documentation License version 1.3 requirements +** will be met: https://www.gnu.org/licenses/fdl-1.3.html. +** +****************************************************************************/ + +/*! +//! [qtquick empty application] + + \section1 Creating the Project + + \list 1 + + \li Select \uicontrol File > \uicontrol {New File or Project} > + \uicontrol {Application (Qt Quick)} > + \uicontrol {Qt Quick Application - Empty}. + + \li Select \uicontrol Choose to open the + \uicontrol {Project Location} dialog. + + \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. + + \li Select \uicontrol Next (or \uicontrol Continue on \macos) to open + the \uicontrol {Define Build System} dialog. + + \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 Select \uicontrol Next to open the + \uicontrol {Define Project Details} dialog. + + \li Select \uicontrol Next to use the default settings and to open + the \uicontrol {Translation File} dialog. + + \li Select \uicontrol Next to use the default settings and to open + the \uicontrol {Kit Selection} dialog. + + \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. + + \note Kits are listed if they have been specified in \uicontrol + Tools > \uicontrol Options > \uicontrol Kits (on Windows and Linux) + or in \uicontrol {\QC} > \uicontrol Preferences > + \uicontrol Kits (on \macos). + For more information, see \l {Adding Kits}. + + \li Select \uicontrol Next to open the \uicontrol {Project Management} + dialog. + + \li Review the project settings, and select \uicontrol{Finish} + (or \uicontrol Done on \macos) to create the project. + + \endlist + + For more information about the settings that you skipped, see + \l{Creating Qt Quick Applications}. + +//! [qtquick empty application] +*/ +Con diff --git a/doc/qtcreator/src/qtquick/qtquick-components.qdoc b/doc/qtcreator/src/qtquick/qtquick-components.qdoc index cdd21da1074..24b81e80dd7 100644 --- a/doc/qtcreator/src/qtquick/qtquick-components.qdoc +++ b/doc/qtcreator/src/qtquick/qtquick-components.qdoc @@ -66,8 +66,8 @@ the import statements automatically. You can remove import statements in \uicontrol {QML Imports}. - \uicontrol {Assets} displays the images and other files that you copy - to the project folder (to the same subfolder as the QML files). + \uicontrol {Assets} displays the images and other files that you import to + the project folder by selecting \uicontrol {Add New Assets}. \section1 Adding Components to Designs diff --git a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-effects.qdoc b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-effects.qdoc index be366ea8ff0..2601d1604ab 100644 --- a/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-effects.qdoc +++ b/doc/qtdesignstudio/src/qtquick3d-editor/qtdesignstudio-3d-effects.qdoc @@ -232,7 +232,7 @@ \row \li HDR Bloom Tonemap - \li \image effect-HDR-bloom-tonemap.png "The HDR Bloom Tonemap effect" + \li \image effect-hdr-bloom-tonemap.png "The HDR Bloom Tonemap effect" \li A bloom with tonemapping effect that adjusts the gamma and exposure of the high-dynamic range rendered content to achieve the image quality you want. Also applies an adjustable bloom effect to very bright areas diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp index 24dad650903..1f23d39d7d0 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp +++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.cpp @@ -96,6 +96,8 @@ NodeInstanceClientProxy::NodeInstanceClientProxy(QObject *parent) m_puppetAliveTimer.start(); } +NodeInstanceClientProxy::~NodeInstanceClientProxy() = default; + void NodeInstanceClientProxy::initializeSocket() { QLocalSocket *localSocket = new QLocalSocket(this); diff --git a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h index fd681b69902..2131109e463 100644 --- a/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h +++ b/share/qtcreator/qml/qmlpuppet/instances/nodeinstanceclientproxy.h @@ -70,6 +70,7 @@ class NodeInstanceClientProxy : public QObject, public NodeInstanceClientInterfa public: NodeInstanceClientProxy(QObject *parent); + ~NodeInstanceClientProxy() override; void informationChanged(const InformationChangedCommand &command) override; void valuesChanged(const ValuesChangedCommand &command) override; diff --git a/src/libs/extensionsystem/optionsparser.cpp b/src/libs/extensionsystem/optionsparser.cpp index ecac59e5bf1..29e790c8d7c 100644 --- a/src/libs/extensionsystem/optionsparser.cpp +++ b/src/libs/extensionsystem/optionsparser.cpp @@ -42,6 +42,7 @@ const char *OptionsParser::LOAD_OPTION = "-load"; const char *OptionsParser::TEST_OPTION = "-test"; const char *OptionsParser::NOTEST_OPTION = "-notest"; const char *OptionsParser::PROFILE_OPTION = "-profile"; +const char *OptionsParser::NO_CRASHCHECK_OPTION = "-no-crashcheck"; OptionsParser::OptionsParser(const QStringList &args, const QMap &appOptions, @@ -79,6 +80,8 @@ bool OptionsParser::parse() continue; if (checkForProfilingOption()) continue; + if (checkForNoCrashcheckOption()) + continue; #ifdef WITH_TESTS if (checkForTestOptions()) continue; @@ -243,6 +246,14 @@ bool OptionsParser::checkForProfilingOption() return true; } +bool OptionsParser::checkForNoCrashcheckOption() +{ + if (m_currentArg != QLatin1String(NO_CRASHCHECK_OPTION)) + return false; + m_pmPrivate->enableCrashCheck = false; + return true; +} + bool OptionsParser::checkForPluginOption() { bool requiresParameter; diff --git a/src/libs/extensionsystem/optionsparser.h b/src/libs/extensionsystem/optionsparser.h index a33486e9513..80706aecea5 100644 --- a/src/libs/extensionsystem/optionsparser.h +++ b/src/libs/extensionsystem/optionsparser.h @@ -49,6 +49,8 @@ public: static const char *TEST_OPTION; static const char *NOTEST_OPTION; static const char *PROFILE_OPTION; + static const char *NO_CRASHCHECK_OPTION; + private: // return value indicates if the option was processed // it doesn't indicate success (--> m_hasError) @@ -59,6 +61,7 @@ private: bool checkForAppOption(); bool checkForPluginOption(); bool checkForProfilingOption(); + bool checkForNoCrashcheckOption(); bool checkForUnknownOption(); void forceDisableAllPluginsExceptTestedAndForceEnabled(); diff --git a/src/libs/extensionsystem/pluginmanager.cpp b/src/libs/extensionsystem/pluginmanager.cpp index 2f804004a54..8edbc57c0f3 100644 --- a/src/libs/extensionsystem/pluginmanager.cpp +++ b/src/libs/extensionsystem/pluginmanager.cpp @@ -64,6 +64,7 @@ #endif #include +#include Q_LOGGING_CATEGORY(pluginLog, "qtc.extensionsystem", QtWarningMsg) @@ -729,6 +730,12 @@ void PluginManager::formatOptions(QTextStream &str, int optionIndentation, int d formatOption(str, QLatin1String(OptionsParser::PROFILE_OPTION), QString(), QLatin1String("Profile plugin loading"), optionIndentation, descriptionIndentation); + formatOption(str, + QLatin1String(OptionsParser::NO_CRASHCHECK_OPTION), + QString(), + QLatin1String("Disable startup check for previously crashed instance"), + optionIndentation, + descriptionIndentation); #ifdef WITH_TESTS formatOption(str, QString::fromLatin1(OptionsParser::TEST_OPTION) + QLatin1String(" [,testfunction[:testdata]]..."), QString(), @@ -1409,6 +1416,8 @@ private: void PluginManagerPrivate::checkForProblematicPlugins() { + if (!enableCrashCheck) + return; const Utils::optional pluginName = LockFile::lockedPluginName(this); if (pluginName) { PluginSpec *spec = pluginByName(*pluginName); @@ -1464,7 +1473,9 @@ void PluginManagerPrivate::loadPlugin(PluginSpec *spec, PluginSpec::State destSt if (!spec->isEffectivelyEnabled() && destState == PluginSpec::Loaded) return; - LockFile f(this, spec); + std::unique_ptr lockFile; + if (enableCrashCheck) + lockFile.reset(new LockFile(this, spec)); switch (destState) { case PluginSpec::Running: diff --git a/src/libs/extensionsystem/pluginmanager_p.h b/src/libs/extensionsystem/pluginmanager_p.h index bafddf9d446..6f5dbe50e30 100644 --- a/src/libs/extensionsystem/pluginmanager_p.h +++ b/src/libs/extensionsystem/pluginmanager_p.h @@ -138,6 +138,7 @@ public: mutable QReadWriteLock m_lock; bool m_isInitializationDone = false; + bool enableCrashCheck = true; private: PluginManager *q; diff --git a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp index a677e7fbd83..6a64af1fc54 100644 --- a/src/libs/qmljs/qmljsfindexportedcpptypes.cpp +++ b/src/libs/qmljs/qmljsfindexportedcpptypes.cpp @@ -198,12 +198,15 @@ protected: } else { return false; } + + int argCount = 0; + for (const ExpressionListAST *list = ast->expression_list; list && list->value; + list = list->next) { + ++argCount; + } + // must have at least four arguments - if (!ast->expression_list - || !ast->expression_list->value || !ast->expression_list->next - || !ast->expression_list->next->value || !ast->expression_list->next->next - || !ast->expression_list->next->next->value || !ast->expression_list->next->next->next - || !ast->expression_list->next->next->next->value) + if (argCount < 4) return false; switch (registrationFunction) { case InvalidRegistrationFunction: @@ -215,15 +218,11 @@ protected: case QmlRegisterSingletonTypeCallback2: case QmlRegisterSingletonTypeUrl: case QmlRegisterUncreatableType: - if (!ast->expression_list->next->next->next->next - || !ast->expression_list->next->next->next->next->value - || ast->expression_list->next->next->next->next->next) + if (argCount != 5) return false; break; case QmlRegisterUncreatableMetaObject: - if (!ast->expression_list->next->next->next->next->next - || !ast->expression_list->next->next->next->next->next->value - || ast->expression_list->next->next->next->next->next->next) + if (argCount != 6) return false; } ExpressionAST *uriExp = nullptr; diff --git a/src/plugins/qmldesigner/designercore/instances/capturingconnectionmanager.cpp b/src/plugins/qmldesigner/designercore/instances/capturingconnectionmanager.cpp index 4be52a327c7..589e9b121d1 100644 --- a/src/plugins/qmldesigner/designercore/instances/capturingconnectionmanager.cpp +++ b/src/plugins/qmldesigner/designercore/instances/capturingconnectionmanager.cpp @@ -42,10 +42,13 @@ void CapturingConnectionManager::setUp(NodeInstanceServerProxy *nodeInstanceServ int indexOfCapturePuppetStream = QCoreApplication::arguments().indexOf( "-capture-puppet-stream"); if (indexOfCapturePuppetStream > 0) { - m_captureFileForTest.setFileName( - QCoreApplication::arguments().at(indexOfCapturePuppetStream + 1)); + const QString filePath = QCoreApplication::arguments().at(indexOfCapturePuppetStream + 1); + m_captureFileForTest.setFileName(filePath); bool isOpen = m_captureFileForTest.open(QIODevice::WriteOnly); - qDebug() << "file is open: " << isOpen; + if (isOpen) + qDebug() << "capture file is open:" << filePath; + else + qDebug() << "capture file could not be opened!"; } } @@ -62,4 +65,15 @@ void CapturingConnectionManager::processFinished(int exitCode, QProcess::ExitSta InteractiveConnectionManager::processFinished(exitCode, exitStatus); } +void CapturingConnectionManager::writeCommand(const QVariant &command) +{ + InteractiveConnectionManager::writeCommand(command); + + if (m_captureFileForTest.isWritable()) { + qDebug() << "command name: " << QMetaType::typeName(command.userType()); + writeCommandToIODevice(command, &m_captureFileForTest, m_writeCommandCounter); + qDebug() << "\tcatpure file offset: " << m_captureFileForTest.pos(); + } +} + } // namespace QmlDesigner diff --git a/src/plugins/qmldesigner/designercore/instances/capturingconnectionmanager.h b/src/plugins/qmldesigner/designercore/instances/capturingconnectionmanager.h index de63da87fcf..1bedef440b3 100644 --- a/src/plugins/qmldesigner/designercore/instances/capturingconnectionmanager.h +++ b/src/plugins/qmldesigner/designercore/instances/capturingconnectionmanager.h @@ -29,7 +29,7 @@ namespace QmlDesigner { -class CapturingConnectionManager : public InteractiveConnectionManager +class QMLDESIGNERCORE_EXPORT CapturingConnectionManager : public InteractiveConnectionManager { public: void setUp(NodeInstanceServerProxy *nodeInstanceServerProxy, @@ -38,6 +38,8 @@ public: void processFinished(int exitCode, QProcess::ExitStatus exitStatus) override; + void writeCommand(const QVariant &command) override; + private: QFile m_captureFileForTest; }; diff --git a/src/plugins/qmldesigner/designercore/model/viewmanager.cpp b/src/plugins/qmldesigner/designercore/model/viewmanager.cpp index c3946a53789..34a2d4e4cfc 100644 --- a/src/plugins/qmldesigner/designercore/model/viewmanager.cpp +++ b/src/plugins/qmldesigner/designercore/model/viewmanager.cpp @@ -28,6 +28,7 @@ #ifndef QMLDESIGNER_TEST #include +#include #include #include #include @@ -37,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -61,10 +61,13 @@ class ViewManagerData { public: InteractiveConnectionManager connectionManager; + CapturingConnectionManager capturingConnectionManager; QmlModelState savedState; Internal::DebugView debugView; DesignerActionManagerView designerActionManagerView; - NodeInstanceView nodeInstanceView{connectionManager}; + NodeInstanceView nodeInstanceView{ + QCoreApplication::arguments().contains("-capture-puppet-stream") ? capturingConnectionManager + : connectionManager}; ComponentView componentView; Edit3DView edit3DView; FormEditorView formEditorView; diff --git a/src/plugins/qmldesigner/qmldesignerplugin.qbs b/src/plugins/qmldesigner/qmldesignerplugin.qbs index 9a1777f37c7..5ccf34efefc 100644 --- a/src/plugins/qmldesigner/qmldesignerplugin.qbs +++ b/src/plugins/qmldesigner/qmldesignerplugin.qbs @@ -780,6 +780,8 @@ Project { "richtexteditor/richtexteditor.cpp", "richtexteditor/richtexteditor.h", "richtexteditor/richtexteditor.ui", + "richtexteditor/richtexteditorproxy.cpp", + "richtexteditor/richtexteditorproxy.h", "sourcetool/sourcetool.cpp", "sourcetool/sourcetool.h", "texttool/textedititem.cpp", diff --git a/src/plugins/qtsupport/qtcreator_tutorials.xml b/src/plugins/qtsupport/qtcreator_tutorials.xml index 43fd0fbe01c..e7785a0e176 100644 --- a/src/plugins/qtsupport/qtcreator_tutorials.xml +++ b/src/plugins/qtsupport/qtcreator_tutorials.xml @@ -13,11 +13,11 @@ qt,qt creator,qt designer,widgets,c++,help - + qt creator,qt quick designer,qt quick,qml,states,transitions,help - + qt creator,qt quick designer,qml,android,ios,controls,help diff --git a/src/plugins/texteditor/texteditor.cpp b/src/plugins/texteditor/texteditor.cpp index c5b511b027d..204afbe6c28 100644 --- a/src/plugins/texteditor/texteditor.cpp +++ b/src/plugins/texteditor/texteditor.cpp @@ -96,6 +96,7 @@ #include #include #include +#include #include #include #include @@ -1147,6 +1148,8 @@ static void printPage(int index, QPainter *painter, const QTextDocument *doc, painter->restore(); } +Q_LOGGING_CATEGORY(printLog, "qtc.editor.print", QtWarningMsg) + void TextEditorWidgetPrivate::print(QPrinter *printer) { QTextDocument *doc = q->document(); @@ -1256,6 +1259,13 @@ void TextEditorWidgetPrivate::print(QPrinter *printer) ascending = false; } + qCDebug(printLog) << "Printing " << m_document->filePath() << ":\n" + << " number of copies:" << printer->numCopies() << '\n' + << " from page" << fromPage << "to" << toPage << '\n' + << " document page count:" << doc->pageCount() << '\n' + << " page rectangle:" << pageRect << '\n' + << " title box:" << titleBox << '\n'; + for (int i = 0; i < docCopies; ++i) { int page = fromPage; diff --git a/src/shared/qbs b/src/shared/qbs index 2ebe1e5bf9c..e42ad799703 160000 --- a/src/shared/qbs +++ b/src/shared/qbs @@ -1 +1 @@ -Subproject commit 2ebe1e5bf9c8cc2f4b97a1cf8a1edc97257de15f +Subproject commit e42ad799703412d7375465df49282dd960f81e2e