Merge remote-tracking branch 'origin/3.1'
@@ -1,13 +1,9 @@
|
|||||||
//! [2]
|
import QtQuick 2.1
|
||||||
|
import QtQuick.Window 2.1
|
||||||
|
|
||||||
//! [1]
|
Window {
|
||||||
|
|
||||||
//! [0]
|
|
||||||
|
|
||||||
import QtQuick 2.0
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
id: page
|
id: page
|
||||||
|
visible: true
|
||||||
width: 360
|
width: 360
|
||||||
height: 360
|
height: 360
|
||||||
color: "#343434"
|
color: "#343434"
|
||||||
@@ -21,11 +17,11 @@ Rectangle {
|
|||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: topLeftRect
|
id: topLeftRect
|
||||||
y: 20
|
|
||||||
width: 64
|
width: 64
|
||||||
height: 64
|
height: 64
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
radius: 6
|
radius: 6
|
||||||
|
opacity: 1
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: 10
|
anchors.leftMargin: 10
|
||||||
anchors.top: parent.top
|
anchors.top: parent.top
|
||||||
@@ -33,95 +29,95 @@ Rectangle {
|
|||||||
border.color: "#808080"
|
border.color: "#808080"
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: mousearea1
|
id: mouseArea1
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
onClicked: page.state = ' '
|
onClicked: stateGroup.state = ' '
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//! [0]
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: middleRightRect
|
id: middleRightRect
|
||||||
width: 64
|
width: 64
|
||||||
height: 64
|
height: 64
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
radius: 6
|
radius: 6
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 10
|
anchors.rightMargin: 10
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
border.color: "#808080"
|
border.color: "#808080"
|
||||||
MouseArea {
|
|
||||||
id: mousearea2
|
MouseArea {
|
||||||
anchors.fill: parent
|
id: mouseArea2
|
||||||
onClicked: page.state = 'State1'
|
anchors.fill: parent
|
||||||
}
|
onClicked: stateGroup.state = 'State1'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: bottomLeftRect
|
id: bottomLeftRect
|
||||||
width: 64
|
width: 64
|
||||||
height: 64
|
height: 64
|
||||||
color: "#00000000"
|
color: "#00000000"
|
||||||
radius: 6
|
radius: 6
|
||||||
anchors.left: parent.left
|
border.width: 1
|
||||||
anchors.leftMargin: 10
|
anchors.leftMargin: 10
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.bottomMargin: 20
|
anchors.bottomMargin: 20
|
||||||
border.color: "#808080"
|
anchors.left: parent.left
|
||||||
MouseArea {
|
border.color: "#808080"
|
||||||
id: mousearea3
|
|
||||||
anchors.fill: parent
|
MouseArea {
|
||||||
onClicked: page.state = 'State2'
|
id: mouseArea3
|
||||||
}
|
anchors.fill: parent
|
||||||
|
onClicked: stateGroup.state = 'State2'
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//! [1]
|
StateGroup {
|
||||||
|
id: stateGroup
|
||||||
states: [
|
states: [
|
||||||
State {
|
State {
|
||||||
name: "State1"
|
name: "State1"
|
||||||
|
|
||||||
PropertyChanges {
|
PropertyChanges {
|
||||||
target: icon
|
target: icon
|
||||||
x: middleRightRect.x
|
x: middleRightRect.x
|
||||||
y: middleRightRect.y
|
y: middleRightRect.y
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "State2"
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
target: icon
|
|
||||||
x: bottomLeftRect.x
|
|
||||||
y: bottomLeftRect.y
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
|
|
||||||
transitions: [
|
|
||||||
Transition {
|
|
||||||
from: "*"; to: "State1"
|
|
||||||
NumberAnimation {
|
|
||||||
easing.type: Easing.OutBounce
|
|
||||||
properties: "x,y";
|
|
||||||
duration: 1000
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
Transition {
|
State {
|
||||||
from: "*"; to: "State2"
|
name: "State2"
|
||||||
NumberAnimation {
|
|
||||||
properties: "x,y";
|
PropertyChanges {
|
||||||
easing.type: Easing.InOutQuad;
|
target: icon
|
||||||
duration: 2000
|
x: bottomLeftRect.x
|
||||||
|
y: bottomLeftRect.y
|
||||||
}
|
}
|
||||||
},
|
}
|
||||||
Transition {
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "x,y";
|
|
||||||
duration: 200
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
]
|
||||||
|
transitions: [
|
||||||
|
Transition {
|
||||||
|
from: "*"; to: "State1"
|
||||||
|
NumberAnimation {
|
||||||
|
easing.type: Easing.OutBounce
|
||||||
|
properties: "x,y";
|
||||||
|
duration: 1000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Transition {
|
||||||
|
from: "*"; to: "State2"
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "x,y";
|
||||||
|
easing.type: Easing.InOutQuad;
|
||||||
|
duration: 2000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Transition {
|
||||||
|
NumberAnimation {
|
||||||
|
properties: "x,y";
|
||||||
|
duration: 200
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//! [2]
|
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 105 KiB After Width: | Height: | Size: 104 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 41 KiB After Width: | Height: | Size: 99 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 26 KiB |
@@ -1,31 +0,0 @@
|
|||||||
Item {
|
|
||||||
transitions: [
|
|
||||||
//! [first transition]
|
|
||||||
Transition {
|
|
||||||
from: "*"; to: "State1"
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "x,y";
|
|
||||||
duration: 1000
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//! [first transition]
|
|
||||||
//! [second transition]
|
|
||||||
Transition {
|
|
||||||
from: "*"; to: "State2"
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "x,y";
|
|
||||||
easing.type: Easing.InOutQuad;
|
|
||||||
duration: 2000
|
|
||||||
}
|
|
||||||
},
|
|
||||||
//! [second transition]
|
|
||||||
//! [default transition]
|
|
||||||
Transition {
|
|
||||||
NumberAnimation {
|
|
||||||
properties: "x,y";
|
|
||||||
duration: 200
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
//! [default transition]
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
Item {
|
|
||||||
//! [states]
|
|
||||||
states: [
|
|
||||||
State {
|
|
||||||
name: "State1"
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
target: icon
|
|
||||||
x: middleRightRect.x
|
|
||||||
y: middleRightRect.y
|
|
||||||
}
|
|
||||||
},
|
|
||||||
State {
|
|
||||||
name: "State2"
|
|
||||||
|
|
||||||
PropertyChanges {
|
|
||||||
target: icon
|
|
||||||
x: bottomLeftRect.x
|
|
||||||
y: bottomLeftRect.y
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
//! [states]
|
|
||||||
}
|
|
||||||
@@ -111,6 +111,8 @@
|
|||||||
devices that are suitable for publishing to application stores
|
devices that are suitable for publishing to application stores
|
||||||
and other channels. You must make sure that the package contents
|
and other channels. You must make sure that the package contents
|
||||||
meet the requirements for publishing on the channel.
|
meet the requirements for publishing on the channel.
|
||||||
\endtable
|
|
||||||
|
For more information, see \l{Publishing to Google Play}.
|
||||||
|
\endtable
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -57,12 +57,16 @@
|
|||||||
\li Clang is a C, C++, Objective C, and Objective C++ front-end for the
|
\li Clang is a C, C++, Objective C, and Objective C++ front-end for the
|
||||||
LLVM compiler for Windows, Linux, and Mac OS X.
|
LLVM compiler for Windows, Linux, and Mac OS X.
|
||||||
|
|
||||||
|
\li QCC is the interface for compiling C++ applications for QNX.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
To build an application using GCC, MinGW, or Clang, specify the path
|
To build an application using GCC, MinGW, Clang, or QCC, specify the path
|
||||||
to the directory where the compiler is located and select
|
to the directory where the compiler is located and select
|
||||||
the application binary interface (ABI) version from the list of available
|
the application binary interface (ABI) version from the list of available
|
||||||
versions. You can also create a custom ABI definition.
|
versions. You can also create a custom ABI definition.
|
||||||
|
For QCC, also specify the path to the BlackBerry NDK or the QNX Software
|
||||||
|
Development Platform (SDP).
|
||||||
|
|
||||||
You specify the compiler to use for each kit in \gui Tools >
|
You specify the compiler to use for each kit in \gui Tools >
|
||||||
\gui Options > \gui {Build & Run} > \gui Kits.
|
\gui Options > \gui {Build & Run} > \gui Kits.
|
||||||
|
|||||||
@@ -66,11 +66,9 @@
|
|||||||
\li In the \gui{qmake location} field, you can change the qmake
|
\li In the \gui{qmake location} field, you can change the qmake
|
||||||
location.
|
location.
|
||||||
|
|
||||||
\li In the \gui Helpers section, select \gui Details to build the debugging
|
\li In the \gui Helpers section, select \gui Details to view the
|
||||||
helpers that are available for the Qt version. This is
|
QML Dumper that has been built for the Qt version. For more
|
||||||
necessary, because the internal data structures of Qt can
|
information, see \l{Using Debugging Helpers}.
|
||||||
change between versions. For more information, see
|
|
||||||
\l{Using Debugging Helpers}.
|
|
||||||
|
|
||||||
\image qt-creator-debugging-helpers.png
|
\image qt-creator-debugging-helpers.png
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,8 @@
|
|||||||
This tutorial uses built-in QML types and illustrates basic concepts of
|
This tutorial uses built-in QML types and illustrates basic concepts of
|
||||||
\l{Qt Quick}.
|
\l{Qt Quick}.
|
||||||
|
|
||||||
This tutorial describes how to use \QC to implement Qt states and transitions. We use
|
This tutorial describes how to use \QC to implement Qt Quick states and
|
||||||
\l{Animation}{Qt example code} to
|
transitions. We
|
||||||
create an application that displays a Qt logo that moves between three rectangles on the
|
create an application that displays a Qt logo that moves between three rectangles on the
|
||||||
page when you click them.
|
page when you click them.
|
||||||
|
|
||||||
@@ -57,11 +57,7 @@
|
|||||||
Windows and Linux) or \gui Continue (on Mac OS).
|
Windows and Linux) or \gui Continue (on Mac OS).
|
||||||
|
|
||||||
\li In the \gui {Qt Quick component set} field, select
|
\li In the \gui {Qt Quick component set} field, select
|
||||||
\gui {Qt Quick 2.0}.
|
\gui {Qt Quick 2.1}.
|
||||||
|
|
||||||
\note The QML types used in this example are also supported in
|
|
||||||
Qt Quick 1.1. To create this example application for platforms that
|
|
||||||
run Qt 4, select \gui {Qt Quick 1.1}.
|
|
||||||
|
|
||||||
\li Select \l{glossary-buildandrun-kit}{kits} for running and building your project,
|
\li Select \l{glossary-buildandrun-kit}{kits} for running and building your project,
|
||||||
and then click \gui{Next}.
|
and then click \gui{Next}.
|
||||||
@@ -92,7 +88,8 @@
|
|||||||
To use the states.png image in your application, you must copy it to the
|
To use the states.png image in your application, you must copy it to the
|
||||||
project directory (same subdirectory as the QML file) from the examples
|
project directory (same subdirectory as the QML file) from the examples
|
||||||
directory in the Qt installation directory. For example:
|
directory in the Qt installation directory. For example:
|
||||||
\c {C:\Qt\Qt5.0.1\5.0.1\msvc2010\examples\declarative\animation\states}. The image appears
|
\c {C:\Qt\Qt5.3.0\5.3.0\msvc2010\examples\declarative\animation\states}. The
|
||||||
|
image appears
|
||||||
in the \gui Resources pane. You can also use any other image or a QML
|
in the \gui Resources pane. You can also use any other image or a QML
|
||||||
type, instead.
|
type, instead.
|
||||||
|
|
||||||
@@ -108,18 +105,22 @@
|
|||||||
\li In the \gui Navigator pane, select \gui Text and press \key Delete to
|
\li In the \gui Navigator pane, select \gui Text and press \key Delete to
|
||||||
delete it.
|
delete it.
|
||||||
|
|
||||||
\li Select \gui Rectangle to edit its properties.
|
\li Select \gui Window to edit its properties.
|
||||||
|
|
||||||
\image qmldesigner-tutorial-page.png "Page properties"
|
\image qmldesigner-tutorial-page.png "Page properties"
|
||||||
|
|
||||||
\list a
|
\list a
|
||||||
|
|
||||||
\li In the \gui Id field, enter \e page, to be able to reference the
|
\li In the \gui Id field, enter \e page, to be able to reference the
|
||||||
rectangle from other places.
|
window from other places.
|
||||||
|
|
||||||
\li In the \gui Color field, set the color to #343434.
|
\li In the code editor, set the window background color to #343434:
|
||||||
|
|
||||||
\li In the code editor, delete the \c {Qt.quit();} command.
|
\quotefromfile transitions/main.qml
|
||||||
|
\skipto Window {
|
||||||
|
\printuntil color
|
||||||
|
|
||||||
|
\li Delete the \c {Qt.quit();} command.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@@ -136,7 +137,13 @@
|
|||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
\li In the \gui Library view, \gui {QML Types} tab, select \gui Rectangle,
|
\li Double-click the resource file, qml.qrc, in the \gui Projects view
|
||||||
|
to add states.png to the resource file for deployment.
|
||||||
|
|
||||||
|
\li Click \gui Add and select states.png.
|
||||||
|
|
||||||
|
\li In the \gui Design mode, \gui Library view, \gui {QML Types} tab,
|
||||||
|
select \gui Rectangle,
|
||||||
drag and drop it to the canvas, and edit its properties.
|
drag and drop it to the canvas, and edit its properties.
|
||||||
|
|
||||||
\image qmldesigner-tutorial-topleftrect.png "Rectangle properties"
|
\image qmldesigner-tutorial-topleftrect.png "Rectangle properties"
|
||||||
@@ -194,21 +201,24 @@
|
|||||||
in the mouse area, as illustrated by the following code
|
in the mouse area, as illustrated by the following code
|
||||||
snippet:
|
snippet:
|
||||||
|
|
||||||
\qml
|
\quotefromfile transitions/main.qml
|
||||||
MouseArea {
|
\skipto MouseArea
|
||||||
anchors.fill: parent
|
\printuntil }
|
||||||
onClicked: page.state = ''
|
|
||||||
}
|
|
||||||
\endqml
|
|
||||||
|
|
||||||
The expression sets the state to the base state and returns the
|
The expression sets the state to the base state and returns the
|
||||||
image to its initial position.
|
image to its initial position.
|
||||||
|
You will create stateGroup later.
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
The qml.main file should now look as follows:
|
The qml.main file should now look as follows:
|
||||||
|
|
||||||
\snippet transitions/main.qml 0
|
\quotefromfile transitions/main.qml
|
||||||
|
\skipto Window {
|
||||||
|
\printuntil onClicked
|
||||||
|
\printuntil }
|
||||||
|
\printuntil }
|
||||||
|
\printuntil }
|
||||||
|
|
||||||
\li In the \gui Navigator pane, copy topLeftRect (by pressing
|
\li In the \gui Navigator pane, copy topLeftRect (by pressing
|
||||||
\key {Ctrl+C}) and paste it to the canvas twice (by pressing
|
\key {Ctrl+C}) and paste it to the canvas twice (by pressing
|
||||||
@@ -232,7 +242,7 @@
|
|||||||
mouse area. The following expression sets the state to
|
mouse area. The following expression sets the state to
|
||||||
\e State1:
|
\e State1:
|
||||||
|
|
||||||
\c {onClicked: page.state = 'State1'}
|
\c {onClicked: stateGroup.state = 'State1'}
|
||||||
|
|
||||||
You will create State1 later.
|
You will create State1 later.
|
||||||
|
|
||||||
@@ -254,13 +264,18 @@
|
|||||||
mouse area. The following expression sets the state to
|
mouse area. The following expression sets the state to
|
||||||
\e State2:
|
\e State2:
|
||||||
|
|
||||||
\c {onClicked: page.state = 'State2'}
|
\c {onClicked: stateGroup.state = 'State2'}
|
||||||
|
|
||||||
You will create State2 later.
|
You will create State2 later.
|
||||||
|
|
||||||
The qml.main file should now look as follows:
|
The qml.main file should now look as follows:
|
||||||
|
|
||||||
\snippet transitions/main.qml 1
|
\quotefromfile transitions/main.qml
|
||||||
|
\skipto Window {
|
||||||
|
\printuntil State2
|
||||||
|
\printuntil }
|
||||||
|
\printuntil }
|
||||||
|
\printuntil }
|
||||||
|
|
||||||
\endlist
|
\endlist
|
||||||
|
|
||||||
@@ -280,26 +295,21 @@
|
|||||||
\section1 Adding Views
|
\section1 Adding Views
|
||||||
|
|
||||||
In the .qml file, you already created pointers to two additional states:
|
In the .qml file, you already created pointers to two additional states:
|
||||||
State1 and State2. To create the states:
|
State1 and State2. You cannot use the \QMLD to add states for a Window QML
|
||||||
|
type. Use the code editor to add the states inside a StateGroup QML type and
|
||||||
|
refer to them by using the id of the state group:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
|
||||||
\li Click the empty slot in the \gui States pane to create State1.
|
\li Bind the position of the Qt logo to the
|
||||||
|
|
||||||
\li Click the empty slot in the \gui States pane to create State2.
|
|
||||||
|
|
||||||
\li In the code editor, bind the position of the Qt logo to the
|
|
||||||
rectangle to make sure that the logo is displayed within the
|
rectangle to make sure that the logo is displayed within the
|
||||||
rectangle when the view is scaled on different sizes of screens. Set
|
rectangle when the view is scaled on different sizes of screens. Set
|
||||||
expressions for the x and y properties, as illustrated by the
|
expressions for the x and y properties, as illustrated by the
|
||||||
following code snippet:
|
following code snippet:
|
||||||
|
|
||||||
\snippet qml/states-properties.qml states
|
\quotefromfile transitions/main.qml
|
||||||
|
\skipto StateGroup {
|
||||||
\image qmldesigner-tutorial-state1.png "States"
|
\printuntil ]
|
||||||
|
|
||||||
\note When you set the expressions, drag and drop is disabled for
|
|
||||||
the icon in \QMLD.
|
|
||||||
|
|
||||||
\li Press \key {Ctrl+R} to run the application.
|
\li Press \key {Ctrl+R} to run the application.
|
||||||
|
|
||||||
@@ -309,7 +319,8 @@
|
|||||||
|
|
||||||
\section1 Adding Animation to the View
|
\section1 Adding Animation to the View
|
||||||
|
|
||||||
Add transitions to define how the properties change when the Qt logo moves
|
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,
|
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
|
the Qt logo bounces back when it moves to the middleRightRect and eases into
|
||||||
bottomLeftRect. Add the transitions in the code editor.
|
bottomLeftRect. Add the transitions in the code editor.
|
||||||
@@ -320,7 +331,9 @@
|
|||||||
moving to State1, the x and y coordinates of the Qt logo change
|
moving to State1, the x and y coordinates of the Qt logo change
|
||||||
linearly over a duration of 1 second:
|
linearly over a duration of 1 second:
|
||||||
|
|
||||||
\snippet qml/list-of-transitions.qml first transition
|
\dots
|
||||||
|
\skipto transitions
|
||||||
|
\printuntil },
|
||||||
|
|
||||||
\li You can use the Qt Quick toolbar for animation to change the easing
|
\li You can use the Qt Quick toolbar for animation to change the easing
|
||||||
curve type from linear to OutBounce:
|
curve type from linear to OutBounce:
|
||||||
@@ -343,13 +356,15 @@
|
|||||||
and y coordinates of the Qt logo change over a duration of 2
|
and y coordinates of the Qt logo change over a duration of 2
|
||||||
seconds, and an InOutQuad easing function is used:
|
seconds, and an InOutQuad easing function is used:
|
||||||
|
|
||||||
\snippet qml/list-of-transitions.qml second transition
|
\dots
|
||||||
|
\printuntil },
|
||||||
|
|
||||||
\li Add the following code to specify that for any other state changes,
|
\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
|
the x and y coordinates of the Qt logo change linearly over a
|
||||||
duration of 200 milliseconds:
|
duration of 200 milliseconds:
|
||||||
|
|
||||||
\snippet qml/list-of-transitions.qml default transition
|
\dots
|
||||||
|
\printuntil ]
|
||||||
|
|
||||||
\li Press \key {Ctrl+R} to run the application.
|
\li Press \key {Ctrl+R} to run the application.
|
||||||
|
|
||||||
@@ -361,6 +376,8 @@
|
|||||||
|
|
||||||
When you have completed the steps, the main.qml file should look as follows:
|
When you have completed the steps, the main.qml file should look as follows:
|
||||||
|
|
||||||
\snippet transitions/main.qml 2
|
\quotefromfile transitions/main.qml
|
||||||
|
\skipto Window {
|
||||||
|
\printuntil /^\}/
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -75,7 +75,7 @@
|
|||||||
|
|
||||||
\list
|
\list
|
||||||
|
|
||||||
\li Select \gui {Qt Quick Controls 1.0} or \gui {Qt Quick 2.0} to
|
\li Select \gui {Qt Quick Controls 1.1} or \gui {Qt Quick 2.2} to
|
||||||
develop for platforms that run Qt 5.
|
develop for platforms that run Qt 5.
|
||||||
|
|
||||||
\li Select \gui {Qt Quick 1.1} to develop for platforms that run
|
\li Select \gui {Qt Quick 1.1} to develop for platforms that run
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ DynamicLibrary {
|
|||||||
: ["$ORIGIN", "$ORIGIN/.."]
|
: ["$ORIGIN", "$ORIGIN/.."]
|
||||||
property string libIncludeBase: ".." // #include <lib/header.h>
|
property string libIncludeBase: ".." // #include <lib/header.h>
|
||||||
cpp.includePaths: [libIncludeBase]
|
cpp.includePaths: [libIncludeBase]
|
||||||
|
cpp.minimumWindowsVersion: "5.1"
|
||||||
|
|
||||||
Export {
|
Export {
|
||||||
Depends { name: "cpp" }
|
Depends { name: "cpp" }
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ Product {
|
|||||||
|
|
||||||
property string pluginIncludeBase: ".." // #include <plugin/header.h>
|
property string pluginIncludeBase: ".." // #include <plugin/header.h>
|
||||||
cpp.includePaths: [pluginIncludeBase]
|
cpp.includePaths: [pluginIncludeBase]
|
||||||
|
cpp.minimumWindowsVersion: "5.1"
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
name: "PluginSpec"
|
name: "PluginSpec"
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ Application {
|
|||||||
cpp.rpaths: qbs.targetOS.contains("osx")
|
cpp.rpaths: qbs.targetOS.contains("osx")
|
||||||
? ["@executable_path/../" + project.ide_library_path]
|
? ["@executable_path/../" + project.ide_library_path]
|
||||||
: ["$ORIGIN/../" + project.ide_library_path]
|
: ["$ORIGIN/../" + project.ide_library_path]
|
||||||
|
cpp.minimumWindowsVersion: "5.1"
|
||||||
|
|
||||||
Group {
|
Group {
|
||||||
fileTagsFilter: product.type
|
fileTagsFilter: product.type
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ def qdump__CPlusPlus__IntegerType(d, value):
|
|||||||
d.putPlainChildren(value)
|
d.putPlainChildren(value)
|
||||||
|
|
||||||
def qdump__CPlusPlus__NamedType(d, value):
|
def qdump__CPlusPlus__NamedType(d, value):
|
||||||
literal = downcast(value["_name"])
|
literal = d.downcast(value["_name"])
|
||||||
d.putValue(d.encodeCharArray(literal["_chars"]), Hex2EncodedLatin1)
|
d.putValue(d.encodeCharArray(literal["_chars"]), Hex2EncodedLatin1)
|
||||||
d.putPlainChildren(value)
|
d.putPlainChildren(value)
|
||||||
|
|
||||||
|
|||||||
@@ -368,6 +368,17 @@ class DumperBase:
|
|||||||
return min(size, self.stringCutOff)
|
return min(size, self.stringCutOff)
|
||||||
return min(size, limit)
|
return min(size, limit)
|
||||||
|
|
||||||
|
def vectorDataHelper(self, addr):
|
||||||
|
if self.qtVersion() >= 0x050000:
|
||||||
|
size = self.extractInt(addr + 4)
|
||||||
|
alloc = self.extractInt(addr + 8) & 0x7ffffff
|
||||||
|
data = addr + self.extractPointer(addr + 8 + self.ptrSize())
|
||||||
|
else:
|
||||||
|
alloc = self.extractInt(addr + 4)
|
||||||
|
size = self.extractInt(addr + 8)
|
||||||
|
data = addr + 16
|
||||||
|
return data, size, alloc
|
||||||
|
|
||||||
def byteArrayDataHelper(self, addr):
|
def byteArrayDataHelper(self, addr):
|
||||||
if self.qtVersion() >= 0x050000:
|
if self.qtVersion() >= 0x050000:
|
||||||
# QTypedArray:
|
# QTypedArray:
|
||||||
@@ -958,8 +969,7 @@ class DumperBase:
|
|||||||
if typeName.find('<') >= 0:
|
if typeName.find('<') >= 0:
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
staticMetaObjectName = typeName + "::staticMetaObject"
|
result = self.findStaticMetaObject(typeName)
|
||||||
result = self.findSymbol(staticMetaObjectName)
|
|
||||||
|
|
||||||
# We need to distinguish Q_OBJECT from Q_GADGET:
|
# We need to distinguish Q_OBJECT from Q_GADGET:
|
||||||
# a Q_OBJECT SMO has a non-null superdata (unless it's QObject itself),
|
# a Q_OBJECT SMO has a non-null superdata (unless it's QObject itself),
|
||||||
@@ -1001,31 +1011,49 @@ class DumperBase:
|
|||||||
self.knownStaticMetaObjects[typeName] = result
|
self.knownStaticMetaObjects[typeName] = result
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def staticQObjectPropertyNames(self, metaobject):
|
def staticQObjectMetaData(self, metaobject, offset1, offset2, step):
|
||||||
properties = []
|
items = []
|
||||||
dd = metaobject["d"]
|
dd = metaobject["d"]
|
||||||
data = self.extractPointer(dd["data"])
|
data = self.extractPointer(dd["data"])
|
||||||
sd = self.extractPointer(dd["stringdata"])
|
sd = self.extractPointer(dd["stringdata"])
|
||||||
|
|
||||||
metaObjectVersion = self.extractInt(data)
|
metaObjectVersion = self.extractInt(data)
|
||||||
propertyCount = self.extractInt(data + 24)
|
itemCount = self.extractInt(data + offset1)
|
||||||
propertyData = self.extractInt(data + 28)
|
itemData = -offset2 if offset2 < 0 else self.extractInt(data + offset2)
|
||||||
|
|
||||||
if metaObjectVersion >= 7: # Qt 5.
|
if metaObjectVersion >= 7: # Qt 5.
|
||||||
byteArrayDataType = self.lookupType(self.qtNamespace() + "QByteArrayData")
|
byteArrayDataType = self.lookupType(self.qtNamespace() + "QByteArrayData")
|
||||||
byteArrayDataSize = byteArrayDataType.sizeof
|
byteArrayDataSize = byteArrayDataType.sizeof
|
||||||
for i in range(propertyCount):
|
for i in range(itemCount):
|
||||||
x = data + (propertyData + 3 * i) * 4
|
x = data + (itemData + step * i) * 4
|
||||||
literal = sd + self.extractInt(x) * byteArrayDataSize
|
literal = sd + self.extractInt(x) * byteArrayDataSize
|
||||||
ldata, lsize, lalloc = self.byteArrayDataHelper(literal)
|
ldata, lsize, lalloc = self.byteArrayDataHelper(literal)
|
||||||
properties.append(self.extractBlob(ldata, lsize).toString())
|
items.append(self.extractBlob(ldata, lsize).toString())
|
||||||
else: # Qt 4.
|
else: # Qt 4.
|
||||||
for i in range(propertyCount):
|
for i in range(itemCount):
|
||||||
x = data + (propertyData + 3 * i) * 4
|
x = data + (itemData + step * i) * 4
|
||||||
ldata = sd + self.extractInt(x)
|
ldata = sd + self.extractInt(x)
|
||||||
properties.append(self.extractCString(ldata).decode("utf8"))
|
items.append(self.extractCString(ldata).decode("utf8"))
|
||||||
|
|
||||||
return properties
|
return items
|
||||||
|
|
||||||
|
def staticQObjectPropertyCount(self, metaobject):
|
||||||
|
return self.extractInt(self.extractPointer(metaobject["d"]["data"]) + 24)
|
||||||
|
|
||||||
|
def staticQObjectPropertyNames(self, metaobject):
|
||||||
|
return self.staticQObjectMetaData(metaobject, 24, 28, 3)
|
||||||
|
|
||||||
|
def staticQObjectMethodCount(self, metaobject):
|
||||||
|
return self.extractInt(self.extractPointer(metaobject["d"]["data"]) + 16)
|
||||||
|
|
||||||
|
def staticQObjectMethodNames(self, metaobject):
|
||||||
|
return self.staticQObjectMetaData(metaobject, 16, 20, 5)
|
||||||
|
|
||||||
|
def staticQObjectSignalCount(self, metaobject):
|
||||||
|
return self.extractInt(self.extractPointer(metaobject["d"]["data"]) + 52)
|
||||||
|
|
||||||
|
def staticQObjectSignalNames(self, metaobject):
|
||||||
|
return self.staticQObjectMetaData(metaobject, 52, -14, 5)
|
||||||
|
|
||||||
def extractCString(self, addr):
|
def extractCString(self, addr):
|
||||||
result = bytearray()
|
result = bytearray()
|
||||||
@@ -1071,6 +1099,14 @@ class DumperBase:
|
|||||||
#with SubItem(self, "[extradata]"):
|
#with SubItem(self, "[extradata]"):
|
||||||
# self.putValue("0x%x" % toInteger(extraData))
|
# self.putValue("0x%x" % toInteger(extraData))
|
||||||
|
|
||||||
|
# Parent and children.
|
||||||
|
try:
|
||||||
|
d_ptr = qobject["d_ptr"]["d"]
|
||||||
|
self.putSubItem("[parent]", d_ptr["parent"])
|
||||||
|
self.putSubItem("[children]", d_ptr["children"])
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
|
||||||
with SubItem(self, "[properties]"):
|
with SubItem(self, "[properties]"):
|
||||||
propertyCount = 0
|
propertyCount = 0
|
||||||
if self.isExpanded():
|
if self.isExpanded():
|
||||||
@@ -1096,6 +1132,68 @@ class DumperBase:
|
|||||||
self.putValue('<%s items>' % propertyCount if propertyCount else '<>0 items>')
|
self.putValue('<%s items>' % propertyCount if propertyCount else '<>0 items>')
|
||||||
self.putNumChild(1)
|
self.putNumChild(1)
|
||||||
|
|
||||||
|
with SubItem(self, "[methods]"):
|
||||||
|
methodCount = self.staticQObjectMethodCount(smo)
|
||||||
|
self.putItemCount(methodCount)
|
||||||
|
self.putNumChild(methodCount)
|
||||||
|
if self.isExpanded():
|
||||||
|
methodNames = self.staticQObjectMethodNames(smo)
|
||||||
|
with Children(self):
|
||||||
|
for i in range(methodCount):
|
||||||
|
k = methodNames[i]
|
||||||
|
with SubItem(self, k):
|
||||||
|
self.putEmptyValue()
|
||||||
|
|
||||||
|
with SubItem(self, "[signals]"):
|
||||||
|
signalCount = self.staticQObjectSignalCount(smo)
|
||||||
|
self.putItemCount(signalCount)
|
||||||
|
self.putNumChild(signalCount)
|
||||||
|
if self.isExpanded():
|
||||||
|
signalNames = self.staticQObjectSignalNames(smo)
|
||||||
|
signalCount = len(signalNames)
|
||||||
|
with Children(self):
|
||||||
|
for i in range(signalCount):
|
||||||
|
k = signalNames[i]
|
||||||
|
with SubItem(self, k):
|
||||||
|
self.putEmptyValue()
|
||||||
|
self.putQObjectConnections(qobject)
|
||||||
|
|
||||||
|
def putQObjectConnections(self, qobject):
|
||||||
|
with SubItem(self, "[connections]"):
|
||||||
|
ptrSize = self.ptrSize()
|
||||||
|
self.putNoType()
|
||||||
|
ns = self.qtNamespace()
|
||||||
|
privateTypeName = ns + "QObjectPrivate"
|
||||||
|
privateType = self.lookupType(privateTypeName)
|
||||||
|
dd = qobject["d_ptr"]["d"]
|
||||||
|
d_ptr = dd.cast(privateType.pointer()).dereference()
|
||||||
|
connections = d_ptr["connectionLists"]
|
||||||
|
if self.isNull(connections):
|
||||||
|
self.putItemCount(0)
|
||||||
|
self.putNumChild(0)
|
||||||
|
else:
|
||||||
|
connections = connections.dereference()
|
||||||
|
connections = connections.cast(self.directBaseClass(connections.type))
|
||||||
|
self.putValue('<>0 items>')
|
||||||
|
self.putNumChild(1)
|
||||||
|
if self.isExpanded():
|
||||||
|
pp = 0
|
||||||
|
with Children(self):
|
||||||
|
innerType = self.templateArgument(connections.type, 0)
|
||||||
|
# Should check: innerType == ns::QObjectPrivate::ConnectionList
|
||||||
|
base = self.extractPointer(connections)
|
||||||
|
data, size, alloc = self.vectorDataHelper(base)
|
||||||
|
connectionType = self.lookupType(ns + "QObjectPrivate::Connection")
|
||||||
|
for i in xrange(size):
|
||||||
|
first = self.extractPointer(data + i * 2 * ptrSize)
|
||||||
|
while first:
|
||||||
|
self.putSubItem("%s" % pp,
|
||||||
|
self.createPointerValue(first, connectionType))
|
||||||
|
first = self.extractPointer(first + 3 * ptrSize)
|
||||||
|
# We need to enforce some upper limit.
|
||||||
|
pp += 1
|
||||||
|
if pp > 1000:
|
||||||
|
break
|
||||||
|
|
||||||
def isKnownMovableType(self, type):
|
def isKnownMovableType(self, type):
|
||||||
if type in (
|
if type in (
|
||||||
|
|||||||
@@ -861,6 +861,9 @@ class Dumper(DumperBase):
|
|||||||
def extractByte(self, addr):
|
def extractByte(self, addr):
|
||||||
return struct.unpack("b", self.readRawMemory(addr, 1))[0]
|
return struct.unpack("b", self.readRawMemory(addr, 1))[0]
|
||||||
|
|
||||||
|
def findStaticMetaObject(self, typeName):
|
||||||
|
return self.findSymbol(typeName + "::staticMetaObject")
|
||||||
|
|
||||||
def findSymbol(self, symbolName):
|
def findSymbol(self, symbolName):
|
||||||
try:
|
try:
|
||||||
result = gdb.lookup_global_symbol(symbolName)
|
result = gdb.lookup_global_symbol(symbolName)
|
||||||
|
|||||||
@@ -417,8 +417,16 @@ class Dumper(DumperBase):
|
|||||||
return self.lookupType(inner)
|
return self.lookupType(inner)
|
||||||
|
|
||||||
def numericTemplateArgument(self, typeobj, index):
|
def numericTemplateArgument(self, typeobj, index):
|
||||||
|
# There seems no API to extract the numeric value.
|
||||||
inner = self.extractTemplateArgument(typeobj.GetName(), index)
|
inner = self.extractTemplateArgument(typeobj.GetName(), index)
|
||||||
return int(inner)
|
innerType = typeobj.GetTemplateArgumentType(index)
|
||||||
|
basicType = innerType.GetBasicType()
|
||||||
|
value = toInteger(inner)
|
||||||
|
# Clang writes 'int' and '0xfffffff' into the debug info
|
||||||
|
# LLDB manages to read a value of 0xfffffff...
|
||||||
|
if basicType == lldb.eBasicTypeInt and value >= 0x8000000:
|
||||||
|
value -= 0x100000000
|
||||||
|
return value
|
||||||
|
|
||||||
def isReferenceType(self, typeobj):
|
def isReferenceType(self, typeobj):
|
||||||
return typeobj.IsReferenceType()
|
return typeobj.IsReferenceType()
|
||||||
@@ -883,6 +891,13 @@ class Dumper(DumperBase):
|
|||||||
buf[i] = data.GetUnsignedInt8(error, i)
|
buf[i] = data.GetUnsignedInt8(error, i)
|
||||||
return Blob(bytes(buf))
|
return Blob(bytes(buf))
|
||||||
|
|
||||||
|
def mangleName(self, typeName):
|
||||||
|
return '_ZN%sE' % ''.join(map(lambda x: "%d%s" % (len(x), x), typeName.split('::')))
|
||||||
|
|
||||||
|
def findStaticMetaObject(self, typeName):
|
||||||
|
symbolName = self.mangleName(typeName + '::staticMetaObject')
|
||||||
|
return self.target.FindFirstGlobalVariable(symbolName)
|
||||||
|
|
||||||
def findSymbol(self, symbolName):
|
def findSymbol(self, symbolName):
|
||||||
return self.target.FindFirstGlobalVariable(symbolName)
|
return self.target.FindFirstGlobalVariable(symbolName)
|
||||||
|
|
||||||
@@ -1169,7 +1184,6 @@ class Dumper(DumperBase):
|
|||||||
else:
|
else:
|
||||||
state = self.process.GetState()
|
state = self.process.GetState()
|
||||||
if state == lldb.eStateStopped:
|
if state == lldb.eStateStopped:
|
||||||
self.reportStack()
|
|
||||||
self.reportStackPosition()
|
self.reportStackPosition()
|
||||||
self.reportThreads()
|
self.reportThreads()
|
||||||
self.reportVariables()
|
self.reportVariables()
|
||||||
@@ -1259,7 +1273,6 @@ class Dumper(DumperBase):
|
|||||||
stoppedThread = self.firstStoppedThread()
|
stoppedThread = self.firstStoppedThread()
|
||||||
if stoppedThread:
|
if stoppedThread:
|
||||||
self.process.SetSelectedThread(stoppedThread)
|
self.process.SetSelectedThread(stoppedThread)
|
||||||
self.reportStack({'stacklimit': 20})
|
|
||||||
self.reportStackTop()
|
self.reportStackTop()
|
||||||
self.reportThreads()
|
self.reportThreads()
|
||||||
self.reportLocation()
|
self.reportLocation()
|
||||||
|
|||||||
@@ -148,17 +148,21 @@ def qdump____m512i(d, value):
|
|||||||
# return "Transposed"
|
# return "Transposed"
|
||||||
|
|
||||||
def qdump__Eigen__Matrix(d, value):
|
def qdump__Eigen__Matrix(d, value):
|
||||||
innerType = d.templateArgument(value.type, 0)
|
listType = d.directBaseClass(value.type)
|
||||||
storage = value["m_storage"]
|
d.putItem(value.cast(listType))
|
||||||
options = d.numericTemplateArgument(value.type, 3)
|
d.putBetterType(value.type)
|
||||||
|
|
||||||
|
def qdump__Eigen__PlainObjectBase(d, value):
|
||||||
|
matrixType = d.templateArgument(value.type, 0)
|
||||||
|
innerType = d.templateArgument(matrixType, 0)
|
||||||
|
options = d.numericTemplateArgument(matrixType, 3)
|
||||||
rowMajor = (int(options) & 0x1)
|
rowMajor = (int(options) & 0x1)
|
||||||
argRow = d.numericTemplateArgument(value.type, 1)
|
argRow = d.numericTemplateArgument(matrixType, 1)
|
||||||
argCol = d.numericTemplateArgument(value.type, 2)
|
argCol = d.numericTemplateArgument(matrixType, 2)
|
||||||
nrows = value["m_storage"]["m_rows"] if argRow == -1 else int(argRow)
|
storage = value["m_storage"]
|
||||||
ncols = value["m_storage"]["m_cols"] if argCol == -1 else int(argCol)
|
nrows = toInteger(storage["m_rows"] if argRow == -1 else argRow)
|
||||||
p = storage["m_data"]
|
ncols = toInteger(storage["m_cols"] if argCol == -1 else argCol)
|
||||||
if d.isStructType(p.type): # Static
|
p = d.createPointerValue(d.addressOf(value), innerType)
|
||||||
p = p["array"].cast(innerType.pointer())
|
|
||||||
d.putValue("(%s x %s), %s" % (nrows, ncols, ["ColumnMajor", "RowMajor"][rowMajor]))
|
d.putValue("(%s x %s), %s" % (nrows, ncols, ["ColumnMajor", "RowMajor"][rowMajor]))
|
||||||
d.putField("keeporder", "1")
|
d.putField("keeporder", "1")
|
||||||
d.putNumChild(nrows * ncols)
|
d.putNumChild(nrows * ncols)
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ def qdump__QBasicAtomicInt(d, value):
|
|||||||
def qdump__QAtomicPointer(d, value):
|
def qdump__QAtomicPointer(d, value):
|
||||||
d.putType(value.type)
|
d.putType(value.type)
|
||||||
q = value["_q_value"]
|
q = value["_q_value"]
|
||||||
p = int(q)
|
p = toInteger(q)
|
||||||
d.putValue("@0x%x" % p)
|
d.putValue("@0x%x" % p)
|
||||||
d.putNumChild(1 if p else 0)
|
d.putNumChild(1 if p else 0)
|
||||||
if d.isExpanded():
|
if d.isExpanded():
|
||||||
@@ -940,8 +940,9 @@ def qdump__QMapNode(d, value):
|
|||||||
|
|
||||||
|
|
||||||
def qdumpHelper__Qt4_QMap(d, value):
|
def qdumpHelper__Qt4_QMap(d, value):
|
||||||
d_ptr = value["d"].dereference()
|
anon = d.childAt(value, 0)
|
||||||
e_ptr = value["e"].dereference()
|
d_ptr = anon["d"].dereference()
|
||||||
|
e_ptr = anon["e"].dereference()
|
||||||
n = int(d_ptr["size"])
|
n = int(d_ptr["size"])
|
||||||
d.check(0 <= n and n <= 100*1000*1000)
|
d.check(0 <= n and n <= 100*1000*1000)
|
||||||
d.checkRef(d_ptr["ref"])
|
d.checkRef(d_ptr["ref"])
|
||||||
@@ -1328,45 +1329,6 @@ def _qdump__QObject(d, value):
|
|||||||
d.putItemCount(pp)
|
d.putItemCount(pp)
|
||||||
|
|
||||||
|
|
||||||
# Signals.
|
|
||||||
signalCount = int(metaData[13])
|
|
||||||
with SubItem(d, "signals"):
|
|
||||||
d.putItemCount(signalCount)
|
|
||||||
d.putNoType()
|
|
||||||
d.putNumChild(signalCount)
|
|
||||||
if signalCount:
|
|
||||||
# FIXME: empty type does not work for childtype
|
|
||||||
#d.putField("childtype", ".")
|
|
||||||
d.putField("childnumchild", "0")
|
|
||||||
if d.isExpanded():
|
|
||||||
with Children(d):
|
|
||||||
for signal in xrange(signalCount):
|
|
||||||
with SubItem(d, signal):
|
|
||||||
offset = metaData[14 + 5 * signal]
|
|
||||||
d.putName("signal %d" % signal)
|
|
||||||
d.putNoType()
|
|
||||||
d.putValue(extractCString(metaStringData, offset))
|
|
||||||
d.putNumChild(0) # FIXME: List the connections here.
|
|
||||||
|
|
||||||
# Slots.
|
|
||||||
with SubItem(d, "slots"):
|
|
||||||
slotCount = int(metaData[4]) - signalCount
|
|
||||||
d.putItemCount(slotCount)
|
|
||||||
d.putNoType()
|
|
||||||
d.putNumChild(slotCount)
|
|
||||||
if slotCount:
|
|
||||||
#d.putField("childtype", ".")
|
|
||||||
d.putField("childnumchild", "0")
|
|
||||||
if d.isExpanded():
|
|
||||||
with Children(d):
|
|
||||||
for slot in xrange(slotCount):
|
|
||||||
with SubItem(d, slot):
|
|
||||||
offset = metaData[14 + 5 * (signalCount + slot)]
|
|
||||||
d.putName("slot %d" % slot)
|
|
||||||
d.putNoType()
|
|
||||||
d.putValue(extractCString(metaStringData, offset))
|
|
||||||
d.putNumChild(0) # FIXME: List the connections here.
|
|
||||||
|
|
||||||
# Active connection.
|
# Active connection.
|
||||||
with SubItem(d, "currentSender"):
|
with SubItem(d, "currentSender"):
|
||||||
d.putNoType()
|
d.putNoType()
|
||||||
@@ -2206,25 +2168,11 @@ def qform__QVector():
|
|||||||
|
|
||||||
|
|
||||||
def qdump__QVector(d, value):
|
def qdump__QVector(d, value):
|
||||||
innerType = d.templateArgument(value.type, 0)
|
data, size, alloc = d.vectorDataHelper(d.extractPointer(value))
|
||||||
if d.qtVersion() >= 0x050000:
|
|
||||||
private = value["d"]
|
|
||||||
d.checkRef(private["ref"])
|
|
||||||
alloc = int(private["alloc"])
|
|
||||||
size = int(private["size"])
|
|
||||||
offset = int(private["offset"])
|
|
||||||
data = d.pointerValue(private) + offset
|
|
||||||
else:
|
|
||||||
anon = d.childAt(value, 0)
|
|
||||||
private = anon["d"]
|
|
||||||
d.checkRef(private["ref"])
|
|
||||||
alloc = int(private["alloc"])
|
|
||||||
size = int(private["size"])
|
|
||||||
data = d.addressOf(anon["p"]["array"])
|
|
||||||
|
|
||||||
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000)
|
d.check(0 <= size and size <= alloc and alloc <= 1000 * 1000 * 1000)
|
||||||
d.putItemCount(size)
|
d.putItemCount(size)
|
||||||
d.putNumChild(size)
|
d.putNumChild(size)
|
||||||
|
innerType = d.templateArgument(value.type, 0)
|
||||||
d.putPlotData(innerType, data, size)
|
d.putPlotData(innerType, data, size)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -68,14 +68,6 @@ Controls.ComboBox {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onFocusChanged: {
|
|
||||||
if (focus) {
|
|
||||||
transaction.start();
|
|
||||||
} else {
|
|
||||||
transaction.end();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
style: CustomComboBoxStyle {
|
style: CustomComboBoxStyle {
|
||||||
textColor: comboBox.textColor
|
textColor: comboBox.textColor
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,9 @@ Controls.ComboBox {
|
|||||||
id: comboBox
|
id: comboBox
|
||||||
|
|
||||||
property variant backendValue
|
property variant backendValue
|
||||||
property color textColor: "white"
|
property color textColor: colorLogic.textColor
|
||||||
|
|
||||||
|
onTextColorChanged: setColor()
|
||||||
|
|
||||||
editable: true
|
editable: true
|
||||||
model: ["Arial", "Times New Roman", "Courier", "Verdana", "Tahoma"]
|
model: ["Arial", "Times New Roman", "Courier", "Verdana", "Tahoma"]
|
||||||
@@ -60,9 +62,13 @@ Controls.ComboBox {
|
|||||||
textColor: comboBox.textColor
|
textColor: comboBox.textColor
|
||||||
}
|
}
|
||||||
|
|
||||||
property string textValue: backendValue.value
|
ColorLogic {
|
||||||
onTextValueChanged: {
|
id: colorLogic
|
||||||
comboBox.editText = textValue
|
backendValue: comboBox.backendValue
|
||||||
|
property string textValue: backendValue.value
|
||||||
|
onTextValueChanged: {
|
||||||
|
comboBox.editText = textValue
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
@@ -85,7 +91,6 @@ Controls.ComboBox {
|
|||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
//Hack to style the text input
|
//Hack to style the text input
|
||||||
for (var i = 0; i < comboBox.children.length; i++) {
|
for (var i = 0; i < comboBox.children.length; i++) {
|
||||||
print(comboBox.children[i])
|
|
||||||
if (comboBox.children[i].text !== undefined) {
|
if (comboBox.children[i].text !== undefined) {
|
||||||
comboBox.children[i].color = comboBox.textColor
|
comboBox.children[i].color = comboBox.textColor
|
||||||
comboBox.children[i].anchors.rightMargin = 34
|
comboBox.children[i].anchors.rightMargin = 34
|
||||||
@@ -93,5 +98,13 @@ Controls.ComboBox {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function setColor() {
|
||||||
|
//Hack to style the text input
|
||||||
|
for (var i = 0; i < comboBox.children.length; i++) {
|
||||||
|
if (comboBox.children[i].text !== undefined) {
|
||||||
|
comboBox.children[i].color = comboBox.textColor
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,4 +6,6 @@ SpinBox {
|
|||||||
maximumValue: 9999999
|
maximumValue: 9999999
|
||||||
minimumValue: -9999999
|
minimumValue: -9999999
|
||||||
backendValue: backendValues.%2
|
backendValue: backendValues.%2
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.maximumWidth: 100
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,5 +3,10 @@ Label {
|
|||||||
toolTip: "%1"
|
toolTip: "%1"
|
||||||
}
|
}
|
||||||
SpinBox {
|
SpinBox {
|
||||||
|
maximumValue: 9999999
|
||||||
|
minimumValue: -9999999
|
||||||
|
decimals: 2
|
||||||
backendValue: backendValues.%2
|
backendValue: backendValues.%2
|
||||||
}
|
Layout.fillWidth: true
|
||||||
|
Layout.maximumWidth: 100
|
||||||
|
}
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ Section {
|
|||||||
SpinBox {
|
SpinBox {
|
||||||
backendValue: backendValues.width
|
backendValue: backendValues.width
|
||||||
maximumValue: 0xffff
|
maximumValue: 0xffff
|
||||||
minimumValue: -0xffff
|
minimumValue: 0
|
||||||
decimals: 0
|
decimals: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -119,7 +119,7 @@ Section {
|
|||||||
SpinBox {
|
SpinBox {
|
||||||
backendValue: backendValues.height
|
backendValue: backendValues.height
|
||||||
maximumValue: 0xffff
|
maximumValue: 0xffff
|
||||||
minimumValue: -0xffff
|
minimumValue: 0
|
||||||
decimals: 0
|
decimals: 0
|
||||||
}
|
}
|
||||||
ExpandingSpacer {
|
ExpandingSpacer {
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ int main(int argc, char *argv[])
|
|||||||
QtQuick1ApplicationViewer viewer;
|
QtQuick1ApplicationViewer viewer;
|
||||||
viewer.addImportPath(QLatin1String("modules")); // ADDIMPORTPATH
|
viewer.addImportPath(QLatin1String("modules")); // ADDIMPORTPATH
|
||||||
viewer.setOrientation(QtQuick1ApplicationViewer::ScreenOrientationAuto); // ORIENTATION
|
viewer.setOrientation(QtQuick1ApplicationViewer::ScreenOrientationAuto); // ORIENTATION
|
||||||
viewer.setMainQmlFile(QLatin1String("qrc:///qml/main.qml")); // MAINQML
|
viewer.setMainQmlFile(QLatin1String("qrc:///main.qml")); // MAINQML
|
||||||
viewer.showExpanded();
|
viewer.showExpanded();
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>qml/main.qml</file>
|
<file>main.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ int main(int argc, char *argv[])
|
|||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>qml/main.qml</file>
|
<file>main.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ int main(int argc, char *argv[])
|
|||||||
QGuiApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>qml/main.qml</file>
|
<file>main.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ int main(int argc, char *argv[])
|
|||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>qml/main.qml</file>
|
<file>main.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ int main(int argc, char *argv[])
|
|||||||
QApplication app(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
|
||||||
QQmlApplicationEngine engine;
|
QQmlApplicationEngine engine;
|
||||||
engine.load(QUrl(QStringLiteral("qrc:///qml/main.qml")));
|
engine.load(QUrl(QStringLiteral("qrc:///main.qml")));
|
||||||
|
|
||||||
return app.exec();
|
return app.exec();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<RCC>
|
<RCC>
|
||||||
<qresource prefix="/">
|
<qresource prefix="/">
|
||||||
<file>qml/main.qml</file>
|
<file>main.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -14,7 +14,11 @@ android-no-sdk {
|
|||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
} else:unix {
|
} else:unix {
|
||||||
isEmpty(target.path) {
|
isEmpty(target.path) {
|
||||||
target.path = /opt/$${TARGET}/bin
|
qnx {
|
||||||
|
target.path = /tmp/$${TARGET}/bin
|
||||||
|
} else {
|
||||||
|
target.path = /opt/$${TARGET}/bin
|
||||||
|
}
|
||||||
export(target.path)
|
export(target.path)
|
||||||
}
|
}
|
||||||
INSTALLS += target
|
INSTALLS += target
|
||||||
|
|||||||
@@ -56,13 +56,8 @@ Rectangle {
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.leftMargin: 18
|
anchors.leftMargin: 18
|
||||||
|
|
||||||
text: examplesModel.readSearchStringsFromSettings()
|
|
||||||
|
|
||||||
placeholderText: qsTr("Search in Examples...")
|
placeholderText: qsTr("Search in Examples...")
|
||||||
onTextChanged: {
|
onTextChanged: examplesModel.parseSearchString(text)
|
||||||
examplesModel.parseSearchString(text);
|
|
||||||
examplesModel.writeSearchStringToSettings(text);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ComboBox {
|
ComboBox {
|
||||||
|
|||||||
@@ -1257,7 +1257,6 @@ void ClassOrNamespace::NestedClassInstantiator::instantiate(ClassOrNamespace *en
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
nestedClassOrNamespaceInstantiation->_parent = enclosingTemplateClassInstantiation;
|
|
||||||
instantiate(nestedClassOrNamespace, nestedClassOrNamespaceInstantiation);
|
instantiate(nestedClassOrNamespace, nestedClassOrNamespaceInstantiation);
|
||||||
|
|
||||||
enclosingTemplateClassInstantiation->_classOrNamespaces[nestedName] =
|
enclosingTemplateClassInstantiation->_classOrNamespaces[nestedName] =
|
||||||
|
|||||||
@@ -165,6 +165,7 @@ DWORD WINAPI processWatcherThread(LPVOID lpParameter)
|
|||||||
DWORD dwExitCode;
|
DWORD dwExitCode;
|
||||||
if (!GetExitCodeProcess(hProcess, &dwExitCode))
|
if (!GetExitCodeProcess(hProcess, &dwExitCode))
|
||||||
dwExitCode = -1;
|
dwExitCode = -1;
|
||||||
|
CloseHandle(hProcess);
|
||||||
PostMessage(hwndMain, WM_DESTROY, dwExitCode, 0);
|
PostMessage(hwndMain, WM_DESTROY, dwExitCode, 0);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -185,6 +186,7 @@ bool startProcess(wchar_t *pCommandLine)
|
|||||||
fwprintf(stderr, L"qtcreator_ctrlc_stub: Command line failed: %s\n", pCommandLine);
|
fwprintf(stderr, L"qtcreator_ctrlc_stub: Command line failed: %s\n", pCommandLine);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
CloseHandle(pi.hThread);
|
||||||
|
|
||||||
HANDLE hThread = CreateThread(NULL, 0, processWatcherThread, reinterpret_cast<void*>(pi.hProcess), 0, NULL);
|
HANDLE hThread = CreateThread(NULL, 0, processWatcherThread, reinterpret_cast<void*>(pi.hProcess), 0, NULL);
|
||||||
if (!hThread) {
|
if (!hThread) {
|
||||||
|
|||||||
@@ -11,7 +11,8 @@ QtcLibrary {
|
|||||||
cpp.dynamicLibraries: [
|
cpp.dynamicLibraries: [
|
||||||
"user32",
|
"user32",
|
||||||
"iphlpapi",
|
"iphlpapi",
|
||||||
"ws2_32"
|
"ws2_32",
|
||||||
|
"shell32",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
Properties {
|
Properties {
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ defineReplace(findLLVMConfig) {
|
|||||||
|
|
||||||
# Prefer llvm-config* from LLVM_INSTALL_DIR
|
# Prefer llvm-config* from LLVM_INSTALL_DIR
|
||||||
!isEmpty(LLVM_INSTALL_DIR) {
|
!isEmpty(LLVM_INSTALL_DIR) {
|
||||||
for (variant, LLVM_CONFIG_VARIANTS) {
|
for(variant, LLVM_CONFIG_VARIANTS) {
|
||||||
variant=$$LLVM_INSTALL_DIR/bin/$$variant
|
variant=$$LLVM_INSTALL_DIR/bin/$$variant
|
||||||
exists($$variant) {
|
exists($$variant) {
|
||||||
return($$variant)
|
return($$variant)
|
||||||
@@ -23,12 +23,12 @@ defineReplace(findLLVMConfig) {
|
|||||||
# Find llvm-config* in PATH
|
# Find llvm-config* in PATH
|
||||||
ENV_PATH = $$(PATH)
|
ENV_PATH = $$(PATH)
|
||||||
win32 {
|
win32 {
|
||||||
ENV_PATH = $$split($$ENV_PATH, ;)
|
ENV_PATH = $$split(ENV_PATH, ;)
|
||||||
} else {
|
} else {
|
||||||
ENV_PATH = $$split($$ENV_PATH, :)
|
ENV_PATH = $$split(ENV_PATH, :)
|
||||||
}
|
}
|
||||||
for (variant, LLVM_CONFIG_VARIANTS) {
|
for(variant, LLVM_CONFIG_VARIANTS) {
|
||||||
for (path, ENV_PATH) {
|
for(path, ENV_PATH) {
|
||||||
subvariant = $$path/$$variant
|
subvariant = $$path/$$variant
|
||||||
exists($$subvariant) {
|
exists($$subvariant) {
|
||||||
return($$subvariant)
|
return($$subvariant)
|
||||||
@@ -65,7 +65,7 @@ unix {
|
|||||||
|
|
||||||
LLVM_VERSION = $$system($$LLVM_CONFIG --version)
|
LLVM_VERSION = $$system($$LLVM_CONFIG --version)
|
||||||
LLVM_VERSION = $$replace(LLVM_VERSION, ^(\\d+\\.\\d+).*$, \\1)
|
LLVM_VERSION = $$replace(LLVM_VERSION, ^(\\d+\\.\\d+).*$, \\1)
|
||||||
message("... version $$LLVM_VERSION");
|
message("... version $$LLVM_VERSION")
|
||||||
|
|
||||||
LLVM_INCLUDEPATH = $$system($$LLVM_CONFIG --includedir)
|
LLVM_INCLUDEPATH = $$system($$LLVM_CONFIG --includedir)
|
||||||
isEmpty(LLVM_INCLUDEPATH):LLVM_INCLUDEPATH=$$LLVM_INSTALL_DIR/include
|
isEmpty(LLVM_INCLUDEPATH):LLVM_INCLUDEPATH=$$LLVM_INSTALL_DIR/include
|
||||||
|
|||||||
@@ -903,6 +903,17 @@ void CppEditorPlugin::test_FollowSymbolUnderCursor_data()
|
|||||||
" void foo();\n"
|
" void foo();\n"
|
||||||
"};\n"
|
"};\n"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
QTest::newRow("infiniteLoopLocalTypedef_QTCREATORBUG-11999") << _(
|
||||||
|
"template<class MyTree>\n"
|
||||||
|
"class TreeConstIterator\n"
|
||||||
|
"{\n"
|
||||||
|
" typedef TreeConstIterator<MyTree> MyIter;\n"
|
||||||
|
" void f() { return this->@$g(); }\n"
|
||||||
|
"};\n"
|
||||||
|
"\n"
|
||||||
|
"void h() { typedef TreeConstIterator<MyBase> const_iterator; }\n"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppEditorPlugin::test_FollowSymbolUnderCursor()
|
void CppEditorPlugin::test_FollowSymbolUnderCursor()
|
||||||
|
|||||||
@@ -306,6 +306,8 @@ void CppToolsPlugin::test_completion()
|
|||||||
expectedCompletions.sort();
|
expectedCompletions.sort();
|
||||||
|
|
||||||
QEXPECT_FAIL("enum_in_function_in_struct_in_function", "doesn't work", Abort);
|
QEXPECT_FAIL("enum_in_function_in_struct_in_function", "doesn't work", Abort);
|
||||||
|
QEXPECT_FAIL("nested_class_in_template_class_QTCREATORBUG-11752",
|
||||||
|
"related to infiniteLoopLocalTypedef_QTCREATORBUG-11999", Abort);
|
||||||
QCOMPARE(actualCompletions, expectedCompletions);
|
QCOMPARE(actualCompletions, expectedCompletions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -427,7 +427,10 @@ TextEditor::IAssistInterface *InternalCompletionAssistProvider::createAssistInte
|
|||||||
Q_UNUSED(project);
|
Q_UNUSED(project);
|
||||||
QTC_ASSERT(editor, return 0);
|
QTC_ASSERT(editor, return 0);
|
||||||
QTC_ASSERT(document, return 0);
|
QTC_ASSERT(document, return 0);
|
||||||
return new CppTools::Internal::CppCompletionAssistInterface(editor, document, position, reason);
|
|
||||||
|
CppModelManagerInterface *modelManager = CppModelManagerInterface::instance();
|
||||||
|
return new CppTools::Internal::CppCompletionAssistInterface(editor, document, position, reason,
|
||||||
|
modelManager->workingCopy());
|
||||||
}
|
}
|
||||||
|
|
||||||
// -----------------
|
// -----------------
|
||||||
@@ -1954,7 +1957,7 @@ void CppCompletionAssistInterface::getCppSpecifics() const
|
|||||||
CppModelManagerInterface *modelManager = CppModelManagerInterface::instance();
|
CppModelManagerInterface *modelManager = CppModelManagerInterface::instance();
|
||||||
if (CppEditorSupport *supp = modelManager->cppEditorSupport(m_editor)) {
|
if (CppEditorSupport *supp = modelManager->cppEditorSupport(m_editor)) {
|
||||||
if (QSharedPointer<SnapshotUpdater> updater = supp->snapshotUpdater()) {
|
if (QSharedPointer<SnapshotUpdater> updater = supp->snapshotUpdater()) {
|
||||||
updater->update(modelManager->workingCopy());
|
updater->update(m_workingCopy);
|
||||||
m_snapshot = updater->snapshot();
|
m_snapshot = updater->snapshot();
|
||||||
m_includePaths = updater->includePaths();
|
m_includePaths = updater->includePaths();
|
||||||
m_frameworkPaths = updater->frameworkPaths();
|
m_frameworkPaths = updater->frameworkPaths();
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
#define CPPCOMPLETIONASSIST_H
|
#define CPPCOMPLETIONASSIST_H
|
||||||
|
|
||||||
#include "cppcompletionassistprovider.h"
|
#include "cppcompletionassistprovider.h"
|
||||||
|
#include "cppmodelmanagerinterface.h"
|
||||||
|
|
||||||
#include <cplusplus/Icons.h>
|
#include <cplusplus/Icons.h>
|
||||||
#include <cplusplus/TypeOfExpression.h>
|
#include <cplusplus/TypeOfExpression.h>
|
||||||
@@ -175,11 +176,13 @@ public:
|
|||||||
CppCompletionAssistInterface(TextEditor::BaseTextEditor *editor,
|
CppCompletionAssistInterface(TextEditor::BaseTextEditor *editor,
|
||||||
QTextDocument *textDocument,
|
QTextDocument *textDocument,
|
||||||
int position,
|
int position,
|
||||||
TextEditor::AssistReason reason)
|
TextEditor::AssistReason reason,
|
||||||
|
const CppModelManagerInterface::WorkingCopy &workingCopy)
|
||||||
: TextEditor::DefaultAssistInterface(textDocument, position, editor->document()->filePath(),
|
: TextEditor::DefaultAssistInterface(textDocument, position, editor->document()->filePath(),
|
||||||
reason)
|
reason)
|
||||||
, m_editor(editor)
|
, m_editor(editor)
|
||||||
, m_gotCppSpecifics(false)
|
, m_gotCppSpecifics(false)
|
||||||
|
, m_workingCopy(workingCopy)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
CppCompletionAssistInterface(QTextDocument *textDocument,
|
CppCompletionAssistInterface(QTextDocument *textDocument,
|
||||||
@@ -206,6 +209,7 @@ private:
|
|||||||
|
|
||||||
TextEditor::BaseTextEditor *m_editor;
|
TextEditor::BaseTextEditor *m_editor;
|
||||||
mutable bool m_gotCppSpecifics;
|
mutable bool m_gotCppSpecifics;
|
||||||
|
CppModelManagerInterface::WorkingCopy m_workingCopy;
|
||||||
mutable CPlusPlus::Snapshot m_snapshot;
|
mutable CPlusPlus::Snapshot m_snapshot;
|
||||||
mutable QStringList m_includePaths;
|
mutable QStringList m_includePaths;
|
||||||
mutable QStringList m_frameworkPaths;
|
mutable QStringList m_frameworkPaths;
|
||||||
|
|||||||
@@ -261,10 +261,10 @@ CppCompletionAssistProvider *CppEditorSupport::completionAssistProvider() const
|
|||||||
|
|
||||||
QSharedPointer<SnapshotUpdater> CppEditorSupport::snapshotUpdater()
|
QSharedPointer<SnapshotUpdater> CppEditorSupport::snapshotUpdater()
|
||||||
{
|
{
|
||||||
QSharedPointer<SnapshotUpdater> updater = m_snapshotUpdater;
|
QSharedPointer<SnapshotUpdater> updater = snapshotUpdater_internal();
|
||||||
if (!updater || updater->fileInEditor() != fileName()) {
|
if (!updater || updater->fileInEditor() != fileName()) {
|
||||||
updater = QSharedPointer<SnapshotUpdater>(new SnapshotUpdater(fileName()));
|
updater = QSharedPointer<SnapshotUpdater>(new SnapshotUpdater(fileName()));
|
||||||
m_snapshotUpdater = updater;
|
setSnapshotUpdater_internal(updater);
|
||||||
|
|
||||||
QSharedPointer<CppCodeModelSettings> cms = CppToolsPlugin::instance()->codeModelSettings();
|
QSharedPointer<CppCodeModelSettings> cms = CppToolsPlugin::instance()->codeModelSettings();
|
||||||
updater->setUsePrecompiledHeaders(cms->pchUsage() != CppCodeModelSettings::PchUse_None);
|
updater->setUsePrecompiledHeaders(cms->pchUsage() != CppCodeModelSettings::PchUse_None);
|
||||||
@@ -282,7 +282,8 @@ void CppEditorSupport::updateDocument()
|
|||||||
m_updateDocumentTimer->start(m_updateDocumentInterval);
|
m_updateDocumentTimer->start(m_updateDocumentInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void parse(QFutureInterface<void> &future, QSharedPointer<SnapshotUpdater> updater)
|
static void parse(QFutureInterface<void> &future, QSharedPointer<SnapshotUpdater> updater,
|
||||||
|
CppModelManagerInterface::WorkingCopy workingCopy)
|
||||||
{
|
{
|
||||||
future.setProgressRange(0, 1);
|
future.setProgressRange(0, 1);
|
||||||
if (future.isCanceled()) {
|
if (future.isCanceled()) {
|
||||||
@@ -291,7 +292,7 @@ static void parse(QFutureInterface<void> &future, QSharedPointer<SnapshotUpdater
|
|||||||
}
|
}
|
||||||
|
|
||||||
CppModelManager *cmm = qobject_cast<CppModelManager *>(CppModelManager::instance());
|
CppModelManager *cmm = qobject_cast<CppModelManager *>(CppModelManager::instance());
|
||||||
updater->update(cmm->workingCopy());
|
updater->update(workingCopy);
|
||||||
cmm->finishedRefreshingSourceFiles(QStringList(updater->fileInEditor()));
|
cmm->finishedRefreshingSourceFiles(QStringList(updater->fileInEditor()));
|
||||||
|
|
||||||
future.setProgressValue(1);
|
future.setProgressValue(1);
|
||||||
@@ -310,7 +311,8 @@ void CppEditorSupport::updateDocumentNow()
|
|||||||
if (m_highlightingSupport && !m_highlightingSupport->requiresSemanticInfo())
|
if (m_highlightingSupport && !m_highlightingSupport->requiresSemanticInfo())
|
||||||
startHighlighting();
|
startHighlighting();
|
||||||
|
|
||||||
m_documentParser = QtConcurrent::run(&parse, snapshotUpdater());
|
m_documentParser = QtConcurrent::run(&parse, snapshotUpdater(),
|
||||||
|
CppModelManager::instance()->workingCopy());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -518,15 +520,8 @@ SemanticInfo::Source CppEditorSupport::currentSource(bool force)
|
|||||||
int line = 0, column = 0;
|
int line = 0, column = 0;
|
||||||
m_textEditor->convertPosition(m_textEditor->editorWidget()->position(), &line, &column);
|
m_textEditor->convertPosition(m_textEditor->editorWidget()->position(), &line, &column);
|
||||||
|
|
||||||
const Snapshot snapshot = snapshotUpdater()->snapshot();
|
return SemanticInfo::Source(Snapshot(), fileName(), contents(), line, column, editorRevision(),
|
||||||
|
force);
|
||||||
QByteArray code;
|
|
||||||
if (force || m_lastSemanticInfo.revision != editorRevision())
|
|
||||||
code = contents(); // get the source code only when needed.
|
|
||||||
|
|
||||||
const unsigned revision = editorRevision();
|
|
||||||
SemanticInfo::Source source(snapshot, fileName(), code, line, column, revision, force);
|
|
||||||
return source;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &source,
|
void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &source,
|
||||||
@@ -541,6 +536,7 @@ void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &so
|
|||||||
semanticInfo.forced = source.force;
|
semanticInfo.forced = source.force;
|
||||||
|
|
||||||
if (!source.force
|
if (!source.force
|
||||||
|
&& m_lastSemanticInfo.complete
|
||||||
&& m_lastSemanticInfo.revision == source.revision
|
&& m_lastSemanticInfo.revision == source.revision
|
||||||
&& m_lastSemanticInfo.doc
|
&& m_lastSemanticInfo.doc
|
||||||
&& m_lastSemanticInfo.doc->translationUnit()->ast()
|
&& m_lastSemanticInfo.doc->translationUnit()->ast()
|
||||||
@@ -551,9 +547,13 @@ void CppEditorSupport::recalculateSemanticInfoNow(const SemanticInfo::Source &so
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (semanticInfo.doc.isNull()) {
|
if (semanticInfo.doc.isNull()) {
|
||||||
semanticInfo.snapshot = source.snapshot;
|
const QSharedPointer<SnapshotUpdater> snapshotUpdater = snapshotUpdater_internal();
|
||||||
if (source.snapshot.contains(source.fileName)) {
|
QTC_ASSERT(snapshotUpdater, return);
|
||||||
Document::Ptr doc = source.snapshot.preprocessedDocument(source.code, source.fileName);
|
semanticInfo.snapshot = snapshotUpdater->snapshot();
|
||||||
|
|
||||||
|
if (semanticInfo.snapshot.contains(source.fileName)) {
|
||||||
|
Document::Ptr doc = semanticInfo.snapshot.preprocessedDocument(source.code,
|
||||||
|
source.fileName);
|
||||||
if (processor)
|
if (processor)
|
||||||
doc->control()->setTopLevelDeclarationProcessor(processor);
|
doc->control()->setTopLevelDeclarationProcessor(processor);
|
||||||
doc->check();
|
doc->check();
|
||||||
@@ -592,6 +592,18 @@ void CppEditorSupport::recalculateSemanticInfoDetached_helper(QFutureInterface<v
|
|||||||
recalculateSemanticInfoNow(source, true, &processor);
|
recalculateSemanticInfoNow(source, true, &processor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSharedPointer<SnapshotUpdater> CppEditorSupport::snapshotUpdater_internal() const
|
||||||
|
{
|
||||||
|
QMutexLocker locker(&m_snapshotUpdaterLock);
|
||||||
|
return m_snapshotUpdater;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CppEditorSupport::setSnapshotUpdater_internal(const QSharedPointer<SnapshotUpdater> &updater)
|
||||||
|
{
|
||||||
|
QMutexLocker locker(&m_snapshotUpdaterLock);
|
||||||
|
m_snapshotUpdater = updater;
|
||||||
|
}
|
||||||
|
|
||||||
void CppEditorSupport::onMimeTypeChanged()
|
void CppEditorSupport::onMimeTypeChanged()
|
||||||
{
|
{
|
||||||
m_highlighter.cancel();
|
m_highlighter.cancel();
|
||||||
|
|||||||
@@ -197,6 +197,9 @@ private:
|
|||||||
void recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future,
|
void recalculateSemanticInfoDetached_helper(QFutureInterface<void> &future,
|
||||||
SemanticInfo::Source source);
|
SemanticInfo::Source source);
|
||||||
|
|
||||||
|
QSharedPointer<SnapshotUpdater> snapshotUpdater_internal() const;
|
||||||
|
void setSnapshotUpdater_internal(const QSharedPointer<SnapshotUpdater> &updater);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Internal::CppModelManager *m_modelManager;
|
Internal::CppModelManager *m_modelManager;
|
||||||
QPointer<TextEditor::BaseTextEditor> m_textEditor;
|
QPointer<TextEditor::BaseTextEditor> m_textEditor;
|
||||||
@@ -225,6 +228,7 @@ private:
|
|||||||
mutable QMutex m_lastSemanticInfoLock;
|
mutable QMutex m_lastSemanticInfoLock;
|
||||||
SemanticInfo m_lastSemanticInfo;
|
SemanticInfo m_lastSemanticInfo;
|
||||||
QFuture<void> m_futureSemanticInfo;
|
QFuture<void> m_futureSemanticInfo;
|
||||||
|
mutable QMutex m_snapshotUpdaterLock;
|
||||||
QSharedPointer<SnapshotUpdater> m_snapshotUpdater;
|
QSharedPointer<SnapshotUpdater> m_snapshotUpdater;
|
||||||
|
|
||||||
// Highlighting:
|
// Highlighting:
|
||||||
|
|||||||
@@ -2059,13 +2059,15 @@ void DebuggerPluginPrivate::requestMark(ITextEditor *editor,
|
|||||||
if (kind != ITextEditor::BreakpointRequest)
|
if (kind != ITextEditor::BreakpointRequest)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (editor->property("DisassemblerView").toBool()) {
|
if (IDocument *document = editor->document()) {
|
||||||
QString line = editor->textDocument()->plainText()
|
if (document->property(Constants::OPENED_WITH_DISASSEMBLY).toBool()) {
|
||||||
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
|
QString line = editor->textDocument()->plainText()
|
||||||
quint64 address = DisassemblerLine::addressFromDisassemblyLine(line);
|
.section(QLatin1Char('\n'), lineNumber - 1, lineNumber - 1);
|
||||||
toggleBreakpointByAddress(address);
|
quint64 address = DisassemblerLine::addressFromDisassemblyLine(line);
|
||||||
} else if (editor->document()) {
|
toggleBreakpointByAddress(address);
|
||||||
toggleBreakpointByFileAndLine(editor->document()->filePath(), lineNumber);
|
} else {
|
||||||
|
toggleBreakpointByFileAndLine(document->filePath(), lineNumber);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -491,15 +491,17 @@ void LldbEngine::activateFrame(int frameIndex)
|
|||||||
if (state() != InferiorStopOk && state() != InferiorUnrunnable)
|
if (state() != InferiorStopOk && state() != InferiorUnrunnable)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int limit = debuggerCore()->action(MaximalStackDepth)->value().toInt();
|
const int n = stackHandler()->stackSize();
|
||||||
int n = stackHandler()->stackSize();
|
if (frameIndex == n) {
|
||||||
if (frameIndex == n)
|
Command cmd("reportStack");
|
||||||
limit = n * 10 + 3;
|
cmd.arg("stacklimit", n * 10 + 3);
|
||||||
|
runCommand(cmd);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Command cmd("activateFrame");
|
Command cmd("activateFrame");
|
||||||
cmd.arg("index", frameIndex);
|
cmd.arg("index", frameIndex);
|
||||||
cmd.arg("thread", threadsHandler()->currentThread().raw());
|
cmd.arg("thread", threadsHandler()->currentThread().raw());
|
||||||
cmd.arg("stacklimit", limit);
|
|
||||||
runCommand(cmd);
|
runCommand(cmd);
|
||||||
|
|
||||||
updateAll();
|
updateAll();
|
||||||
@@ -883,9 +885,24 @@ bool LldbEngine::setToolTipExpression(const QPoint &mousePos,
|
|||||||
void LldbEngine::updateAll()
|
void LldbEngine::updateAll()
|
||||||
{
|
{
|
||||||
reloadRegisters();
|
reloadRegisters();
|
||||||
|
updateStack();
|
||||||
updateLocals();
|
updateLocals();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LldbEngine::reloadFullStack()
|
||||||
|
{
|
||||||
|
Command cmd("reportStack");
|
||||||
|
cmd.arg("stacklimit", -1);
|
||||||
|
runCommand(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LldbEngine::updateStack()
|
||||||
|
{
|
||||||
|
Command cmd("reportStack");
|
||||||
|
cmd.arg("stacklimit", 20);
|
||||||
|
runCommand(cmd);
|
||||||
|
}
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
// Watch specific stuff
|
// Watch specific stuff
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ private:
|
|||||||
void reloadModules();
|
void reloadModules();
|
||||||
void reloadRegisters();
|
void reloadRegisters();
|
||||||
void reloadSourceFiles() {}
|
void reloadSourceFiles() {}
|
||||||
void reloadFullStack() {}
|
void reloadFullStack();
|
||||||
void fetchDisassembler(Internal::DisassemblerAgent *);
|
void fetchDisassembler(Internal::DisassemblerAgent *);
|
||||||
void refreshDisassembly(const GdbMi &data);
|
void refreshDisassembly(const GdbMi &data);
|
||||||
|
|
||||||
@@ -161,6 +161,7 @@ private:
|
|||||||
Q_SLOT void handleResponse(const QByteArray &data);
|
Q_SLOT void handleResponse(const QByteArray &data);
|
||||||
Q_SLOT void runEngine2();
|
Q_SLOT void runEngine2();
|
||||||
Q_SLOT void updateAll();
|
Q_SLOT void updateAll();
|
||||||
|
Q_SLOT void updateStack();
|
||||||
Q_SLOT void updateLocals();
|
Q_SLOT void updateLocals();
|
||||||
Q_SLOT void createFullBacktrace();
|
Q_SLOT void createFullBacktrace();
|
||||||
void doUpdateLocals(UpdateParameters params);
|
void doUpdateLocals(UpdateParameters params);
|
||||||
|
|||||||
@@ -88,19 +88,19 @@ void DeviceApplicationRunner::start(const IDevice::ConstPtr &device,
|
|||||||
|
|
||||||
d->state = Run;
|
d->state = Run;
|
||||||
if (!device) {
|
if (!device) {
|
||||||
emit reportError(tr("Cannot run: No device."));
|
doReportError(tr("Cannot run: No device."));
|
||||||
setFinished();
|
setFinished();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!device->canCreateProcess()) {
|
if (!device->canCreateProcess()) {
|
||||||
emit reportError(tr("Cannot run: Device is not able to create processes."));
|
doReportError(tr("Cannot run: Device is not able to create processes."));
|
||||||
setFinished();
|
setFinished();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (command.isEmpty()) {
|
if (command.isEmpty()) {
|
||||||
emit reportError(tr("Cannot run: No command given."));
|
doReportError(tr("Cannot run: No command given."));
|
||||||
setFinished();
|
setFinished();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -139,7 +139,7 @@ void DeviceApplicationRunner::stop()
|
|||||||
void DeviceApplicationRunner::handleApplicationError(QProcess::ProcessError error)
|
void DeviceApplicationRunner::handleApplicationError(QProcess::ProcessError error)
|
||||||
{
|
{
|
||||||
if (error == QProcess::FailedToStart) {
|
if (error == QProcess::FailedToStart) {
|
||||||
emit reportError(tr("Application failed to start: %1")
|
doReportError(tr("Application failed to start: %1")
|
||||||
.arg(d->deviceProcess->errorString()));
|
.arg(d->deviceProcess->errorString()));
|
||||||
setFinished();
|
setFinished();
|
||||||
}
|
}
|
||||||
@@ -165,13 +165,11 @@ void DeviceApplicationRunner::handleApplicationFinished()
|
|||||||
QTC_ASSERT(d->state == Run, return);
|
QTC_ASSERT(d->state == Run, return);
|
||||||
|
|
||||||
if (d->deviceProcess->exitStatus() == QProcess::CrashExit) {
|
if (d->deviceProcess->exitStatus() == QProcess::CrashExit) {
|
||||||
emit reportError(d->deviceProcess->errorString());
|
doReportError(d->deviceProcess->errorString());
|
||||||
d->success = false;
|
|
||||||
} else {
|
} else {
|
||||||
const int exitCode = d->deviceProcess->exitCode();
|
const int exitCode = d->deviceProcess->exitCode();
|
||||||
if (exitCode != 0) {
|
if (exitCode != 0) {
|
||||||
emit reportError(tr("Application finished with exit code %1.").arg(exitCode));
|
doReportError(tr("Application finished with exit code %1.").arg(exitCode));
|
||||||
d->success = false;
|
|
||||||
} else {
|
} else {
|
||||||
emit reportProgress(tr("Application finished with exit code 0."));
|
emit reportProgress(tr("Application finished with exit code 0."));
|
||||||
}
|
}
|
||||||
@@ -191,4 +189,10 @@ void DeviceApplicationRunner::handleRemoteStderr()
|
|||||||
emit remoteStderr(d->deviceProcess->readAllStandardError());
|
emit remoteStderr(d->deviceProcess->readAllStandardError());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DeviceApplicationRunner::doReportError(const QString &message)
|
||||||
|
{
|
||||||
|
d->success = false;
|
||||||
|
emit reportError(message);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace ProjectExplorer
|
} // namespace ProjectExplorer
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ private slots:
|
|||||||
void handleRemoteStderr();
|
void handleRemoteStderr();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
void doReportError(const QString &message);
|
||||||
void setFinished();
|
void setFinished();
|
||||||
|
|
||||||
class DeviceApplicationRunnerPrivate;
|
class DeviceApplicationRunnerPrivate;
|
||||||
|
|||||||
@@ -1994,9 +1994,10 @@ bool ProjectExplorerPlugin::saveModifiedFiles()
|
|||||||
tr("Always save files before build"), &alwaysSave)) {
|
tr("Always save files before build"), &alwaysSave)) {
|
||||||
if (cancelled)
|
if (cancelled)
|
||||||
return false;
|
return false;
|
||||||
if (alwaysSave)
|
|
||||||
d->m_projectExplorerSettings.saveBeforeBuild = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (alwaysSave)
|
||||||
|
d->m_projectExplorerSettings.saveBeforeBuild = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -327,9 +327,11 @@ void TaskModel::setFileNotFound(const QModelIndex &idx, bool b)
|
|||||||
/////
|
/////
|
||||||
|
|
||||||
TaskFilterModel::TaskFilterModel(TaskModel *sourceModel, QObject *parent) : QAbstractItemModel(parent),
|
TaskFilterModel::TaskFilterModel(TaskModel *sourceModel, QObject *parent) : QAbstractItemModel(parent),
|
||||||
m_mappingUpToDate(false), m_sourceModel(sourceModel)
|
m_sourceModel(sourceModel)
|
||||||
{
|
{
|
||||||
Q_ASSERT(m_sourceModel);
|
Q_ASSERT(m_sourceModel);
|
||||||
|
updateMapping();
|
||||||
|
|
||||||
connect(m_sourceModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
|
connect(m_sourceModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
|
||||||
this, SLOT(handleNewRows(QModelIndex,int,int)));
|
this, SLOT(handleNewRows(QModelIndex,int,int)));
|
||||||
connect(m_sourceModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
|
connect(m_sourceModel, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
|
||||||
@@ -472,15 +474,12 @@ QModelIndex TaskFilterModel::mapToSource(const QModelIndex &index) const
|
|||||||
void TaskFilterModel::invalidateFilter()
|
void TaskFilterModel::invalidateFilter()
|
||||||
{
|
{
|
||||||
beginResetModel();
|
beginResetModel();
|
||||||
m_mappingUpToDate = false;
|
updateMapping();
|
||||||
endResetModel();
|
endResetModel();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TaskFilterModel::updateMapping() const
|
void TaskFilterModel::updateMapping() const
|
||||||
{
|
{
|
||||||
if (m_mappingUpToDate)
|
|
||||||
return;
|
|
||||||
|
|
||||||
m_mapping.clear();
|
m_mapping.clear();
|
||||||
for (int i = 0; i < m_sourceModel->rowCount(); ++i) {
|
for (int i = 0; i < m_sourceModel->rowCount(); ++i) {
|
||||||
QModelIndex index = m_sourceModel->index(i, 0);
|
QModelIndex index = m_sourceModel->index(i, 0);
|
||||||
@@ -488,8 +487,6 @@ void TaskFilterModel::updateMapping() const
|
|||||||
if (filterAcceptsTask(task))
|
if (filterAcceptsTask(task))
|
||||||
m_mapping.append(i);
|
m_mapping.append(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_mappingUpToDate = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TaskFilterModel::filterAcceptsTask(const Task &task) const
|
bool TaskFilterModel::filterAcceptsTask(const Task &task) const
|
||||||
|
|||||||
@@ -179,7 +179,6 @@ private:
|
|||||||
QList<Core::Id> m_categoryIds;
|
QList<Core::Id> m_categoryIds;
|
||||||
|
|
||||||
mutable QList<int> m_mapping;
|
mutable QList<int> m_mapping;
|
||||||
mutable bool m_mappingUpToDate;
|
|
||||||
|
|
||||||
TaskModel *m_sourceModel;
|
TaskModel *m_sourceModel;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -468,6 +468,7 @@ void QbsProjectManagerPlugin::buildFiles(QbsProject *project, const QStringList
|
|||||||
BuildManager::buildList(bc->stepList(buildStep), name);
|
BuildManager::buildList(bc->stepList(buildStep), name);
|
||||||
|
|
||||||
bc->setChangedFiles(QStringList());
|
bc->setChangedFiles(QStringList());
|
||||||
|
bc->setActiveFileTags(QStringList());
|
||||||
}
|
}
|
||||||
|
|
||||||
void QbsProjectManagerPlugin::buildSingleFile(QbsProject *project, const QString &file)
|
void QbsProjectManagerPlugin::buildSingleFile(QbsProject *project, const QString &file)
|
||||||
|
|||||||
@@ -208,7 +208,6 @@ void QtQuickApp::setTemplateInfo(const TemplateInfo &templateInfo)
|
|||||||
|
|
||||||
QString QtQuickApp::pathExtended(int fileType) const
|
QString QtQuickApp::pathExtended(int fileType) const
|
||||||
{
|
{
|
||||||
const QString qmlSubDir = QLatin1String("qml/");
|
|
||||||
const QString appViewerTargetSubDir = appViewerOriginSubDir();
|
const QString appViewerTargetSubDir = appViewerOriginSubDir();
|
||||||
|
|
||||||
const QString mainQmlFile = QLatin1String("main.qml");
|
const QString mainQmlFile = QLatin1String("main.qml");
|
||||||
@@ -219,8 +218,8 @@ QString QtQuickApp::pathExtended(int fileType) const
|
|||||||
const QString pathBase = outputPathBase();
|
const QString pathBase = outputPathBase();
|
||||||
|
|
||||||
switch (fileType) {
|
switch (fileType) {
|
||||||
case MainQml: return pathBase + qmlSubDir + mainQmlFile;
|
case MainQml: return pathBase + mainQmlFile;
|
||||||
case MainQmlOrigin: return originsRoot() + qmlSubDir + mainQmlFile;
|
case MainQmlOrigin: return originsRoot() + mainQmlFile;
|
||||||
case MainQrc: return pathBase + mainQrcFile;
|
case MainQrc: return pathBase + mainQrcFile;
|
||||||
case MainQrcOrigin: return originsRoot() + mainQrcFile;
|
case MainQrcOrigin: return originsRoot() + mainQrcFile;
|
||||||
case QrcDeployment: return pathBase + qrcDeploymentFile;
|
case QrcDeployment: return pathBase + qrcDeploymentFile;
|
||||||
|
|||||||
@@ -33,6 +33,7 @@
|
|||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
namespace Constants {
|
namespace Constants {
|
||||||
|
|
||||||
|
const char C_BACKSPACE[] = "QmlDesigner.Backspace";
|
||||||
const char C_DELETE[] = "QmlDesigner.Delete";
|
const char C_DELETE[] = "QmlDesigner.Delete";
|
||||||
|
|
||||||
// Context
|
// Context
|
||||||
|
|||||||
@@ -115,11 +115,19 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
|
|||||||
|
|
||||||
//Edit Menu
|
//Edit Menu
|
||||||
|
|
||||||
|
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerFormEditorContext);
|
||||||
|
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_BACKSPACE, qmlDesignerNavigatorContext);
|
||||||
|
command->setDefaultKeySequence(QKeySequence(Qt::Key_Backspace));
|
||||||
|
command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes
|
||||||
|
if (Utils::HostOsInfo::isMacHost())
|
||||||
|
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
||||||
|
|
||||||
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerFormEditorContext);
|
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerFormEditorContext);
|
||||||
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerNavigatorContext);
|
command = Core::ActionManager::registerAction(&m_deleteAction, QmlDesigner::Constants::C_DELETE, qmlDesignerNavigatorContext);
|
||||||
command->setDefaultKeySequence(QKeySequence::Delete);
|
command->setDefaultKeySequence(QKeySequence::Delete);
|
||||||
command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes
|
command->setAttribute(Core::Command::CA_Hide); // don't show delete in other modes
|
||||||
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
if (!Utils::HostOsInfo::isMacHost())
|
||||||
|
editMenu->addAction(command, Core::Constants::G_EDIT_COPYPASTE);
|
||||||
|
|
||||||
command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerFormEditorContext);
|
command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerFormEditorContext);
|
||||||
command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerNavigatorContext);
|
command = Core::ActionManager::registerAction(&m_cutAction, Core::Constants::CUT, qmlDesignerNavigatorContext);
|
||||||
@@ -159,16 +167,6 @@ void ShortCutManager::registerActions(const Core::Context &qmlDesignerMainContex
|
|||||||
viewsMenu->addAction(command);
|
viewsMenu->addAction(command);
|
||||||
|
|
||||||
command = Core::ActionManager::registerAction(&m_hideSidebarsAction, Core::Constants::TOGGLE_SIDEBAR, qmlDesignerMainContext);
|
command = Core::ActionManager::registerAction(&m_hideSidebarsAction, Core::Constants::TOGGLE_SIDEBAR, qmlDesignerMainContext);
|
||||||
|
|
||||||
if (Utils::HostOsInfo::isMacHost()) {
|
|
||||||
// add second shortcut to trigger delete
|
|
||||||
QAction *deleteAction = new QAction(this);
|
|
||||||
deleteAction->setShortcut(QKeySequence(QLatin1String("Backspace")));
|
|
||||||
connect(deleteAction,
|
|
||||||
SIGNAL(triggered()),
|
|
||||||
&m_deleteAction,
|
|
||||||
SIGNAL(triggered()));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShortCutManager::updateActions(Core::IEditor* currentEditor)
|
void ShortCutManager::updateActions(Core::IEditor* currentEditor)
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ Canvas {
|
|||||||
onPaint: {
|
onPaint: {
|
||||||
if (context === null)
|
if (context === null)
|
||||||
return; // canvas isn't ready
|
return; // canvas isn't ready
|
||||||
|
|
||||||
|
context.reset();
|
||||||
Plotter.qmlProfilerModelProxy = qmlProfilerModelProxy;
|
Plotter.qmlProfilerModelProxy = qmlProfilerModelProxy;
|
||||||
if (dataReady) {
|
if (dataReady) {
|
||||||
Plotter.plot(canvas, context, region);
|
Plotter.plot(canvas, context, region);
|
||||||
|
|||||||
@@ -50,6 +50,8 @@ Canvas {
|
|||||||
onPaint: {
|
onPaint: {
|
||||||
if (context === null)
|
if (context === null)
|
||||||
return; // canvas isn't ready
|
return; // canvas isn't ready
|
||||||
|
|
||||||
|
context.reset();
|
||||||
context.fillStyle = "white";
|
context.fillStyle = "white";
|
||||||
context.fillRect(0, 0, width, height);
|
context.fillRect(0, 0, width, height);
|
||||||
|
|
||||||
|
|||||||
@@ -49,6 +49,8 @@ Canvas {
|
|||||||
onPaint: {
|
onPaint: {
|
||||||
if (context === null)
|
if (context === null)
|
||||||
return; // canvas isn't ready
|
return; // canvas isn't ready
|
||||||
|
|
||||||
|
context.reset();
|
||||||
drawBackgroundBars( context, region );
|
drawBackgroundBars( context, region );
|
||||||
|
|
||||||
var totalTime = endTime - startTime;
|
var totalTime = endTime - startTime;
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ PaintEventsModelProxy::PaintEventsModelProxy(QObject *parent)
|
|||||||
void PaintEventsModelProxy::clear()
|
void PaintEventsModelProxy::clear()
|
||||||
{
|
{
|
||||||
Q_D(PaintEventsModelProxy);
|
Q_D(PaintEventsModelProxy);
|
||||||
d->SortedTimelineModel::clear();
|
d->clear();
|
||||||
d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0;
|
d->maxGuiThreadAnimations = d->maxRenderThreadAnimations = 0;
|
||||||
d->expanded = false;
|
d->expanded = false;
|
||||||
d->seenForeignPaintEvent = false;
|
d->seenForeignPaintEvent = false;
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ BasicTimelineModel::BasicTimelineModel(QObject *parent)
|
|||||||
void BasicTimelineModel::clear()
|
void BasicTimelineModel::clear()
|
||||||
{
|
{
|
||||||
Q_D(BasicTimelineModel);
|
Q_D(BasicTimelineModel);
|
||||||
d->SortedTimelineModel::clear();
|
d->clear();
|
||||||
d->eventDict.clear();
|
d->eventDict.clear();
|
||||||
d->eventHashes.clear();
|
d->eventHashes.clear();
|
||||||
d->categorySpan.clear();
|
d->categorySpan.clear();
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ static bool debugExamples()
|
|||||||
}
|
}
|
||||||
|
|
||||||
static const char kSelectedExampleSetKey[] = "WelcomePage/SelectedExampleSet";
|
static const char kSelectedExampleSetKey[] = "WelcomePage/SelectedExampleSet";
|
||||||
static const char kExamplesSearchStringKey[] = "WelcomePage/ExamplesSearchString";
|
|
||||||
|
|
||||||
void ExampleSetModel::writeCurrentIdToSettings(int currentIndex) const
|
void ExampleSetModel::writeCurrentIdToSettings(int currentIndex) const
|
||||||
{
|
{
|
||||||
@@ -842,16 +841,6 @@ void ExamplesListModelFilter::filterForExampleSet(int index)
|
|||||||
m_sourceModel->selectExampleSet(index);
|
m_sourceModel->selectExampleSet(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExamplesListModelFilter::writeSearchStringToSettings(const QString &string)
|
|
||||||
{
|
|
||||||
Core::ICore::settings()->setValue(QLatin1String(kExamplesSearchStringKey), string);
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ExamplesListModelFilter::readSearchStringsFromSettings()
|
|
||||||
{
|
|
||||||
return Core::ICore::settings()->value(QLatin1String(kExamplesSearchStringKey)).toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
void ExamplesListModelFilter::setShowTutorialsOnly(bool showTutorialsOnly)
|
void ExamplesListModelFilter::setShowTutorialsOnly(bool showTutorialsOnly)
|
||||||
{
|
{
|
||||||
m_showTutorialsOnly = showTutorialsOnly;
|
m_showTutorialsOnly = showTutorialsOnly;
|
||||||
|
|||||||
@@ -185,8 +185,6 @@ public:
|
|||||||
QAbstractItemModel* exampleSetModel();
|
QAbstractItemModel* exampleSetModel();
|
||||||
|
|
||||||
Q_INVOKABLE void filterForExampleSet(int index);
|
Q_INVOKABLE void filterForExampleSet(int index);
|
||||||
Q_INVOKABLE void writeSearchStringToSettings(const QString &string);
|
|
||||||
Q_INVOKABLE QString readSearchStringsFromSettings();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setFilterTags(const QStringList &arg)
|
void setFilterTags(const QStringList &arg)
|
||||||
|
|||||||
@@ -232,83 +232,32 @@ void SyntaxHighlighterPrivate::reformatBlock(const QTextBlock &block, int from,
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\class SyntaxHighlighter
|
\class SyntaxHighlighter
|
||||||
\reentrant
|
|
||||||
|
|
||||||
\brief The SyntaxHighlighter class allows you to define syntax
|
\brief The SyntaxHighlighter class allows you to define syntax highlighting rules and to query
|
||||||
highlighting rules, and in addition you can use the class to query
|
|
||||||
a document's current formatting or user data.
|
a document's current formatting or user data.
|
||||||
|
|
||||||
\since 4.1
|
The SyntaxHighlighter class is a copied and forked version of the QSyntaxHighlighter. There are
|
||||||
|
a couple of binary incompatible changes that prevent doing this directly in Qt.
|
||||||
|
|
||||||
\ingroup richtext-processing
|
The main difference from the QSyntaxHighlighter is the addition of setExtraAdditionalFormats.
|
||||||
|
This method prevents redoing syntax highlighting when setting the additionalFormats on the
|
||||||
|
layout and subsequently marking the document contents dirty. It thus prevents the redoing of the
|
||||||
|
semantic highlighting, which sets extra additionalFormats, and so on.
|
||||||
|
|
||||||
The SyntaxHighlighter class is a base class for implementing
|
Another way to implement the semantic highlighting is to use ExtraSelections on
|
||||||
QTextEdit syntax highlighters. A syntax highligher automatically
|
Q(Plain)TextEdit. The drawback of QTextEdit::setExtraSelections is that ExtraSelection uses a
|
||||||
highlights parts of the text in a QTextEdit, or more generally in
|
QTextCursor for positioning. That means that with every document change (that is, every
|
||||||
a QTextDocument. Syntax highlighters are often used when the user
|
keystroke), a whole bunch of cursors can be re-checked or re-calculated. This is not needed in
|
||||||
is entering text in a specific format (for example source code)
|
our situation, because the next thing that will happen is that the highlighting will come up
|
||||||
and help the user to read the text and identify syntax errors.
|
with new ranges, meaning that it destroys the cursors. To make things worse, QTextCursor
|
||||||
|
calculates the pixel position in the line it's in. The calculations are done with
|
||||||
|
QTextLine::cursorTo, which is very expensive and is not optimized for fixed-width fonts. Another
|
||||||
|
reason not to use ExtraSelections is that those selections belong to the editor, not to the
|
||||||
|
document. This means that every editor needs a highlighter, instead of every document. This
|
||||||
|
could become expensive when multiple editors with the same document are opened.
|
||||||
|
|
||||||
To provide your own syntax highlighting, you must subclass
|
So, we use AdditionalFormats, because all those highlights should get removed or redone soon
|
||||||
SyntaxHighlighter and reimplement highlightBlock().
|
after the change happens.
|
||||||
|
|
||||||
When you create an instance of your SyntaxHighlighter subclass,
|
|
||||||
pass it the QTextEdit or QTextDocument that you want the syntax
|
|
||||||
highlighting to be applied to. For example:
|
|
||||||
|
|
||||||
\snippet doc/src/snippets/code/src_gui_text_SyntaxHighlighter.cpp 0
|
|
||||||
|
|
||||||
After this your highlightBlock() function will be called
|
|
||||||
automatically whenever necessary. Use your highlightBlock()
|
|
||||||
function to apply formatting (e.g. setting the font and color) to
|
|
||||||
the text that is passed to it. SyntaxHighlighter provides the
|
|
||||||
setFormat() function which applies a given QTextCharFormat on
|
|
||||||
the current text block. For example:
|
|
||||||
|
|
||||||
\snippet doc/src/snippets/code/src_gui_text_SyntaxHighlighter.cpp 1
|
|
||||||
|
|
||||||
Some syntaxes can have constructs that span several text
|
|
||||||
blocks. For example, a C++ syntax highlighter should be able to
|
|
||||||
cope with \c{/}\c{*...*}\c{/} multiline comments. To deal with
|
|
||||||
these cases it is necessary to know the end state of the previous
|
|
||||||
text block (e.g. "in comment").
|
|
||||||
|
|
||||||
Inside your highlightBlock() implementation you can query the end
|
|
||||||
state of the previous text block using the previousBlockState()
|
|
||||||
function. After parsing the block you can save the last state
|
|
||||||
using setCurrentBlockState().
|
|
||||||
|
|
||||||
The currentBlockState() and previousBlockState() functions return
|
|
||||||
an int value. If no state is set, the returned value is -1. You
|
|
||||||
can designate any other value to identify any given state using
|
|
||||||
the setCurrentBlockState() function. Once the state is set the
|
|
||||||
QTextBlock keeps that value until it is set set again or until the
|
|
||||||
corresponding paragraph of text is deleted.
|
|
||||||
|
|
||||||
For example, if you're writing a simple C++ syntax highlighter,
|
|
||||||
you might designate 1 to signify "in comment":
|
|
||||||
|
|
||||||
\snippet doc/src/snippets/code/src_gui_text_SyntaxHighlighter.cpp 2
|
|
||||||
|
|
||||||
In the example above, we first set the current block state to
|
|
||||||
0. Then, if the previous block ended within a comment, we higlight
|
|
||||||
from the beginning of the current block (\c {startIndex =
|
|
||||||
0}). Otherwise, we search for the given start expression. If the
|
|
||||||
specified end expression cannot be found in the text block, we
|
|
||||||
change the current block state by calling setCurrentBlockState(),
|
|
||||||
and make sure that the rest of the block is higlighted.
|
|
||||||
|
|
||||||
In addition you can query the current formatting and user data
|
|
||||||
using the format() and currentBlockUserData() functions
|
|
||||||
respectively. You can also attach user data to the current text
|
|
||||||
block using the setCurrentBlockUserData() function.
|
|
||||||
QTextBlockUserData can be used to store custom settings. In the
|
|
||||||
case of syntax highlighting, it is in particular interesting as
|
|
||||||
cache storage for information that you may figure out while
|
|
||||||
parsing the paragraph's text. For an example, see the
|
|
||||||
setCurrentBlockUserData() documentation.
|
|
||||||
|
|
||||||
\sa QTextEdit, {Syntax Highlighter Example}
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -34,12 +34,14 @@
|
|||||||
|
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
#include <projectexplorer/buildconfiguration.h>
|
||||||
#include <projectexplorer/buildtargetinfo.h>
|
#include <projectexplorer/buildtargetinfo.h>
|
||||||
#include <projectexplorer/target.h>
|
#include <projectexplorer/target.h>
|
||||||
#include <projectexplorer/project.h>
|
#include <projectexplorer/project.h>
|
||||||
#include <projectexplorer/kitinformation.h>
|
#include <projectexplorer/kitinformation.h>
|
||||||
#include <qtsupport/qtkitinformation.h>
|
#include <qtsupport/qtkitinformation.h>
|
||||||
|
|
||||||
|
using ProjectExplorer::BuildConfiguration;
|
||||||
using ProjectExplorer::DeviceKitInformation;
|
using ProjectExplorer::DeviceKitInformation;
|
||||||
using ProjectExplorer::IDevice;
|
using ProjectExplorer::IDevice;
|
||||||
using ProjectExplorer::RunControl;
|
using ProjectExplorer::RunControl;
|
||||||
@@ -82,6 +84,9 @@ WinRtRunControl::WinRtRunControl(WinRtRunConfiguration *runConfiguration, RunMod
|
|||||||
|
|
||||||
m_arguments = runConfiguration->arguments();
|
m_arguments = runConfiguration->arguments();
|
||||||
m_uninstallAfterStop = runConfiguration->uninstallAfterStop();
|
m_uninstallAfterStop = runConfiguration->uninstallAfterStop();
|
||||||
|
|
||||||
|
if (BuildConfiguration *bc = target->activeBuildConfiguration())
|
||||||
|
m_environment = bc->environment();
|
||||||
}
|
}
|
||||||
|
|
||||||
void WinRtRunControl::start()
|
void WinRtRunControl::start()
|
||||||
@@ -196,6 +201,7 @@ bool WinRtRunControl::startWinRtRunner()
|
|||||||
m_state = StartingState;
|
m_state = StartingState;
|
||||||
m_process->setUseCtrlCStub(true);
|
m_process->setUseCtrlCStub(true);
|
||||||
m_process->setCommand(m_runnerFilePath, runnerArgs);
|
m_process->setCommand(m_runnerFilePath, runnerArgs);
|
||||||
|
m_process->setEnvironment(m_environment);
|
||||||
m_process->setWorkingDirectory(QFileInfo(m_executableFilePath).absolutePath());
|
m_process->setWorkingDirectory(QFileInfo(m_executableFilePath).absolutePath());
|
||||||
m_process->start();
|
m_process->start();
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -78,6 +78,7 @@ private:
|
|||||||
bool m_uninstallAfterStop;
|
bool m_uninstallAfterStop;
|
||||||
bool m_isWinPhone;
|
bool m_isWinPhone;
|
||||||
Utils::QtcProcess *m_process;
|
Utils::QtcProcess *m_process;
|
||||||
|
Utils::Environment m_environment;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -23,7 +23,8 @@ equals(QMAKE_HOST.os, Windows) {
|
|||||||
QMAKE_EXT_OBJ = .obj
|
QMAKE_EXT_OBJ = .obj
|
||||||
QMAKE_EXT_RES = .res
|
QMAKE_EXT_RES = .res
|
||||||
QMAKE_SH =
|
QMAKE_SH =
|
||||||
PATH = $$split($$(PATH), ;)
|
PATH = $$(PATH)
|
||||||
|
PATH = $$split(PATH, ;)
|
||||||
for(dir, PATH) {
|
for(dir, PATH) {
|
||||||
exists($$dir/sh.exe) {
|
exists($$dir/sh.exe) {
|
||||||
QMAKE_SH = $$dir/sh.exe
|
QMAKE_SH = $$dir/sh.exe
|
||||||
|
|||||||
@@ -907,7 +907,6 @@ GdbRunner::GdbRunner(IosTool *iosTool, int gdbFd) :
|
|||||||
|
|
||||||
void GdbRunner::run()
|
void GdbRunner::run()
|
||||||
{
|
{
|
||||||
m_iosTool->errorMsg(QString::fromLatin1("GdbRunner in thread %1").arg((quintptr)(void *)QThread::currentThread()));
|
|
||||||
{
|
{
|
||||||
QMutexLocker l(&m_iosTool->m_xmlMutex);
|
QMutexLocker l(&m_iosTool->m_xmlMutex);
|
||||||
if (!m_iosTool->splitAppOutput) {
|
if (!m_iosTool->splitAppOutput) {
|
||||||
|
|||||||
@@ -372,9 +372,19 @@ bool AddKitOperation::test() const
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
QVariantMap data = profile0.value(QLatin1String(DATA)).toMap();
|
QVariantMap data = profile0.value(QLatin1String(DATA)).toMap();
|
||||||
if (data.count() != 8
|
if (data.count() != 6
|
||||||
|| !data.contains(QLatin1String(DEBUGGER))
|
|| !data.contains(QLatin1String(DEBUGGER))
|
||||||
|| data.value(QLatin1String(DEBUGGER)).type()!= QVariant::Map)
|
|| data.value(QLatin1String(DEBUGGER)).type() != QVariant::Map
|
||||||
|
|| !data.contains(QLatin1String(DEVICE_TYPE))
|
||||||
|
|| data.value(QLatin1String(DEVICE_TYPE)).toString() != QLatin1String("Desktop")
|
||||||
|
|| !data.contains(QLatin1String(TOOLCHAIN))
|
||||||
|
|| data.value(QLatin1String(TOOLCHAIN)).toString() != QLatin1String("{tc-id}")
|
||||||
|
|| !data.contains(QLatin1String(QT))
|
||||||
|
|| data.value(QLatin1String(QT)).toString() != QLatin1String("SDK.{qt-id}")
|
||||||
|
|| !data.contains(QLatin1String(MKSPEC))
|
||||||
|
|| data.value(QLatin1String(MKSPEC)).toString() != QLatin1String("unsupported/mkspec")
|
||||||
|
|| !data.contains(QLatin1String("extraData"))
|
||||||
|
|| data.value(QLatin1String("extraData")).toString() != QLatin1String("extraValue"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Ignore existing ids:
|
// Ignore existing ids:
|
||||||
@@ -391,7 +401,7 @@ bool AddKitOperation::test() const
|
|||||||
map = addKit(map, tcMap, qtMap, devMap,
|
map = addKit(map, tcMap, qtMap, devMap,
|
||||||
QLatin1String("testId2"), QLatin1String("Test Kit2"), QLatin1String("/tmp/icon2.png"),
|
QLatin1String("testId2"), QLatin1String("Test Kit2"), QLatin1String("/tmp/icon2.png"),
|
||||||
QString(), 1, QLatin1String("/usr/bin/gdb-test2"),
|
QString(), 1, QLatin1String("/usr/bin/gdb-test2"),
|
||||||
QByteArray("Desktop"), QLatin1String("{dev-id}"), QString(),
|
QByteArray("Desktop"), QLatin1String("{dev-id}"), QLatin1String("/sys/root\\\\"),
|
||||||
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
|
QLatin1String("{tc-id}"), QLatin1String("{qt-id}"), QLatin1String("unsupported/mkspec"),
|
||||||
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
|
KeyValuePairList() << KeyValuePair(QLatin1String("PE.Profile.Data/extraData"), QVariant(QLatin1String("extraValue"))));
|
||||||
if (map.count() != 5
|
if (map.count() != 5
|
||||||
@@ -425,10 +435,22 @@ bool AddKitOperation::test() const
|
|||||||
|
|
||||||
data = profile1.value(QLatin1String(DATA)).toMap();
|
data = profile1.value(QLatin1String(DATA)).toMap();
|
||||||
if (data.count() != 8
|
if (data.count() != 8
|
||||||
|
|| !data.contains(QLatin1String(DEBUGGER))
|
||||||
|
|| data.value(QLatin1String(DEBUGGER)).type() != QVariant::Map
|
||||||
|
|| !data.contains(QLatin1String(DEVICE_TYPE))
|
||||||
|
|| data.value(QLatin1String(DEVICE_TYPE)).toString() != QLatin1String("Desktop")
|
||||||
|| !data.contains(QLatin1String(DEVICE_ID))
|
|| !data.contains(QLatin1String(DEVICE_ID))
|
||||||
|| data.value(QLatin1String(DEVICE_ID)).toString() != QLatin1String("{dev-id}")
|
|| data.value(QLatin1String(DEVICE_ID)).toString() != QLatin1String("{dev-id}")
|
||||||
|| !data.contains(QLatin1String(DEBUGGER))
|
|| !data.contains(QLatin1String(SYSROOT))
|
||||||
|| data.value(QLatin1String(DEBUGGER)).type() != QVariant::Map)
|
|| data.value(QLatin1String(SYSROOT)).toString() != QLatin1String("/sys/root\\\\")
|
||||||
|
|| !data.contains(QLatin1String(TOOLCHAIN))
|
||||||
|
|| data.value(QLatin1String(TOOLCHAIN)).toString() != QLatin1String("{tc-id}")
|
||||||
|
|| !data.contains(QLatin1String(QT))
|
||||||
|
|| data.value(QLatin1String(QT)).toString() != QLatin1String("SDK.{qt-id}")
|
||||||
|
|| !data.contains(QLatin1String(MKSPEC))
|
||||||
|
|| data.value(QLatin1String(MKSPEC)).toString() != QLatin1String("unsupported/mkspec")
|
||||||
|
|| !data.contains(QLatin1String("extraData"))
|
||||||
|
|| data.value(QLatin1String("extraData")).toString() != QLatin1String("extraValue"))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Test debugger id:
|
// Test debugger id:
|
||||||
@@ -471,7 +493,7 @@ bool AddKitOperation::test() const
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
data = profile2.value(QLatin1String(DATA)).toMap();
|
data = profile2.value(QLatin1String(DATA)).toMap();
|
||||||
if (data.count() != 8
|
if (data.count() != 6
|
||||||
|| !data.contains(QLatin1String(DEBUGGER))
|
|| !data.contains(QLatin1String(DEBUGGER))
|
||||||
|| data.value(QLatin1String(DEBUGGER)).toString() != QLatin1String("debugger Id"))
|
|| data.value(QLatin1String(DEBUGGER)).toString() != QLatin1String("debugger Id"))
|
||||||
return false;
|
return false;
|
||||||
@@ -577,27 +599,35 @@ QVariantMap AddKitOperation::addKit(const QVariantMap &map, const QVariantMap &t
|
|||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(AUTODETECTED), QVariant(true));
|
data << KeyValuePair(QStringList() << kit << QLatin1String(AUTODETECTED), QVariant(true));
|
||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(SDK), QVariant(true));
|
data << KeyValuePair(QStringList() << kit << QLatin1String(SDK), QVariant(true));
|
||||||
|
|
||||||
if (debuggerId.isEmpty()) {
|
if (!debuggerId.isNull() || !debugger.isNull()) {
|
||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
if (debuggerId.isEmpty()) {
|
||||||
<< QLatin1String(DEBUGGER) << QLatin1String(DEBUGGER_ENGINE), QVariant(debuggerType));
|
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
<< QLatin1String(DEBUGGER) << QLatin1String(DEBUGGER_ENGINE), QVariant(debuggerType));
|
||||||
<< QLatin1String(DEBUGGER) << QLatin1String(DEBUGGER_BINARY), QVariant(debugger));
|
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
||||||
} else {
|
<< QLatin1String(DEBUGGER) << QLatin1String(DEBUGGER_BINARY), QVariant(debugger));
|
||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) << QLatin1String(DEBUGGER),
|
} else {
|
||||||
QVariant(debuggerId));
|
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA) << QLatin1String(DEBUGGER),
|
||||||
|
QVariant(debuggerId));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
if (!deviceType.isNull())
|
||||||
<< QLatin1String(DEVICE_TYPE), QVariant(deviceType));
|
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
<< QLatin1String(DEVICE_TYPE), QVariant(deviceType));
|
||||||
<< QLatin1String(DEVICE_ID), QVariant(device));
|
if (!device.isNull())
|
||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
||||||
<< QLatin1String(SYSROOT), QVariant(sysRoot));
|
<< QLatin1String(DEVICE_ID), QVariant(device));
|
||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
if (!sysRoot.isNull())
|
||||||
<< QLatin1String(TOOLCHAIN), QVariant(tc));
|
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
<< QLatin1String(SYSROOT), QVariant(sysRoot));
|
||||||
<< QLatin1String(QT), QVariant(qtId));
|
if (!tc.isNull())
|
||||||
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
||||||
<< QLatin1String(MKSPEC), QVariant(mkspec));
|
<< QLatin1String(TOOLCHAIN), QVariant(tc));
|
||||||
|
if (!qtId.isNull())
|
||||||
|
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
||||||
|
<< QLatin1String(QT), QVariant(qtId));
|
||||||
|
if (!mkspec.isNull())
|
||||||
|
data << KeyValuePair(QStringList() << kit << QLatin1String(DATA)
|
||||||
|
<< QLatin1String(MKSPEC), QVariant(mkspec));
|
||||||
|
|
||||||
data << KeyValuePair(QStringList() << QLatin1String(DEFAULT), QVariant(defaultKit));
|
data << KeyValuePair(QStringList() << QLatin1String(DEFAULT), QVariant(defaultKit));
|
||||||
data << KeyValuePair(QStringList() << QLatin1String(COUNT), QVariant(count + 1));
|
data << KeyValuePair(QStringList() << QLatin1String(COUNT), QVariant(count + 1));
|
||||||
|
|||||||
@@ -762,8 +762,13 @@ private:
|
|||||||
void tst_Dumpers::initTestCase()
|
void tst_Dumpers::initTestCase()
|
||||||
{
|
{
|
||||||
m_debuggerBinary = qgetenv("QTC_DEBUGGER_PATH_FOR_TEST");
|
m_debuggerBinary = qgetenv("QTC_DEBUGGER_PATH_FOR_TEST");
|
||||||
if (m_debuggerBinary.isEmpty())
|
if (m_debuggerBinary.isEmpty()) {
|
||||||
|
#ifdef Q_OS_MAC
|
||||||
|
m_debuggerBinary = "/Applications/Xcode.app/Contents/Developer/usr/bin/lldb";
|
||||||
|
#else
|
||||||
m_debuggerBinary = "gdb";
|
m_debuggerBinary = "gdb";
|
||||||
|
#endif
|
||||||
|
}
|
||||||
qDebug() << "Debugger : " << m_debuggerBinary.constData();
|
qDebug() << "Debugger : " << m_debuggerBinary.constData();
|
||||||
|
|
||||||
m_debuggerEngine = GdbEngine;
|
m_debuggerEngine = GdbEngine;
|
||||||
@@ -813,7 +818,7 @@ void tst_Dumpers::initTestCase()
|
|||||||
m_env = QProcessEnvironment::systemEnvironment();
|
m_env = QProcessEnvironment::systemEnvironment();
|
||||||
m_makeBinary = QString::fromLocal8Bit(qgetenv("QTC_MAKE_PATH_FOR_TEST"));
|
m_makeBinary = QString::fromLocal8Bit(qgetenv("QTC_MAKE_PATH_FOR_TEST"));
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
if (m_makeBinary.isEmpty()) {
|
if (m_makeBinary.isEmpty())
|
||||||
m_makeBinary = QLatin1String("mingw32-make");
|
m_makeBinary = QLatin1String("mingw32-make");
|
||||||
// if qmake is not in PATH make sure the correct libs for inferior are prepended to PATH
|
// if qmake is not in PATH make sure the correct libs for inferior are prepended to PATH
|
||||||
if (m_qmakeBinary != "qmake") {
|
if (m_qmakeBinary != "qmake") {
|
||||||
@@ -822,10 +827,9 @@ void tst_Dumpers::initTestCase()
|
|||||||
m_env = env.toProcessEnvironment();
|
m_env = env.toProcessEnvironment();
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (m_makeBinary.isEmpty()) {
|
if (m_makeBinary.isEmpty())
|
||||||
m_makeBinary = QLatin1String("make");
|
m_makeBinary = QLatin1String("make");
|
||||||
#endif
|
#endif
|
||||||
}
|
|
||||||
qDebug() << "Make path : " << m_makeBinary;
|
qDebug() << "Make path : " << m_makeBinary;
|
||||||
qDebug() << "Gdb version : " << m_gdbVersion;
|
qDebug() << "Gdb version : " << m_gdbVersion;
|
||||||
} else if (m_debuggerEngine == CdbEngine) {
|
} else if (m_debuggerEngine == CdbEngine) {
|
||||||
|
|||||||
@@ -3,11 +3,27 @@ import "../../../autotest.qbs" as Autotest
|
|||||||
|
|
||||||
Autotest {
|
Autotest {
|
||||||
name: "QmlProjectManager file format autotest"
|
name: "QmlProjectManager file format autotest"
|
||||||
Depends { name: "QmlProjectManager" }
|
Depends { name: "QmlJS" }
|
||||||
Depends { name: "Utils" }
|
Depends { name: "Utils" }
|
||||||
Depends { name: "Qt"; submodules: ["script", "declarative"]; }
|
Depends { name: "Qt"; submodules: ["script", "declarative"]; }
|
||||||
Depends { name: "Qt.widgets" } // TODO: Remove when qbs bug is fixed
|
Depends { name: "Qt.widgets" } // TODO: Remove when qbs bug is fixed
|
||||||
|
property path fileFormatDir: project.ide_source_tree + "/src/plugins/qmlprojectmanager/fileformat"
|
||||||
files: "tst_fileformat.cpp"
|
files: "tst_fileformat.cpp"
|
||||||
cpp.includePaths: base.concat([project.ide_source_tree + "/src/plugins/qmlprojectmanager/fileformat"])
|
Group {
|
||||||
cpp.defines: base.concat(['SRCDIR="' + path + '"'])
|
name: "Files from QmlProjectManager"
|
||||||
|
prefix: product.fileFormatDir + '/'
|
||||||
|
files: [
|
||||||
|
"filefilteritems.cpp",
|
||||||
|
"filefilteritems.h",
|
||||||
|
"qmlprojectfileformat.cpp",
|
||||||
|
"qmlprojectfileformat.h",
|
||||||
|
"qmlprojectitem.cpp",
|
||||||
|
"qmlprojectitem.h",
|
||||||
|
]
|
||||||
|
}
|
||||||
|
cpp.includePaths: base.concat([fileFormatDir])
|
||||||
|
cpp.defines: base.concat([
|
||||||
|
'QT_CREATOR',
|
||||||
|
'SRCDIR="' + path + '"'
|
||||||
|
])
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,11 @@
|
|||||||
#define USE_PRIVATE 1
|
#define USE_PRIVATE 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAS_EIGEN
|
#ifdef HAS_EIGEN2
|
||||||
|
#define USE_EIGEN 1
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef HAS_EIGEN3
|
||||||
#define USE_EIGEN 1
|
#define USE_EIGEN 1
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -231,7 +235,7 @@ void dummyStatement(...) {}
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_EIGEN
|
#if USE_EIGEN
|
||||||
#include <eigen2/Eigen/Core>
|
#include <Eigen/Core>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_PRIVATE
|
#if USE_PRIVATE
|
||||||
@@ -1781,7 +1785,9 @@ namespace qobject {
|
|||||||
QObject child(&parent);
|
QObject child(&parent);
|
||||||
child.setObjectName("A Child");
|
child.setObjectName("A Child");
|
||||||
QObject::connect(&child, SIGNAL(destroyed()), &parent, SLOT(deleteLater()));
|
QObject::connect(&child, SIGNAL(destroyed()), &parent, SLOT(deleteLater()));
|
||||||
|
QObject::connect(&child, SIGNAL(destroyed()), &child, SLOT(deleteLater()));
|
||||||
QObject::disconnect(&child, SIGNAL(destroyed()), &parent, SLOT(deleteLater()));
|
QObject::disconnect(&child, SIGNAL(destroyed()), &parent, SLOT(deleteLater()));
|
||||||
|
QObject::disconnect(&child, SIGNAL(destroyed()), &child, SLOT(deleteLater()));
|
||||||
child.setObjectName("A renamed Child");
|
child.setObjectName("A renamed Child");
|
||||||
BREAK_HERE;
|
BREAK_HERE;
|
||||||
// Check child "A renamed Child" QObject.
|
// Check child "A renamed Child" QObject.
|
||||||
@@ -1813,6 +1819,7 @@ namespace qobject {
|
|||||||
Q_PROPERTY(QString myProp1 READ myProp1 WRITE setMyProp1)
|
Q_PROPERTY(QString myProp1 READ myProp1 WRITE setMyProp1)
|
||||||
QString myProp1() const { return m_myProp1; }
|
QString myProp1() const { return m_myProp1; }
|
||||||
Q_SLOT void setMyProp1(const QString&mt) { m_myProp1 = mt; }
|
Q_SLOT void setMyProp1(const QString&mt) { m_myProp1 = mt; }
|
||||||
|
Q_INVOKABLE void foo() {}
|
||||||
|
|
||||||
Q_PROPERTY(QString myProp2 READ myProp2 WRITE setMyProp2)
|
Q_PROPERTY(QString myProp2 READ myProp2 WRITE setMyProp2)
|
||||||
QString myProp2() const { return m_myProp2; }
|
QString myProp2() const { return m_myProp2; }
|
||||||
@@ -1824,6 +1831,9 @@ namespace qobject {
|
|||||||
Q_PROPERTY(long myProp4 READ myProp4)
|
Q_PROPERTY(long myProp4 READ myProp4)
|
||||||
long myProp4() const { return 44; }
|
long myProp4() const { return 44; }
|
||||||
|
|
||||||
|
Q_SIGNAL void sigFoo();
|
||||||
|
Q_SIGNAL void sigBar(int);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Ui *m_ui;
|
Ui *m_ui;
|
||||||
QString m_myProp1;
|
QString m_myProp1;
|
||||||
|
|||||||
@@ -44,7 +44,23 @@ maemo5 {
|
|||||||
|
|
||||||
exists($$QMAKE_INCDIR_QT/QtCore/private/qobject_p.h):DEFINES += HAS_PRIVATE
|
exists($$QMAKE_INCDIR_QT/QtCore/private/qobject_p.h):DEFINES += HAS_PRIVATE
|
||||||
exists(/usr/include/boost/optional.hpp): DEFINES += HAS_BOOST
|
exists(/usr/include/boost/optional.hpp): DEFINES += HAS_BOOST
|
||||||
exists(/usr/include/eigen2/Eigen/Core): DEFINES += HAS_EIGEN
|
|
||||||
|
exists(/usr/include/eigen2/Eigen/Core) {
|
||||||
|
DEFINES += HAS_EIGEN2
|
||||||
|
INCLUDEPATH += /usr/include/eigen2
|
||||||
|
}
|
||||||
|
exists(/usr/include/eigen3/Eigen/Core) {
|
||||||
|
DEFINES += HAS_EIGEN3
|
||||||
|
INCLUDEPATH += /usr/include/eigen3
|
||||||
|
}
|
||||||
|
exists(/usr/local/include/eigen2/Eigen/Core) {
|
||||||
|
DEFINES += HAS_EIGEN2
|
||||||
|
INCLUDEPATH += /usr/local/include/eigen2
|
||||||
|
}
|
||||||
|
exists(/usr/local/include/eigen3/Eigen/Core) {
|
||||||
|
DEFINES += HAS_EIGEN3
|
||||||
|
INCLUDEPATH += /usr/local/include/eigen3
|
||||||
|
}
|
||||||
|
|
||||||
win32-msvc*:DEFINES += _CRT_SECURE_NO_WARNINGS
|
win32-msvc*:DEFINES += _CRT_SECURE_NO_WARNINGS
|
||||||
# Use for semi-automated testing
|
# Use for semi-automated testing
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ def startQtCreatorWithNewAppAtQMLEditor(projectDir, projectName, line = None):
|
|||||||
# create qt quick application
|
# create qt quick application
|
||||||
createNewQtQuickApplication(projectDir, projectName)
|
createNewQtQuickApplication(projectDir, projectName)
|
||||||
# open qml file
|
# open qml file
|
||||||
qmlFile = projectName + ".Resources.qml\.qrc./.qml/main\\.qml"
|
qmlFile = projectName + ".Resources.qml\.qrc./.main\\.qml"
|
||||||
if not openDocument(qmlFile):
|
if not openDocument(qmlFile):
|
||||||
test.fatal("Could not open %s" % qmlFile)
|
test.fatal("Could not open %s" % qmlFile)
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ def main():
|
|||||||
test.passes("Refactoring was properly applied in source file")
|
test.passes("Refactoring was properly applied in source file")
|
||||||
else:
|
else:
|
||||||
test.fail("Refactoring of Text to MyComponent failed in source file. Content of editor:\n%s" % codeText)
|
test.fail("Refactoring of Text to MyComponent failed in source file. Content of editor:\n%s" % codeText)
|
||||||
myCompTE = "SampleApp.Resources.qml\\.qrc./.qml/MyComponent\\.qml"
|
myCompTE = "SampleApp.Resources.qml\\.qrc./.MyComponent\\.qml"
|
||||||
# there should be new QML file generated with name "MyComponent.qml"
|
# there should be new QML file generated with name "MyComponent.qml"
|
||||||
try:
|
try:
|
||||||
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", myCompTE, 3000)
|
waitForObjectItem(":Qt Creator_Utils::NavigationTreeView", myCompTE, 3000)
|
||||||
@@ -86,6 +86,6 @@ def main():
|
|||||||
#save and exit
|
#save and exit
|
||||||
invokeMenuItem("File", "Save All")
|
invokeMenuItem("File", "Save All")
|
||||||
# check if new file was created in file system
|
# check if new file was created in file system
|
||||||
test.verify(os.path.exists(os.path.join(projectDir, "SampleApp", "qml", "MyComponent.qml")),
|
test.verify(os.path.exists(os.path.join(projectDir, "SampleApp", "MyComponent.qml")),
|
||||||
"Verifying if MyComponent.qml exists in file system after save")
|
"Verifying if MyComponent.qml exists in file system after save")
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ def main():
|
|||||||
# create qt quick application
|
# create qt quick application
|
||||||
createNewQtQuickApplication(tempDir(), "SampleApp")
|
createNewQtQuickApplication(tempDir(), "SampleApp")
|
||||||
# create syntax error in qml file
|
# create syntax error in qml file
|
||||||
openDocument("SampleApp.Resources.qml\.qrc./.qml/main\\.qml")
|
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"), "Text {", "SyntaxError"):
|
||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -48,14 +48,14 @@ def main():
|
|||||||
'onTriggered: console.log("Break here")'])
|
'onTriggered: console.log("Break here")'])
|
||||||
invokeMenuItem("File", "Save All")
|
invokeMenuItem("File", "Save All")
|
||||||
filesAndLines = [
|
filesAndLines = [
|
||||||
{ "%s.Resources.qml\.qrc./.qml/main\\.qml" % projectName : 'onTriggered.*' },
|
{ "%s.Resources.qml\.qrc./.main\\.qml" % projectName : 'onTriggered.*' },
|
||||||
{ "%s.Sources.main\\.cpp" % projectName : "viewer.setOrientation\\(.+\\);" }
|
{ "%s.Sources.main\\.cpp" % projectName : "viewer.setOrientation\\(.+\\);" }
|
||||||
]
|
]
|
||||||
test.log("Setting breakpoints")
|
test.log("Setting breakpoints")
|
||||||
result = setBreakpointsForCurrentProject(filesAndLines)
|
result = setBreakpointsForCurrentProject(filesAndLines)
|
||||||
if result:
|
if result:
|
||||||
expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):10},
|
expectedBreakpointsOrder = [{os.path.join(workingDir, projectName, "main.cpp"):10},
|
||||||
{os.path.join(workingDir, projectName, "qml", "main.qml"):10}]
|
{os.path.join(workingDir, projectName, "main.qml"):10}]
|
||||||
# Only use 4.7.4 to work around QTBUG-25187
|
# Only use 4.7.4 to work around QTBUG-25187
|
||||||
availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug")
|
availableConfigs = iterateBuildConfigs(len(checkedTargets), "Debug")
|
||||||
progressBarWait()
|
progressBarWait()
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ def main():
|
|||||||
invokeMenuItem("File", "Exit")
|
invokeMenuItem("File", "Exit")
|
||||||
|
|
||||||
def prepareQmlFile():
|
def prepareQmlFile():
|
||||||
if not openDocument("untitled.Resources.qml\.qrc./.qml/main\\.qml"):
|
if not openDocument("untitled.Resources.qml\.qrc./.main\\.qml"):
|
||||||
test.fatal("Could not open main.qml")
|
test.fatal("Could not open main.qml")
|
||||||
return None
|
return None
|
||||||
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
editor = waitForObject(":Qt Creator_QmlJSEditor::QmlJSTextEditorWidget")
|
||||||
|
|||||||
@@ -39,6 +39,9 @@ def verifyCloneLog(targetDir, canceled):
|
|||||||
summary = "Failed."
|
summary = "Failed."
|
||||||
else:
|
else:
|
||||||
cloneLog = str(waitForObject(":Git Repository Clone.logPlainTextEdit_QPlainTextEdit").plainText)
|
cloneLog = str(waitForObject(":Git Repository Clone.logPlainTextEdit_QPlainTextEdit").plainText)
|
||||||
|
if "fatal: The remote end hung up unexpectedly" in cloneLog:
|
||||||
|
test.warning("Remote end hung up unexpectedly.")
|
||||||
|
return False
|
||||||
# test for QTCREATORBUG-10112
|
# test for QTCREATORBUG-10112
|
||||||
test.compare(cloneLog.count("remote: Counting objects:"), 1)
|
test.compare(cloneLog.count("remote: Counting objects:"), 1)
|
||||||
test.compare(cloneLog.count("remote: Finding sources:"), 1)
|
test.compare(cloneLog.count("remote: Finding sources:"), 1)
|
||||||
@@ -52,6 +55,7 @@ def verifyCloneLog(targetDir, canceled):
|
|||||||
resultLabel = findObject(":Git Repository Clone.Result._QLabel")
|
resultLabel = findObject(":Git Repository Clone.Result._QLabel")
|
||||||
test.verify(waitFor('str(resultLabel.text) == summary', 3000),
|
test.verify(waitFor('str(resultLabel.text) == summary', 3000),
|
||||||
"Verifying expected result (%s)" % summary)
|
"Verifying expected result (%s)" % summary)
|
||||||
|
return True
|
||||||
|
|
||||||
def verifyVersionControlView(targetDir, canceled):
|
def verifyVersionControlView(targetDir, canceled):
|
||||||
openVcsLog()
|
openVcsLog()
|
||||||
@@ -100,7 +104,9 @@ def main():
|
|||||||
verifyCloneLog(targetDir, True)
|
verifyCloneLog(targetDir, True)
|
||||||
clickButton(":Git Repository Clone.Cancel_QPushButton")
|
clickButton(":Git Repository Clone.Cancel_QPushButton")
|
||||||
else:
|
else:
|
||||||
verifyCloneLog(targetDir, False)
|
if not verifyCloneLog(targetDir, False):
|
||||||
|
clickButton(":Git Repository Clone.Cancel_QPushButton")
|
||||||
|
continue
|
||||||
verifyFiles(targetDir)
|
verifyFiles(targetDir)
|
||||||
try:
|
try:
|
||||||
clickButton(waitForObject(button))
|
clickButton(waitForObject(button))
|
||||||
|
|||||||