forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.1'
Conflicts: qbs/modules/qtc/qtc.qbs qtcreator.pri Change-Id: Id3be48ea1d00fadbec9a56d721688732118aab28
This commit is contained in:
@@ -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)
|
||||
|
||||
|
@@ -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: {
|
||||
|
@@ -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!
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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":
|
||||
|
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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;
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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'
|
||||
}"
|
||||
}
|
||||
]
|
||||
|
@@ -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);
|
||||
}
|
||||
}
|
||||
|
@@ -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")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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
|
||||
}
|
||||
|
@@ -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":
|
||||
|
@@ -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":
|
||||
|
@@ -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
|
||||
|
@@ -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; }
|
||||
|
@@ -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<TestResultPtr> &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)")
|
||||
|
@@ -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:", "<Return>"):
|
||||
if not testSuggestionsAuto("TextEdit {", "col", "color:", "<Return>"):
|
||||
saveAndExit()
|
||||
return
|
||||
# test "color: " suggestion usage with Tab key
|
||||
if not testSuggestionsAuto("Text {", "col", "color:", "<Tab>"):
|
||||
if not testSuggestionsAuto("TextEdit {", "col", "color:", "<Tab>"):
|
||||
saveAndExit()
|
||||
return
|
||||
# test "textChanged: " suggestion - automatic insert, because only one suggestion available
|
||||
shortcutToSuggestions = "<Ctrl+Space>"
|
||||
if platform.system() == "Darwin":
|
||||
shortcutToSuggestions = "<Meta+Space>"
|
||||
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()
|
||||
|
@@ -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)
|
||||
|
@@ -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:
|
||||
|
@@ -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 = "<Home>"
|
||||
|
@@ -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
|
||||
|
@@ -1,15 +1,20 @@
|
||||
"0" "1" "6" "11"
|
||||
"<program>" "" "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"
|
||||
|
|
Reference in New Issue
Block a user