diff --git a/share/qtcreator/debugger/dumper.py b/share/qtcreator/debugger/dumper.py index ce2d3d3ef37..6646cc7e75e 100644 --- a/share/qtcreator/debugger/dumper.py +++ b/share/qtcreator/debugger/dumper.py @@ -1417,7 +1417,7 @@ class DumperBase: # warn("METAOBJECT EXTRACTION FAILED FOR UNKNOWN REASON") if not result: - base = self.directBaseClass(typeobj, 0) + base = self.directBaseClass(someTypeObj, 0) if base != someTypeObj: # sanity check result = extractStaticMetaObjectPtrFromType(base) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/OriginControl.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/OriginControl.qml index 72cd9eaecfe..0aeaa9232a6 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/OriginControl.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/HelperWidgets/OriginControl.qml @@ -32,7 +32,8 @@ Item { property variant backendValue - property color borderColor: colorLogic.textColor + property color borderColorSelected: colorLogic.textColor + property color borderColor: creatorTheme.QmlDesignerBorderColor property bool showTranslateCheckBox: true @@ -101,8 +102,8 @@ Item { width: 15 height: 15 color: selected ? selectedColor : unselectedColor - border.color: originControl.borderColor - border.width: selected ? 2 : 0 + border.width: selected ? 2 : 1 + border.color: selected ? originControl.borderColorSelected : originControl.borderColor MouseArea { anchors.fill: parent onClicked: { @@ -116,8 +117,8 @@ Item { width: topLeft.width height: topLeft.height color: selected ? selectedColor : unselectedColor - border.width: selected ? 2 : 0 - border.color: originControl.borderColor + border.width: selected ? 2 : 1 + border.color: selected ? originControl.borderColorSelected : originControl.borderColor MouseArea { anchors.fill: parent onClicked: { @@ -131,8 +132,8 @@ Item { width: topLeft.width height: topLeft.height color: selected ? selectedColor : unselectedColor - border.width: selected ? 2 : 0 - border.color: originControl.borderColor + border.width: selected ? 2 : 1 + border.color: selected ? originControl.borderColorSelected : originControl.borderColor MouseArea { anchors.fill: parent onClicked: { @@ -146,8 +147,8 @@ Item { width: topLeft.width height: topLeft.height color: selected ? selectedColor : unselectedColor - border.width: selected ? 2 : 0 - border.color: originControl.borderColor + border.width: selected ? 2 : 1 + border.color: selected ? originControl.borderColorSelected : originControl.borderColor MouseArea { anchors.fill: parent onClicked: { @@ -161,8 +162,8 @@ Item { width: topLeft.width height: topLeft.height color: selected ? selectedColor : unselectedColor - border.width: selected ? 2 : 0 - border.color: originControl.borderColor + border.width: selected ? 2 : 1 + border.color: selected ? originControl.borderColorSelected : originControl.borderColor MouseArea { anchors.fill: parent onClicked: { @@ -176,8 +177,8 @@ Item { width: topLeft.width height: topLeft.height color: selected ? selectedColor : unselectedColor - border.width: selected ? 2 : 0 - border.color: originControl.borderColor + border.width: selected ? 2 : 1 + border.color: selected ? originControl.borderColorSelected : originControl.borderColor MouseArea { anchors.fill: parent onClicked: { @@ -191,8 +192,8 @@ Item { width: topLeft.width height: topLeft.height color: selected ? selectedColor : unselectedColor - border.width: selected ? 2 : 0 - border.color: originControl.borderColor + border.width: selected ? 2 : 1 + border.color: selected ? originControl.borderColorSelected : originControl.borderColor MouseArea { anchors.fill: parent onClicked: { @@ -206,8 +207,8 @@ Item { width: topLeft.width height: topLeft.height color: selected ? selectedColor : unselectedColor - border.width: selected ? 2 : 0 - border.color: originControl.borderColor + border.width: selected ? 2 : 1 + border.color: selected ? originControl.borderColorSelected : originControl.borderColor MouseArea { anchors.fill: parent onClicked: { @@ -221,8 +222,8 @@ Item { width: topLeft.width height: topLeft.height color: selected ? selectedColor : unselectedColor - border.width: selected ? 2 : 0 - border.color: originControl.borderColor + border.width: selected ? 2 : 1 + border.color: selected ? originControl.borderColorSelected : originControl.borderColor MouseArea { anchors.fill: parent onClicked: { diff --git a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp index fb452feace5..80bedf58990 100644 --- a/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp +++ b/share/qtcreator/templates/wizards/classes/itemmodel/tablemodel.cpp @@ -29,7 +29,7 @@ bool %{CN}::setHeaderData(int section, Qt::Orientation orientation, const QVaria int %{CN}::rowCount(const QModelIndex &parent) const { - if (!parent.isValid()) + if (parent.isValid()) return 0; // FIXME: Implement me! @@ -37,7 +37,7 @@ int %{CN}::rowCount(const QModelIndex &parent) const int %{CN}::columnCount(const QModelIndex &parent) const { - if (!parent.isValid()) + if (parent.isValid()) return 0; // FIXME: Implement me! diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/Page1.qml.tpl b/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/Page1.qml.tpl index bb8b52b439f..71c6c623624 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/Page1.qml.tpl +++ b/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/Page1.qml.tpl @@ -2,9 +2,6 @@ import QtQuick %{QtQuickVersion} Page1Form { button1.onClicked: { - console.log("Button 1 clicked."); - } - button2.onClicked: { - console.log("Button 2 clicked."); + console.log("Button Pressed. Entered text: " + textField1.text); } } diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/Page1Form.ui.qml.tpl b/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/Page1Form.ui.qml.tpl index 863df116c72..422a94cc56c 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/Page1Form.ui.qml.tpl +++ b/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/Page1Form.ui.qml.tpl @@ -3,20 +3,22 @@ import Qt.labs.controls %{QtLabsControlsVersion} import QtQuick.Layouts %{QtQuickLayoutsVersion} Item { + property alias textField1: textField1 property alias button1: button1 - property alias button2: button2 RowLayout { - anchors.centerIn: parent + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: 20 + anchors.top: parent.top + + TextField { + id: textField1 + placeholderText: qsTr("Text Field") + } Button { id: button1 - text: qsTr("Press Me 1") - } - - Button { - id: button2 - text: qsTr("Press Me 2") + text: qsTr("Press Me") } } } diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/main.cpp b/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/main.cpp index 4142815437d..e08a85e3fde 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/main.cpp +++ b/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/main.cpp @@ -2,6 +2,10 @@ %{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])} int main(int argc, char *argv[]) { +@if %{UseVirtualKeyboard} + qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); + +@endif QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/main.qml.tpl b/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/main.qml.tpl index 284a7b30dbe..f38e96dcbeb 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/main.qml.tpl +++ b/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/main.qml.tpl @@ -1,12 +1,18 @@ import QtQuick %{QtQuickVersion} import QtQuick.Layouts %{QtQuickLayoutsVersion} import Qt.labs.controls %{QtLabsControlsVersion} +@if %{UseVirtualKeyboard} +import QtQuick.Enterprise.VirtualKeyboard %{QtQuickVirtualKeyboardVersion} +@endif ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") +@if %{UseVirtualKeyboard} + id: root +@endif SwipeView { id: swipeView @@ -34,4 +40,35 @@ ApplicationWindow { text: qsTr("Second") } } +@if %{UseVirtualKeyboard} + + InputPanel { + id: inputPanel + z: 99 + x: 0 + y: root.height + width: root.width + + states: State { + name: "visible" + when: inputPanel.active + PropertyChanges { + target: inputPanel + y: root.height - inputPanel.height + } + } + transitions: Transition { + from: "" + to: "visible" + reversible: true + ParallelAnimation { + NumberAnimation { + properties: "y" + duration: 250 + easing.type: Easing.InOutQuad + } + } + } + } +@endif } diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/wizard.json index 126df3ccf8f..b196d125897 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/qtlabscontrolsapplication/wizard.json @@ -17,7 +17,9 @@ { "key": "QtQuickVersion", "value": "2.6" }, { "key": "QtLabsControlsVersion", "value": "1.0" }, { "key": "QtQuickDialogsVersion", "value": "1.0" }, - { "key": "QtQuickLayoutsVersion", "value": "1.0" } + { "key": "QtQuickLayoutsVersion", "value": "1.0" }, + { "key": "QtQuickVirtualKeyboardVersion", "value": "2.0" }, + { "key": "UseVirtualKeyboard", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0}" } ], "pages": diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/MainForm.ui.qml.tpl b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/MainForm.ui.qml.tpl index 5718eeef36d..a41e66157c0 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/MainForm.ui.qml.tpl +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/MainForm.ui.qml.tpl @@ -2,6 +2,7 @@ import QtQuick %{QtQuickVersion} Rectangle { property alias mouseArea: mouseArea + property alias textEdit: textEdit width: 360 height: 360 @@ -11,8 +12,18 @@ Rectangle { anchors.fill: parent } - Text { - anchors.centerIn: parent - text: "Hello World" + TextEdit { + id: textEdit + text: qsTr("Enter some text...") + verticalAlignment: Text.AlignVCenter + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: 20 + Rectangle { + anchors.fill: parent + anchors.margins: -10 + color: "transparent" + border.width: 1 + } } } diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/main.cpp b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/main.cpp index 69f2694815b..a15a1f0b569 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/main.cpp +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/main.cpp @@ -2,6 +2,10 @@ %{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])} int main(int argc, char *argv[]) { +@if %{UseVirtualKeyboard} + qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); + +@endif QGuiApplication app(argc, argv); QQmlApplicationEngine engine; diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/main.qml.tpl b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/main.qml.tpl index 66c4c147c2b..bf7b08db71f 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/main.qml.tpl +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/main.qml.tpl @@ -1,30 +1,77 @@ import QtQuick %{QtQuickVersion} import QtQuick.Window %{QtQuickWindowVersion} +@if %{UseVirtualKeyboard} +import %{QtQuickVirtualKeyboardImport} +@endif Window { visible: true width: 640 height: 480 title: qsTr("Hello World") +@if %{UseVirtualKeyboard} + id: root +@endif @if %{IsUiFileInUse} MainForm { anchors.fill: parent mouseArea.onClicked: { - Qt.quit(); + console.log(qsTr('Clicked on background. Text: "' + textEdit.text + '"')) } } @else MouseArea { anchors.fill: parent onClicked: { - Qt.quit(); + console.log(qsTr('Clicked on background. Text: "' + textEdit.text + '"')) } } - Text { - text: qsTr("Hello World") - anchors.centerIn: parent + TextEdit { + id: textEdit + text: qsTr("Enter some text...") + verticalAlignment: Text.AlignVCenter + anchors.top: parent.top + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: 20 + Rectangle { + anchors.fill: parent + anchors.margins: -10 + color: "transparent" + border.width: 1 + } + } +@endif +@if %{UseVirtualKeyboard} + + InputPanel { + id: inputPanel + z: 99 + x: 0 + y: root.height + width: root.width + + states: State { + name: "visible" + when: %{QtQuickVirtualKeyboardWhenVisible} + PropertyChanges { + target: inputPanel + y: root.height - inputPanel.height + } + } + transitions: Transition { + from: "" + to: "visible" + reversible: true + ParallelAnimation { + NumberAnimation { + properties: "y" + duration: 250 + easing.type: Easing.InOutQuad + } + } + } } @endif } diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/wizard.json index e2722e14355..059c7b98ad6 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickapplication/wizard.json @@ -16,9 +16,12 @@ { "key": "MainCppFileName", "value": "%{JS: 'main.' + Util.preferredSuffix('text/x-c++src')}" }, { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.qtQuickVersion}" }, { "key": "QtQuickWindowVersion", "value": "%{JS: %{QtVersion}.qtQuickWindowVersion}" }, + { "key": "QtQuickVirtualKeyboardImport", "value": "%{JS: %{QtVersion}.qtQuickVirtualKeyboardImport}" }, + { "key": "QtQuickVirtualKeyboardWhenVisible", "value": "%{JS: %{QtVersion}.qtQuickVirtualKeyboardWhenVisible}" }, { "key": "QtQuickFeature", "value": "QtSupport.Wizards.FeatureQtQuick.%{QtQuickVersion}" }, { "key": "UiSupport", "value": "%{JS: '%{QtQuickVersion}' !== '2.3' }" }, - { "key": "IsUiFileInUse", "value": "%{JS: %{UiSupport} && %{QmlUiSplit} }" } + { "key": "IsUiFileInUse", "value": "%{JS: %{UiSupport} && %{QmlUiSplit} }" }, + { "key": "UseVirtualKeyboard", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0}" } ], "pages": @@ -48,7 +51,9 @@ "value": "{ 'qtQuickVersion': '2.7', - 'qtQuickWindowVersion': '2.2' + 'qtQuickWindowVersion': '2.2', + 'qtQuickVirtualKeyboardImport': 'QtQuick.VirtualKeyboard 2.1', + 'qtQuickVirtualKeyboardWhenVisible': 'inputPanel.active' }" }, { @@ -56,7 +61,9 @@ "value": "{ 'qtQuickVersion': '2.6', - 'qtQuickWindowVersion': '2.2' + 'qtQuickWindowVersion': '2.2', + 'qtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 2.0', + 'qtQuickVirtualKeyboardWhenVisible': 'inputPanel.active' }" }, { @@ -64,7 +71,9 @@ "value": "{ 'qtQuickVersion': '2.5', - 'qtQuickWindowVersion': '2.2' + 'qtQuickWindowVersion': '2.2', + 'qtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 1.3', + 'qtQuickVirtualKeyboardWhenVisible': 'Qt.inputMethod.visible' }" }, { @@ -72,7 +81,9 @@ "value": "{ 'qtQuickVersion': '2.4', - 'qtQuickWindowVersion': '2.2' + 'qtQuickWindowVersion': '2.2', + 'qtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 1.0', + 'qtQuickVirtualKeyboardWhenVisible': 'Qt.inputMethod.visible' }" }, { @@ -80,7 +91,9 @@ "value": "{ 'qtQuickVersion': '2.3', - 'qtQuickWindowVersion': '2.2' + 'qtQuickWindowVersion': '2.2', + 'qtQuickVirtualKeyboardImport': 'QtQuick.Enterprise.VirtualKeyboard 1.0', + 'qtQuickVirtualKeyboardWhenVisible': 'Qt.inputMethod.visible' }" } ] diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/Page1.qml.tpl b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/Page1.qml.tpl index bb8b52b439f..71c6c623624 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/Page1.qml.tpl +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/Page1.qml.tpl @@ -2,9 +2,6 @@ import QtQuick %{QtQuickVersion} Page1Form { button1.onClicked: { - console.log("Button 1 clicked."); - } - button2.onClicked: { - console.log("Button 2 clicked."); + console.log("Button Pressed. Entered text: " + textField1.text); } } diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/Page1Form.ui.qml.tpl b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/Page1Form.ui.qml.tpl index 1f831a02ab6..f2fcc8cff3c 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/Page1Form.ui.qml.tpl +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/Page1Form.ui.qml.tpl @@ -3,20 +3,22 @@ import QtQuick.Controls %{QtQuickControls2Version} import QtQuick.Layouts %{QtQuickLayoutsVersion} Item { + property alias textField1: textField1 property alias button1: button1 - property alias button2: button2 RowLayout { - anchors.centerIn: parent + anchors.horizontalCenter: parent.horizontalCenter + anchors.topMargin: 20 + anchors.top: parent.top + + TextField { + id: textField1 + placeholderText: qsTr("Text Field") + } Button { id: button1 - text: qsTr("Press Me 1") - } - - Button { - id: button2 - text: qsTr("Press Me 2") + text: qsTr("Press Me") } } } diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/main.cpp b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/main.cpp index 4142815437d..e08a85e3fde 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/main.cpp +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/main.cpp @@ -2,6 +2,10 @@ %{JS: QtSupport.qtIncludes([], ["QtGui/QGuiApplication", "QtQml/QQmlApplicationEngine"])} int main(int argc, char *argv[]) { +@if %{UseVirtualKeyboard} + qputenv("QT_IM_MODULE", QByteArray("qtvirtualkeyboard")); + +@endif QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); QGuiApplication app(argc, argv); diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/main.qml.tpl b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/main.qml.tpl index 26349844595..8c55ad596a5 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/main.qml.tpl +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/main.qml.tpl @@ -1,12 +1,18 @@ import QtQuick %{QtQuickVersion} import QtQuick.Controls %{QtQuickControls2Version} import QtQuick.Layouts %{QtQuickLayoutsVersion} +@if %{UseVirtualKeyboard} +import QtQuick.VirtualKeyboard %{QtQuickVirtualKeyboardVersion} +@endif ApplicationWindow { visible: true width: 640 height: 480 title: qsTr("Hello World") +@if %{UseVirtualKeyboard} + id: root +@endif SwipeView { id: swipeView @@ -34,4 +40,35 @@ ApplicationWindow { text: qsTr("Second") } } +@if %{UseVirtualKeyboard} + + InputPanel { + id: inputPanel + z: 99 + x: 0 + y: root.height + width: root.width + + states: State { + name: "visible" + when: inputPanel.active + PropertyChanges { + target: inputPanel + y: root.height - inputPanel.height + } + } + transitions: Transition { + from: "" + to: "visible" + reversible: true + ParallelAnimation { + NumberAnimation { + properties: "y" + duration: 250 + easing.type: Easing.InOutQuad + } + } + } + } +@endif } diff --git a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/wizard.json b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/wizard.json index d91a1c1039c..4193461bf31 100644 --- a/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmake/qtquickcontrols2application/wizard.json @@ -17,7 +17,9 @@ { "key": "QtQuickVersion", "value": "2.7" }, { "key": "QtQuickControls2Version", "value": "2.0" }, { "key": "QtQuickDialogsVersion", "value": "1.0" }, - { "key": "QtQuickLayoutsVersion", "value": "1.0" } + { "key": "QtQuickLayoutsVersion", "value": "1.0" }, + { "key": "QtQuickVirtualKeyboardVersion", "value": "2.1" }, + { "key": "UseVirtualKeyboard", "value": "%{JS: [ %{Plugins} ].indexOf('Boot2Qt') >= 0}" } ], "pages": diff --git a/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json index 9307bd7c5d7..559729e66f3 100644 --- a/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json +++ b/share/qtcreator/templates/wizards/projects/qmlproject/qtquickapplication/wizard.json @@ -17,7 +17,8 @@ { "key": "QtQuickVersion", "value": "%{JS: %{QtVersion}.qtQuickVersion}" }, { "key": "QtQuickWindowVersion", "value": "%{JS: %{QtVersion}.qtQuickWindowVersion}" }, { "key": "UiSupport", "value": "%{JS: '%{QtQuickVersion}' !== '2.3' }" }, - { "key": "IsUiFileInUse", "value": "%{JS: %{UiSupport} && %{QmlUiSplit} }" } + { "key": "IsUiFileInUse", "value": "%{JS: %{UiSupport} && %{QmlUiSplit} }" }, + { "key": "UseVirtualKeyboard", "value": "false" } ], "pages": diff --git a/src/plugins/autotest/testconfiguration.cpp b/src/plugins/autotest/testconfiguration.cpp index 1082594009b..68a9b641689 100644 --- a/src/plugins/autotest/testconfiguration.cpp +++ b/src/plugins/autotest/testconfiguration.cpp @@ -263,5 +263,48 @@ void TestConfiguration::setGuessedConfiguration(bool guessed) m_guessedConfiguration = guessed; } +QString TestConfiguration::executableFilePath() const +{ + if (m_targetFile.isEmpty()) + return QString(); + + QFileInfo commandFileInfo(m_targetFile); + if (commandFileInfo.isExecutable() && commandFileInfo.path() != ".") { + return commandFileInfo.absoluteFilePath(); + } else if (commandFileInfo.path() == "."){ + QString fullCommandFileName = m_targetFile; + #ifdef Q_OS_WIN + if (!m_targetFile.endsWith(".exe")) + fullCommandFileName = m_targetFile + QLatin1String(".exe"); + + static const QString separator(";"); + #else + static const QString separator(":"); + #endif + // TODO: check if we can use searchInPath() from Utils::Environment + const QStringList &pathList + = m_environment.toProcessEnvironment().value("PATH").split(separator); + + foreach (const QString &path, pathList) { + QString filePath(path + QDir::separator() + fullCommandFileName); + if (QFileInfo(filePath).isExecutable()) + return commandFileInfo.absoluteFilePath(); + } + } + return QString(); +} + +QString TestConfiguration::workingDirectory() const +{ + if (!m_workingDir.isEmpty()) { + const QFileInfo info(m_workingDir); + if (info.isDir()) // ensure wanted working dir does exist + return info.absoluteFilePath(); + } + + const QString executable = executableFilePath(); + return executable.isEmpty() ? executable : QFileInfo(executable).absolutePath(); +} + } // namespace Internal } // namespace Autotest diff --git a/src/plugins/autotest/testconfiguration.h b/src/plugins/autotest/testconfiguration.h index 2ea58b84cf6..224b7c279b1 100644 --- a/src/plugins/autotest/testconfiguration.h +++ b/src/plugins/autotest/testconfiguration.h @@ -74,8 +74,9 @@ public: int testCaseCount() const { return m_testCaseCount; } QString proFile() const { return m_proFile; } QString targetFile() const { return m_targetFile; } + QString executableFilePath() const; QString targetName() const { return m_targetName; } - QString workingDirectory() const { return m_workingDir; } + QString workingDirectory() const; QString buildDirectory() const { return m_buildDir; } QString displayName() const { return m_displayName; } Utils::Environment environment() const { return m_environment; } diff --git a/src/plugins/autotest/testrunner.cpp b/src/plugins/autotest/testrunner.cpp index a85bc750de2..f5f271b27b1 100644 --- a/src/plugins/autotest/testrunner.cpp +++ b/src/plugins/autotest/testrunner.cpp @@ -55,35 +55,6 @@ namespace Internal { static TestRunner *m_instance = 0; -static QString executableFilePath(const QString &command, const QProcessEnvironment &environment) -{ - if (command.isEmpty()) - return QString(); - - QFileInfo commandFileInfo(command); - if (commandFileInfo.isExecutable() && commandFileInfo.path() != QLatin1String(".")) { - return commandFileInfo.absoluteFilePath(); - } else if (commandFileInfo.path() == QLatin1String(".")){ - QString fullCommandFileName = command; - #ifdef Q_OS_WIN - if (!command.endsWith(QLatin1String(".exe"))) - fullCommandFileName = command + QLatin1String(".exe"); - - static const QString pathSeparator(QLatin1Char(';')); - #else - static const QString pathSeparator(QLatin1Char(':')); - #endif - QStringList pathList = environment.value(QLatin1String("PATH")).split(pathSeparator); - - foreach (const QString &path, pathList) { - QString filePath(path + QDir::separator() + fullCommandFileName); - if (QFileInfo(filePath).isExecutable()) - return commandFileInfo.absoluteFilePath(); - } - } - return QString(); -} - TestRunner *TestRunner::instance() { if (!m_instance) @@ -157,7 +128,7 @@ static void performTestRun(QFutureInterface &futureInterface, continue; QProcessEnvironment environment = testConfiguration->environment().toProcessEnvironment(); - QString commandFilePath = executableFilePath(testConfiguration->targetFile(), environment); + QString commandFilePath = testConfiguration->executableFilePath(); if (commandFilePath.isEmpty()) { futureInterface.reportResult(TestResultPtr(new FaultyTestResult(Result::MessageFatal, TestRunner::tr("Could not find command \"%1\". (%2)") @@ -293,8 +264,7 @@ void TestRunner::debugTests() return; } - const QString &commandFilePath = executableFilePath(config->targetFile(), - config->environment().toProcessEnvironment()); + const QString &commandFilePath = config->executableFilePath(); if (commandFilePath.isEmpty()) { emit testResultReady(TestResultPtr(new FaultyTestResult(Result::MessageFatal, TestRunner::tr("Could not find command \"%1\". (%2)") diff --git a/tests/system/suite_QMLS/tst_QMLS01/test.py b/tests/system/suite_QMLS/tst_QMLS01/test.py index 49892cdec4d..cb8f6447a2a 100644 --- a/tests/system/suite_QMLS/tst_QMLS01/test.py +++ b/tests/system/suite_QMLS/tst_QMLS01/test.py @@ -116,23 +116,23 @@ def main(): if not startQtCreatorWithNewAppAtQMLEditor(tempDir(), "SampleApp"): return # test "color: " suggestion usage with Enter key - if not testSuggestionsAuto("Text {", "col", "color:", ""): + if not testSuggestionsAuto("TextEdit {", "col", "color:", ""): saveAndExit() return # test "color: " suggestion usage with Tab key - if not testSuggestionsAuto("Text {", "col", "color:", ""): + if not testSuggestionsAuto("TextEdit {", "col", "color:", ""): saveAndExit() return # test "textChanged: " suggestion - automatic insert, because only one suggestion available shortcutToSuggestions = "" if platform.system() == "Darwin": shortcutToSuggestions = "" - if not testSuggestionsAuto("Text {","textChan", "textChanged:", shortcutToSuggestions): + if not testSuggestionsAuto("TextEdit {","baseu", "baseUrl:", shortcutToSuggestions): saveAndExit() return # change settings to manual insertion of suggestions changeAutocompleteToManual() # test manual suggestions - testSuggestionsManual("Text {", "col", "color:") + testSuggestionsManual("TextEdit {", "col", "color:") # exit qt creator saveAndExit() diff --git a/tests/system/suite_QMLS/tst_QMLS02/test.py b/tests/system/suite_QMLS/tst_QMLS02/test.py index 0672239e217..78101fc08fe 100644 --- a/tests/system/suite_QMLS/tst_QMLS02/test.py +++ b/tests/system/suite_QMLS/tst_QMLS02/test.py @@ -27,7 +27,7 @@ source("../shared/qmls.py") source("../../shared/suites_qtta.py") def main(): - editorArea = startQtCreatorWithNewAppAtQMLEditor(tempDir(), "SampleApp", "Text {") + editorArea = startQtCreatorWithNewAppAtQMLEditor(tempDir(), "SampleApp", "TextEdit {") if not editorArea: return # write code with error (C should be lower case) diff --git a/tests/system/suite_QMLS/tst_QMLS04/test.py b/tests/system/suite_QMLS/tst_QMLS04/test.py index e387ecfd0eb..5dabdf7f0f2 100644 --- a/tests/system/suite_QMLS/tst_QMLS04/test.py +++ b/tests/system/suite_QMLS/tst_QMLS04/test.py @@ -27,7 +27,7 @@ source("../shared/qmls.py") def main(): projectDir = tempDir() - editorArea = startQtCreatorWithNewAppAtQMLEditor(projectDir, "SampleApp", "Text {") + editorArea = startQtCreatorWithNewAppAtQMLEditor(projectDir, "SampleApp", "TextEdit {") if not editorArea: return for i in range(5): @@ -45,9 +45,9 @@ def main(): # verify if refactoring is done correctly waitFor("'MyComponent' in str(editorArea.plainText)", 2000) codeText = str(editorArea.plainText) - patternCodeToAdd = "MyComponent\s+\{\s*\}" - patternCodeToMove = "Text\s+\{.*\}" - # there should be empty MyComponent item instead of Text item + patternCodeToAdd = "MyComponent\s+\{\s*id: textEdit\s*\}" + patternCodeToMove = "TextEdit\s+\{.*\}" + # there should be empty MyComponent item instead of TextEdit item if re.search(patternCodeToAdd, codeText, re.DOTALL) and not re.search(patternCodeToMove, codeText, re.DOTALL): test.passes("Refactoring was properly applied in source file") else: diff --git a/tests/system/suite_QMLS/tst_QMLS05/test.py b/tests/system/suite_QMLS/tst_QMLS05/test.py index 58860c27a6e..3db2f02f015 100644 --- a/tests/system/suite_QMLS/tst_QMLS05/test.py +++ b/tests/system/suite_QMLS/tst_QMLS05/test.py @@ -26,7 +26,7 @@ source("../shared/qmls.py") def main(): - editorArea = startQtCreatorWithNewAppAtQMLEditor(tempDir(), "SampleApp", "Text {") + editorArea = startQtCreatorWithNewAppAtQMLEditor(tempDir(), "SampleApp", "TextEdit {") if not editorArea: return homeKey = "" diff --git a/tests/system/suite_SCOM/tst_SCOM02/test.py b/tests/system/suite_SCOM/tst_SCOM02/test.py index 87cd57990a4..7c9dd60cea7 100644 --- a/tests/system/suite_SCOM/tst_SCOM02/test.py +++ b/tests/system/suite_SCOM/tst_SCOM02/test.py @@ -35,7 +35,7 @@ def main(): createNewQtQuickApplication(tempDir(), "SampleApp") # create syntax error in qml file openDocument("SampleApp.Resources.qml\.qrc./.main\\.qml") - if not appendToLine(waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget"), "Text {", "SyntaxError"): + if not appendToLine(waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget"), "TextEdit {", "SyntaxError"): invokeMenuItem("File", "Exit") return # save all to invoke qml parsing diff --git a/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.tsv b/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.tsv index b7422391d58..f59b0df27eb 100644 --- a/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.tsv +++ b/tests/system/suite_debugger/tst_simple_analyze/testdata/events_qt5.tsv @@ -1,15 +1,20 @@ "0" "1" "6" "11" "" "" "1" "Main Program" -"main.qml:4" "Create" "2" "QtQuick.Window/Window" "main.qml:15" "Signal" "2" "onTriggered: { runCount += 1; var i; for (i = 1; i < 2500; ++i) { var j = i * i; console.log(j); } }" "main.qml:15" "JavaScript" "2" "onTriggered" -"main.qml:33" "Create" "2" "QtQuick/Text" +"main.qml:4" "Create" "2" "QtQuick.Window/Window" +"main.qml:33" "Create" "2" "QtQuick/TextEdit" "main.qml:1" "Compile" "1" "main.qml" "main.qml:10" "Create" "2" "QtQuick/Timer" -"main.qml:35" "Binding" "1" "anchors.centerIn: parent" -"main.qml:26" "Create" "2" "QtQuick/MouseArea" +"main.qml:37" "Binding" "1" "anchors.top: parent.top" +"main.qml:40" "Create" "2" "QtQuick/Rectangle" +"main.qml:37" "JavaScript" "1" "expression for top" "main.qml:14" "Binding" "3" "running: runCount < 2" -"main.qml:35" "JavaScript" "1" "expression for centerIn" +"main.qml:26" "Create" "2" "QtQuick/MouseArea" +"main.qml:38" "Binding" "1" "anchors.horizontalCenter: parent.horizontalCenter" +"main.qml:38" "JavaScript" "1" "expression for horizontalCenter" +"main.qml:41" "Binding" "1" "anchors.fill: parent" "main.qml:27" "Binding" "1" "anchors.fill: parent" "main.qml:14" "JavaScript" "3" "expression for running" -"main.qml:27" "JavaScript" "1" "expression for fill" +"main.qml:41" JavaScript "1" "expression for fill" +"main.qml:27" JavaScript "1" "expression for fill"