Merge remote-tracking branch 'origin/3.0'

Conflicts:
	src/plugins/qmakeprojectmanager/qmakeproject.cpp

Change-Id: Id6ac9051d2564788bb180e5a99243d588312ae99
This commit is contained in:
Eike Ziller
2013-10-30 13:34:46 +01:00
341 changed files with 3480 additions and 2241 deletions

View File

@@ -0,0 +1,103 @@
/****************************************************************************
**
** Copyright (c) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator
**
**
** GNU Free Documentation License
**
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of this
** file.
**
**
****************************************************************************/
// **********************************************************************
// NOTE: the sections are not ordered by their logical order to avoid
// reshuffling the file each time the index order changes (i.e., often).
// Run the fixnavi.pl script to adjust the links to the index order.
// **********************************************************************
import QtQuick 2.1
import QtQuick.Controls 1.0
import QtSensors 5.0
ApplicationWindow {
title: qsTr("Accelerate Bubble")
id: mainWindow
width: 640
height: 480
visible: true
Accelerometer {
id: accel
dataRate: 100
active:true
onReadingChanged: {
var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
if (newX < 0)
newX = 0
if (newX > mainWindow.width - bubble.width)
newX = mainWindow.width - bubble.width
if (newY < 18)
newY = 18
if (newY > mainWindow.height - bubble.height)
newY = mainWindow.height - bubble.height
bubble.x = newX
bubble.y = newY
}
}
function calcPitch(x, y, z) {
return -(Math.atan(y / Math.sqrt(x * x + z * z)) * 57.2957795);
}
function calcRoll(x, y, z) {
return -(Math.atan(x / Math.sqrt(y * y + z * z)) * 57.2957795);
}
Image {
id: bubble
source: "Bluebubble.svg"
smooth: true
property real centerX: mainWindow.width / 2
property real centerY: mainWindow.height / 2
property real bubbleCenter: bubble.width / 2
x: centerX - bubbleCenter
y: centerY - bubbleCenter
Behavior on y {
SmoothedAnimation {
easing.type: Easing.Linear
duration: 100
}
}
Behavior on x {
SmoothedAnimation {
easing.type: Easing.Linear
duration: 100
}
}
MenuBar {
Menu {
title: qsTr("File")
MenuItem {
text: qsTr("Exit")
onTriggered: Qt.quit();
}
}
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@@ -1,118 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
import QtQuick 2.1
import QtQuick.Controls 1.0
//! [sensorimport]
import QtSensors 5.0
//! [sensorimport]
ApplicationWindow {
title: "Accelerate Bubble"
id: mainWindow
width: 320
height: 480
visible: true
Accelerometer {
id: accel
dataRate: 100
active:true
//! [readingchanged]
onReadingChanged: {
var newX = (bubble.x + calcRoll(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
var newY = (bubble.y - calcPitch(accel.reading.x, accel.reading.y, accel.reading.z) * 0.1)
if (newX < 0)
newX = 0
if (newX > mainWindow.width - bubble.width)
newX = mainWindow.width - bubble.width
if (newY < 18)
newY = 18
if (newY > mainWindow.height - bubble.height)
newY = mainWindow.height - bubble.height
bubble.x = newX
bubble.y = newY
}
//! [readingchanged]
}
//! [jsfunctions]
function calcPitch(x, y, z) {
return -(Math.atan(y / Math.sqrt(x * x + z * z)) * 57.2957795);
}
function calcRoll(x, y, z) {
return -(Math.atan(x / Math.sqrt(y * y + z * z)) * 57.2957795);
}
//! [jsfunctions]
Image {
id: bubble
source: "Bluebubble.svg"
smooth: true
property real centerX: mainWindow.width / 2
property real centerY: mainWindow.height / 2;
property real bubbleCenter: bubble.width / 2
x: centerX - bubbleCenter
y: centerY - bubbleCenter
//! [smoothedanim]
Behavior on y {
SmoothedAnimation {
easing.type: Easing.Linear
duration: 100
}
}
Behavior on x {
SmoothedAnimation {
easing.type: Easing.Linear
duration: 100
}
}
//! [smoothedanim]
}
}

View File

@@ -1,47 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
//! [initialcode]
import QtQuick 2.0
Rectangle {
width: 100
height: 62
}
//! [initialcode]

View File

@@ -1,62 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
//! [imports]
import QtQuick 2.1
import QtQuick.Controls 1.0
//! [imports]
ApplicationWindow {
title: "Accelerate Bubble"
id: mainWindow
width: 320
height: 480
visible: true
Image {
id: bubble
source: "Bluebubble.svg"
smooth: true
property real centerX: mainWindow.width / 2
property real centerY: mainWindow.height / 2
property real bubbleCenter: bubble.width / 2
x: centerX - bubbleCenter
y: centerY - bubbleCenter
}
}

View File

@@ -1,7 +0,0 @@
RESOURCES += \
accelbubble.qrc
SOURCES += \
main.cpp
QT += quick sensors svg xml

View File

@@ -1,50 +0,0 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:BSD$
** You may use this file under the terms of the BSD license as follows:
**
** "Redistribution and use in source and binary forms, with or without
** modification, are permitted provided that the following conditions are
** met:
** * Redistributions of source code must retain the above copyright
** notice, this list of conditions and the following disclaimer.
** * Redistributions in binary form must reproduce the above copyright
** notice, this list of conditions and the following disclaimer in
** the documentation and/or other materials provided with the
** distribution.
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
** of its contributors may be used to endorse or promote products derived
** from this software without specific prior written permission.
**
**
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include <QtGui/QGuiApplication>
#include <QtQml/QQmlApplicationEngine>
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine engine(QUrl("qrc:///accelbubble.qml"));
return app.exec();
}

View File

@@ -41,20 +41,18 @@
\section1 Creating the Project
Let us start with creating an empty Qt project.
\list 1
\li Select \gui{File > New File or Project > Other Project >
Empty Qt Project > Choose}.
\li Select \gui File > \gui {New File or Project} > \gui Applications >
\gui {Qt Quick 2 Application (Qt Quick Controls)} > \gui Choose.
\li In the \gui{Name} field, type \b{accelbubble}.
\li In the \gui {Create in} field, enter the path for the project files.
For example, \c {C:\Qt\examples}, and then click \gui{Next} (on
Mac OS X, it is \gui Continue).
For example, \c {C:\Qt\examples}, and then click \gui{Next} (or
\gui Continue on Mac OS X).
\li Select an Android \l{glossary-buildandrun-kit}{kit} for arm,
\li Select an Android \l{glossary-buildandrun-kit}{kit} for ARM,
and click \gui{Next}.
\note Kits are listed if they have been specified in \gui Tools >
@@ -63,106 +61,73 @@
\li Select \gui Next in the following dialogs to use the default
settings.
\li Review the project settings, and click \gui{Finish} (on Mac OS X,
it is \gui Done).
\li Review the project settings, and click \gui{Finish} (or \gui Done on
Mac OS X).
\endlist
\QC creates the project and displays its contents under the \gui Projects
view on the sidebar. You can only see a .pro file under the project as we
created an empty project, but the remaining bits will be added
during the course of this tutorial.
\QC generates a default QML file that you can modify to create the main view
of the application.
\section1 Creating the Main View
The main view of the application displays an SVG bubble image at the center
of the main window.
\list 1
\li In the \gui Edit mode, right-click on the \b{accelbubble} project
and select \gui{Add new} to open the \gui{New File} dialog.
\li Select \gui{Qt > QML File (Qt Quick 2)} and click \gui Choose to
give a name to the QML file.
\li In the \gui Name field, type "accelbubble" and select \gui Next.
\li Select \gui Finish to add accelbubble.qml to the project.
\endlist
\QC adds a default QML file containing a Rectangle. Here is how the QML
file looks:
\snippet qml/tutorial_initialqml.qml initialcode
Now let us edit accelbubble.qml to add the bits required for our
application.
To use the Bluebubble.svg used by the Qt Sensors example, Accel Bubble, in
your project, you must copy it to the project directory (same subdirectory
as the QML file) from the examples directory in the Qt installation
directory. For example:
\c {C:\Qt\Qt5.2.0\5.2.0\msvc2010\examples\sensors\accelbubble\content}.
The image appears in the \gui Resources pane. You can also use any other
image or a QML type, instead.
\list 1
\li Replace the existing import statement with the following:
\li In the \gui Projects view, double-click the main.qml file
to open it in the code editor.
\snippet qml/tutorial_updatedmainview.qml imports
\li Modify the properties of the ApplicationWindow type to specify the
application name, give the ApplicationWindow an id, and to set it
visible, as illustrated by the following code snippet:
\li Replace the Rectangle type with ApplicationWindow, which
will be the top-level window for our application.
\li Set the \a id, \a title, \a visible, and the window dimension
properties (width and height) with the values given in the
following snippet:
\quotefromfile qml/tutorial_updatedmainview.qml
\quotefromfile accelbubble/main.qml
\skipto ApplicationWindow
\printuntil true
\printuntil visible
\skipto /^\}/
\printuntil }
\li Click \gui Design to open the file in \QMLD.
\li In the \gui Navigator pane, select \gui Button and press \key Delete
to delete it.
\li In the \gui Library view, \gui Resources tab, select Bluebubble.svg
and drag and drop it to the canvas.
\li In the \gui Properties pane, \gui Id field, enter \e bubble to be
able to reference the image from other places.
\li In the code editor, add the following new properties to the image to
position the image at the center of ApplicationWindow when the
application starts:
\quotefromfile accelbubble/main.qml
\skipto Image
\printuntil bubble.width
\li Set the x and y position of the image based on the new
properties:
\dots
\printuntil centerY
\skipto /^\}/
\printuntil }
\endlist
\section1 Adding an SVG Image
Here is how the accelbubble.qml file looks after you made the changes:
SVG is an XML-based image format that enables you to combine vector
graphics, raster graphics, and text into one image. It is based on
an open standard developed and maintained by \l{http://www.w3.org/}{W3C}.
Qt supports the \l{http://www.w3.org/TR/SVGTiny12/}{SVGT} v1.2, which is a
trimmed version of the \l{http://www.w3.org/TR/SVG12/}{SVG Full v1.2}
specification, for mobile devices.
You can copy the Bluebubble.svg used by the Qt Sensors example, Accel
Bubble, to your project directory or find an SVG image that uses SVGT v1.2.
\note If you choose to create a new SVG image, ensure that the \a svg root
element has the \a version attribute with the value 1.1 or 1.2, and baseProfile
with \c tiny.
\list 1
\li Open accelbubble.qml in \gui Edit mode and add an Image type
within the ApplicationWindow.
\li Set the image \a id, \a source, and \a smooth properties as shown
in the following code block:
\quotefromfile qml/tutorial_updatedmainview.qml
\skipto Image
\printuntil true
\li Add the following new properties to the image:
\dots
\printuntil bubbleCenter:
\note These properties are used to position the image
at the center of ApplicationWindow when the application starts.
\li Set the x and y position of the image based on the new
properties.
\dots
\printuntil }
\endlist
Here is how the accelbubble.qml file looks after making the changes
mentioned earlier in this section:
\quotefromfile qml/tutorial_updatedmainview.qml
\quotefromfile accelbubble/main.qml
\skipto import QtQuick
\printuntil 1.0
\codeline
@@ -170,7 +135,9 @@
\printuntil true
\skipto Image
\printuntil /^\}\
\printuntil y:
\skipto /^\}/
\printuntil }
\section1 Moving the Bubble
@@ -179,14 +146,15 @@
Accelerometer sensor values.
\list 1
\li Add the following import statement to accelbubble.qml:
\li Add the following import statement to main.qml:
\snippet qml/tutorial_finalmainqml.qml sensorimport
\code
import QtSensors 5.0
\endcode
\li Add the Accelerometer type with the necessary properties as shown
in the following code block:
\li Add the Accelerometer type with the necessary properties:
\quotefromfile qml/tutorial_finalmainqml.qml
\quotefromfile accelbubble/main.qml
\skipto Accelerometer
\printuntil true
\skipto }
@@ -196,93 +164,61 @@
x and y position of the bubble based on the current Accelerometer
values:
\snippet qml/tutorial_finalmainqml.qml jsfunctions
\quotefromfile accelbubble/main.qml
\skipto function
\printuntil Math.atan(x
\printuntil }
\li Add the following JavaScript code for \a onReadingChanged signal of
Accelerometer type to make the bubble move when the Accelerometer
values change:
\snippet qml/tutorial_finalmainqml.qml readingchanged
\quotefromfile accelbubble/main.qml
\skipto onReadingChanged
\printuntil }
\li Add SmoothedAnimation behavior on the \a x and \a y properties of
the bubble to make its movement look smoother.
\snippet qml/tutorial_finalmainqml.qml smoothedanim
\quotefromfile accelbubble/main.qml
\skipto Behavior
\printuntil x
\printuntil }
\printuntil }
\endlist
\section1 Adding Dependencies
\section1 Running the Application
The main view is complete but the application is not ready yet. This
section provides instructions to add a few lines of C++ code that loads the
QML file when you try to run the application on an Android device.
\list 1
\li Right-click on the project in \gui Edit mode and select
\gui{Add New > Qt > Qt Resource File}.
\li Name the resource file as \a accelbubble.qrc and click \gui Next.
\li Select \gui Finish in the following dialog to add the resource file
to the project and open it in \gui Edit mode.
\li Select \gui {Add > Add Prefix} and add \c / as the prefix.
\note The prefix is used every time you refer to the .qrc file
contents from the C++ code.
\li Select \gui {Add > Add Files} and add accelbubble.qml and Bluebubble.svg
to the resource file.
\li Right-click on the project in \gui Edit mode and select
\gui {Add New} to open the \gui {New File} dialog.
\li Select \gui {C++ > C++ Source File > Choose}
\li Name the file as \a main.cpp and click \gui Next.
\li Select \gui Finish to add main.cpp to the project and open it in
edit mode.
\li Add the following lines of C++ code to main.cpp to load the
accelbubble.qml file from accelbubble.qrc:
\quotefromfile tutorial_main.cpp
\skipto #include
\printuntil }
\li Update the accelbubble.pro file with the following library
dependency information:
Update the accelbubble.pro file with the following library dependency
information:
\code
QT += quick sensors svg xml
\endcode
\endlist
The application is complete and ready to be deployed to the device.
Enable "USB Debugging" on your Android device and connect it to your PC.
\section1 Running the Application
The application is complete and ready to be deployed to an Android device:
\list 1
\li Enable \e{USB Debugging} on the device.
\li Connect the device to the development PC.
If you are using a device running Android v4.2.2, it should prompt you to
verify the connection to allow USB debugging from the PC it is connected
to. To avoid such prompts every time you connect the device, check
"Always allow from the computer" and select \gui OK.
To run the application on the device, press CTRL + R keys in \QC
\gui Edit mode.
\li To run the application on the device, press \key {Ctrl+R}.
\endlist
\section1 Example Code
When you have completed the steps mentioned in the earlier sections, the
accelbubble.qml, main.cpp, and accelbubble.pro files look as follows:
When you have completed the steps, the main.qml file should look as follows:
\section2 accelbubble.qml
\quotefile accelbubble/main.qml
\quotefile qml/tutorial_finalmainqml.qml
\section2 main.cpp
\quotefile tutorial_main.cpp
\section2 accelbubble.pro
\quotefile tutorial_accelbubble.pro
*/

View File

@@ -34,8 +34,6 @@
\row
\li \inlineimage creator-gs-01.png
\li \inlineimage creator-gs-02.png
\li \inlineimage creator-gs-03.png
\li \inlineimage creator-gs-04.png
\row
\li \b {\l{IDE Overview}}
@@ -46,6 +44,10 @@
If you have not used \QC before, and want to become familiar
with the parts of the user interface, go to \l{User Interface}.
\row
\li \inlineimage creator-gs-03.png
\li \inlineimage creator-gs-04.png
\row
\li \b {\l{Building and Running an Example}}
To check that \l{glossary-buildandrun-kit}{kits} for building and running were

View File

@@ -340,6 +340,34 @@ class DumperBase:
def stringData(self, value):
return self.byteArrayDataHelper(self.dereferenceValue(value))
def extractTemplateArgument(self, typename, position):
level = 0
skipSpace = False
inner = ''
for c in typename[typename.find('<') + 1 : -1]:
if c == '<':
inner += c
level += 1
elif c == '>':
level -= 1
inner += c
elif c == ',':
if level == 0:
if position == 0:
return inner.strip()
position -= 1
inner = ''
else:
inner += c
skipSpace = True
else:
if skipSpace and c == ' ':
pass
else:
inner += c
skipSpace = False
return inner.strip()
def putStringValue(self, value):
return self.putValue(self.encodeString(value), Hex4EncodedLittleEndian)

View File

@@ -596,35 +596,6 @@ def lookupType(typestring):
typesToReport[typestring] = type
return type
def extractTemplateArgument(type, position):
level = 0
skipSpace = False
inner = ""
type = str(type)
for c in type[type.find('<') + 1 : -1]:
if c == '<':
inner += c
level += 1
elif c == '>':
level -= 1
inner += c
elif c == ',':
if level == 0:
if position == 0:
return inner
position -= 1
inner = ""
else:
inner += c
skipSpace = True
else:
if skipSpace and c == ' ':
pass
else:
inner += c
skipSpace = False
return inner
def templateArgument(type, position):
try:
# This fails on stock 7.2 with
@@ -632,7 +603,7 @@ def templateArgument(type, position):
return type.template_argument(position)
except:
# That's something like "myns::QList<...>"
return lookupType(extractTemplateArgument(type.strip_typedefs(), position))
return lookupType(self.extractTemplateArgument(str(type.strip_typedefs()), position))
# Workaround for gdb < 7.1

View File

@@ -431,34 +431,6 @@ class Dumper(DumperBase):
def directBaseClass(self, typeobj, index = 0):
return typeobj.GetDirectBaseClassAtIndex(index)
def extractTemplateArgument(self, typename, index):
level = 0
skipSpace = False
inner = ''
for c in typename[typename.find('<') + 1 : -1]:
if c == '<':
inner += c
level += 1
elif c == '>':
level -= 1
inner += c
elif c == ',':
if level == 0:
if index == 0:
return inner.strip()
index -= 1
inner = ''
else:
inner += c
skipSpace = True
else:
if skipSpace and c == ' ':
pass
else:
inner += c
skipSpace = False
return inner.strip()
def templateArgument(self, typeobj, index):
type = typeobj.GetTemplateArgumentType(index)
if type.IsValid():
@@ -705,7 +677,10 @@ class Dumper(DumperBase):
self.startMode_ = args.get('startMode', 1)
self.processArgs_ = args.get('processArgs', '')
self.attachPid_ = args.get('attachPid', 0)
self.sysRoot_ = args.get('sysRoot', '')
if len(self.sysRoot_)>0:
self.debugger.SetCurrentPlatformSDKRoot(self.sysRoot_)
self.target = self.debugger.CreateTarget(self.executable_, None, None, True, error)
self.importDumpers()
@@ -723,7 +698,6 @@ class Dumper(DumperBase):
if self.attachPid_ > 0:
attachInfo = lldb.SBAttachInfo(self.attachPid_)
self.process = self.target.Attach(attachInfo, error)
else:
launchInfo = lldb.SBLaunchInfo(self.processArgs_.split(' '))
launchInfo.SetWorkingDirectory(os.getcwd())
@@ -1613,7 +1587,6 @@ class Dumper(DumperBase):
self.useFancy = int(args['fancy'])
if 'passexceptions' in args:
self.passExceptions = int(args['passexceptions'])
self.passExceptions = True # FIXME
self.reportVariables(args)
def disassemble(self, args):

View File

@@ -541,10 +541,12 @@ def qdump__QHash(d, value):
it = nodePtr.dereference().cast(innerType)
with SubItem(d, i):
if isCompact:
# cannot reference "key" directly because it is inside
# anonymous union for (u)int key in Qt4
keyAddress = d.addressOf(it) + d.ptrSize() # addr + QHashNode*
d.putMapName(d.createValue(keyAddress, keyType))
key = it["key"]
if not key:
# LLDB can't access directly since it's in anonymous union
# for Qt4 optimized int keytype
key = it[1]["key"]
d.putMapName(key)
d.putItem(it["value"])
d.putType(valueType)
else:
@@ -553,17 +555,13 @@ def qdump__QHash(d, value):
def qdump__QHashNode(d, value):
keyType = d.templateArgument(value.type, 0)
valueType = d.templateArgument(value.type, 1)
key = value["key"]
if not key:
# LLDB can't access directly since it's in anonymous union
# for Qt4 optimized int keytype
key = value[1]["key"]
val = value["value"]
#if d.isSimpleType(keyType) and d.isSimpleType(valueType):
# d.putName(key)
# d.putValue(val)
#else:
d.putEmptyValue()
d.putNumChild(2)
if d.isExpanded():
with Children(d):

View File

@@ -985,6 +985,29 @@ QObject *ObjectNodeInstance::createComponent(const QString &componentPath, QQmlC
return object;
}
QObject *ObjectNodeInstance::createComponent(const QUrl &componentUrl, QQmlContext *context)
{
ComponentCompleteDisabler disableComponentComplete;
Q_UNUSED(disableComponentComplete)
QQmlComponent component(context->engine(), componentUrl);
QObject *object = component.beginCreate(context);
tweakObjects(object);
component.completeCreate();
if (component.isError()) {
qDebug() << componentUrl;
foreach (const QQmlError &error, component.errors())
qDebug() << error;
}
QQmlEngine::setObjectOwnership(object, QQmlEngine::CppOwnership);
return object;
}
QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource, const QStringList &imports, QQmlContext *context)
{
ComponentCompleteDisabler disableComponentComplete;
@@ -1013,6 +1036,11 @@ QObject *ObjectNodeInstance::createCustomParserObject(const QString &nodeSource,
return object;
}
static QQmlType *getQmlType(const QString &typeName, int majorNumber, int minorNumber)
{
return QQmlMetaType::qmlType(typeName.toUtf8(), majorNumber, minorNumber);
}
QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorNumber, int minorNumber, QQmlContext *context)
{
ComponentCompleteDisabler disableComponentComplete;
@@ -1020,13 +1048,16 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
Q_UNUSED(disableComponentComplete)
QObject *object = 0;
QQmlType *type = QQmlMetaType::qmlType(typeName.toUtf8(), majorNumber, minorNumber);
if (type) {
QQmlType *type = getQmlType(typeName, majorNumber, minorNumber);
if (type && !type->isComposite()) {
if (type->typeName() == "QQmlComponent") {
object = new QQmlComponent(context->engine(), 0);
} else {
object = type->create();
}
} else if (type->isComposite()) {
object = createComponent(type->sourceUrl(), context);
} else {
qWarning() << "QuickDesigner: Cannot create an object of type"
<< QString("%1 %2,%3").arg(typeName).arg(majorNumber).arg(minorNumber)

View File

@@ -74,6 +74,7 @@ public:
static QObject *createPrimitive(const QString &typeName, int majorNumber, int minorNumber, QQmlContext *context);
static QObject *createCustomParserObject(const QString &nodeSource, const QStringList &imports, QQmlContext *context);
static QObject *createComponent(const QString &componentPath, QQmlContext *context);
static QObject *createComponent(const QUrl &componentUrl, QQmlContext *context);
static QObject *createComponentWrap(const QString &nodeSource, const QStringList &imports, QQmlContext *context);
void setInstanceId(qint32 id);

View File

@@ -169,6 +169,13 @@ Rectangle {
id: specificsTwo;
sourceComponent: specificQmlComponent
property string theSource: specificQmlData
onTheSourceChanged: {
active = false
active = true
}
}
Loader {

View File

@@ -1,24 +0,0 @@
import bb.cascades 1.0
Page {
id: seconPage
paneProperties: NavigationPaneProperties {
backButton: ActionItem {
onTriggered: {
navigationPane.pop()
}
}
}
Container {
layout: DockLayout {}
Label {
text: qsTr("Hello Cascades!")
horizontalAlignment: HorizontalAlignment.Center
verticalAlignment: VerticalAlignment.Center
textStyle {
base: SystemDefaults.TextStyles.TitleText
}
}
}
}

View File

@@ -1,37 +1,13 @@
import bb.cascades 1.0
NavigationPane {
id: navigationPane
Page {
Container {
layout: DockLayout { }
Button {
horizontalAlignment: HorizontalAlignment.Center
Label {
text: qsTr("Hello World")
textStyle.base: SystemDefaults.TextStyles.BigText
verticalAlignment: VerticalAlignment.Center
text: qsTr("Next")
onClicked: {
var page = getSecondPage();
navigationPane.push(page);
}
property Page secondPage
function getSecondPage() {
if (! secondPage) {
secondPage = secondPageDefinition.createObject();
}
return secondPage;
}
attachedObjects: [
ComponentDefinition {
id: secondPageDefinition
source: "SecondPage.qml"
}
]
horizontalAlignment: HorizontalAlignment.Center
}
}
}
onCreationCompleted: {
console.log("NavigationPane - onCreationCompleted()");
OrientationSupport.supportedDisplayOrientation = SupportedDisplayOrientation.All;
}
}

View File

@@ -4,14 +4,25 @@
<name>%ProjectName%</name>
<versionNumber>1.0.0</versionNumber>
<description>DESCRIPTION</description>
<initialWindow>
<systemChrome>none</systemChrome>
<transparent>false</transparent>
<autoOrients>true</autoOrients>
<aspectRatio>landscape</aspectRatio>
</initialWindow>
<!-- The icon for the application, which should be 114x114. -->
<icon>
<image>icon.png</image>
</icon>
<env value="app/native/lib:/usr/lib/qt4/lib/" var="LD_LIBRARY_PATH"/>
<action system="true">run_native</action>
<asset path="%ProjectName%" type="Qnx/Elf" entry="true">%ProjectName%</asset>
<!-- Application assets -->
<asset path="%SRC_DIR%/icon.png">icon.png</asset>
<asset path="%SRC_DIR%/assets">assets</asset>
<asset path="%ProjectName%" type="Qnx/Elf" entry="true">%ProjectName%</asset>
</qnx>

View File

@@ -1,13 +0,0 @@
#include "%ProjectName%.hpp"
#include <bb/cascades/Application>
#include <Qt/qdeclarativedebug.h>
Q_DECL_EXPORT int main(int argc, char **argv)
{
bb::cascades::Application app(argc, argv);
new %ProjectName:s%(&app);
return bb::cascades::Application::exec();
}

View File

@@ -1,14 +0,0 @@
#include "%ProjectName%.hpp"
#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>
%ProjectName:s%::%ProjectName:s%(bb::cascades::Application *app)
: QObject(app)
{
bb::cascades::QmlDocument *qml = bb::cascades::QmlDocument::create("asset:///main.qml").parent(this);
bb::cascades::AbstractPane *root = qml->createRootObject<bb::cascades::AbstractPane>();
app->setScene(root);
}

View File

@@ -1,16 +0,0 @@
#ifndef %ProjectName:h%_HPP_
#define %ProjectName:h%_HPP_
#include <QObject>
namespace bb { namespace cascades { class Application; }}
class %ProjectName:s% : public QObject
{
Q_OBJECT
public:
%ProjectName:s%(bb::cascades::Application *app);
virtual ~%ProjectName:s%() {}
};
#endif /* %ProjectName:h%_HPP_ */

View File

@@ -3,11 +3,15 @@ TEMPLATE = app
LIBS += -lbbdata -lbb -lbbcascades
QT += declarative xml
SOURCES += main.cpp \
%ProjectName%.cpp
SOURCES += \
src/main.cpp \
src/applicationui.cpp \
HEADERS += %ProjectName%.hpp
HEADERS += \
src/applicationui.h \
OTHER_FILES += bar-descriptor.xml \
OTHER_FILES += \
bar-descriptor.xml \
assets/main.qml \
assets/SecondPage.qml

View File

@@ -0,0 +1,22 @@
#include "applicationui.h"
#include <bb/cascades/Application>
#include <bb/cascades/QmlDocument>
#include <bb/cascades/AbstractPane>
using namespace bb::cascades;
ApplicationUI::ApplicationUI(bb::cascades::Application *app) :
QObject(app)
{
// By default the QmlDocument object is owned by the Application instance
// and will have the lifespan of the application
QmlDocument *qml = QmlDocument::create("asset:///main.qml");
// Create root object for the UI
AbstractPane *root = qml->createRootObject<AbstractPane>();
// Set created root object as the application scene
app->setScene(root);
}

View File

@@ -0,0 +1,20 @@
#ifndef APPLICATIONUI_H
#define APPLICATIONUI_H
#include <QObject>
namespace bb {
namespace cascades {
class Application;
}
}
class ApplicationUI : public QObject
{
Q_OBJECT
public:
ApplicationUI(bb::cascades::Application *app);
virtual ~ApplicationUI() {}
};
#endif /* APPLICATIONUI_H */

View File

@@ -0,0 +1,19 @@
#include "applicationui.h"
#include <bb/cascades/Application>
#include <Qt/qdeclarativedebug.h>
using namespace bb::cascades;
Q_DECL_EXPORT int main(int argc, char **argv)
{
Application app(argc, argv);
// Create the Application UI object, this is where the main.qml file
// is loaded and the application scene is set.
new ApplicationUI(&app);
// Enter the application main event loop.
return Application::exec();
}

View File

@@ -38,12 +38,12 @@
<displayname>BlackBerry Cascades Application</displayname>;
<description>Creates a Cascades application for BlackBerry 10.</description>
<files>
<file source="main.cpp" openeditor="true"/>
<file source="assets/main.qml" openeditor="true"/>
<file source="assets/SecondPage.qml" openeditor="true"/>
<file source="bar-descriptor.xml" openeditor="true"/>
<file source="project.pro" target="%ProjectName%.pro" openproject="true"/>
<file source="project.hpp" target="%ProjectName%.hpp" openproject="true"/>
<file source="project.cpp" target="%ProjectName%.cpp" openproject="true"/>
<file source="src/main.cpp" openeditor="true"/>
<file source="src/applicationui.h" openproject="true"/>
<file source="src/applicationui.cpp" openproject="true"/>
<file source="icon.png"/>
</files>
</wizard>

View File

@@ -41,7 +41,7 @@ void functionUser(Utils::function<int()> generator, Utils::function<void(int)> c
struct GenFunctor
{
int operator()() const { return 29; }
int operator()() { return 29; }
};
struct ConsumerFunctor
@@ -49,13 +49,6 @@ struct ConsumerFunctor
void operator()(int) {}
};
struct ConsumerFunctor2
{
ConsumerFunctor2() : i(0) { }
int i;
void operator()(int j) { i = j; }
};
int generatorF()
{
return 42;
@@ -71,9 +64,6 @@ void test()
{
functionUser(GenFunctor(), ConsumerFunctor());
functionUser(&generatorF, &consumerF);
ConsumerFunctor2 f2;
GenFunctor g2;
functionUser(Utils::cref(g2), Utils::ref(f2));
}
} // end namespace

View File

@@ -39,9 +39,9 @@
# ifdef __GNUC__
# include <tr1/functional>
# endif
namespace Utils { using std::tr1::function; using std::tr1::ref; using std::tr1::cref; }
namespace Utils { using std::tr1::function; }
#else
namespace Utils { using std::function; using std::ref; using std::cref; }
namespace Utils { using std::function; }
#endif
#endif // QTC_FUNCTION_H

View File

@@ -50,15 +50,6 @@ QTCREATOR_UTILS_EXPORT QString winGetDLLVersion(WinDLLVersionType t,
const QString &name,
QString *errorMessage);
// Return the short (8.3) file name
QTCREATOR_UTILS_EXPORT QString getShortPathName(const QString &name);
// Returns long name
QTCREATOR_UTILS_EXPORT QString getLongPathName(const QString &name);
// Returns long name with canonical capitalization.
QTCREATOR_UTILS_EXPORT QString normalizePathName(const QString &name);
QTCREATOR_UTILS_EXPORT bool winIs64BitSystem();
// Check for a 64bit binary.

View File

@@ -7,7 +7,7 @@ QtcPlugin {
Depends { name: "Core" }
Depends { name: "ProjectExplorer" }
Depends { name: "Qt4ProjectManager" }
Depends { name: "QmakeProjectManager" }
Depends { name: "Debugger" }
Depends { name: "QmlDebug" }
Depends { name: "QtSupport" }

View File

@@ -3,7 +3,7 @@ QTC_PLUGIN_DEPENDS += \
coreplugin \
debugger \
projectexplorer \
qt4projectmanager \
qmakeprojectmanager \
qtsupport \
texteditor \
analyzerbase

View File

@@ -43,9 +43,9 @@
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qtsupport/qtkitinformation.h>
#include <QDir>
@@ -86,7 +86,7 @@ static QStringList qtSoPaths(QtSupport::BaseQtVersion *qtVersion)
RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *runConfig, QString *errorMessage)
{
Target *target = runConfig->target();
Qt4Project *project = static_cast<Qt4Project *>(target->project());
QmakeProject *project = static_cast<QmakeProject *>(target->project());
DebuggerStartParameters params;
params.startMode = AttachToRemoteServer;
@@ -102,11 +102,11 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
if (ToolChain *tc = ToolChainKitInformation::toolChain(kit))
params.toolChainAbi = tc->targetAbi();
params.executable = project->rootQt4ProjectNode()->buildDir() + QLatin1String("/app_process");
params.executable = project->rootQmakeProjectNode()->buildDir() + QLatin1String("/app_process");
params.remoteChannel = runConfig->remoteChannel();
params.solibSearchPath.clear();
QList<Qt4ProFileNode *> nodes = project->allProFiles();
foreach (Qt4ProFileNode *node, nodes)
QList<QmakeProFileNode *> nodes = project->allProFiles();
foreach (QmakeProFileNode *node, nodes)
if (node->projectType() == ApplicationTemplate)
params.solibSearchPath.append(node->targetInformation().buildDir);
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(kit);
@@ -121,8 +121,8 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.remoteSetupNeeded = true;
//TODO: Not sure if these are the right paths.
params.projectSourceDirectory = project->projectDirectory();
params.projectSourceFiles = project->files(Qt4Project::ExcludeGeneratedFiles);
params.projectBuildDirectory = project->rootQt4ProjectNode()->buildDir();
params.projectSourceFiles = project->files(QmakeProject::ExcludeGeneratedFiles);
params.projectBuildDirectory = project->rootQmakeProjectNode()->buildDir();
}
DebuggerRunControl * const debuggerRunControl

View File

@@ -39,7 +39,7 @@
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -124,7 +124,7 @@ DeployConfiguration *AndroidDeployConfigurationFactory::clone(Target *parent, De
QList<Core::Id> AndroidDeployConfigurationFactory::availableCreationIds(Target *parent) const
{
QList<Core::Id> ids;
if (!qobject_cast<QmakeProjectManager::Qt4Project *>(parent->project()))
if (!qobject_cast<QmakeProjectManager::QmakeProject *>(parent->project()))
return ids;
if (!parent->project()->supportsKit(parent->kit()))

View File

@@ -45,9 +45,9 @@
#include <projectexplorer/target.h>
#include <projectexplorer/project.h>
#include <qtsupport/qtkitinformation.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <QInputDialog>
#include <QMessageBox>
@@ -188,8 +188,8 @@ bool AndroidDeployQtStep::init()
m_serialNumber = info.serialNumber;
}
QmakeProjectManager::Qt4BuildConfiguration *bc
= static_cast<QmakeProjectManager::Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
QmakeProjectManager::QmakeBuildConfiguration *bc
= static_cast<QmakeProjectManager::QmakeBuildConfiguration *>(target()->activeBuildConfiguration());
if (m_signPackage) {
// check keystore and certificate passwords
@@ -345,11 +345,11 @@ void AndroidDeployQtStep::runCommand(const QString &program, const QStringList &
void AndroidDeployQtStep::updateInputFile()
{
QmakeProjectManager::Qt4Project *pro = static_cast<QmakeProjectManager::Qt4Project *>(project());
QList<QmakeProjectManager::Qt4ProFileNode *> nodes = pro->applicationProFiles();
QmakeProjectManager::QmakeProject *pro = static_cast<QmakeProjectManager::QmakeProject *>(project());
QList<QmakeProjectManager::QmakeProFileNode *> nodes = pro->applicationProFiles();
QStringList inputFiles;
foreach (QmakeProjectManager::Qt4ProFileNode *node, nodes)
foreach (QmakeProjectManager::QmakeProFileNode *node, nodes)
inputFiles << node->singleVariableValue(QmakeProjectManager::AndroidDeploySettingsFile);
if (!inputFiles.contains(m_inputFile))

View File

@@ -38,9 +38,9 @@
#include "androidextralibrarylistmodel.h"
#include <projectexplorer/target.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <QFileDialog>
@@ -135,7 +135,7 @@ AndroidDeployQtWidget::AndroidDeployQtWidget(AndroidDeployQtStep *step)
connect(m_ui->createAndroidManifestButton, SIGNAL(clicked()),
this, SLOT(createManifestButton()));
m_extraLibraryListModel = new AndroidExtraLibraryListModel(static_cast<QmakeProjectManager::Qt4Project *>(m_step->project()),
m_extraLibraryListModel = new AndroidExtraLibraryListModel(static_cast<QmakeProjectManager::QmakeProject *>(m_step->project()),
this);
m_ui->androidExtraLibsListView->setModel(m_extraLibraryListModel);
@@ -156,8 +156,8 @@ AndroidDeployQtWidget::~AndroidDeployQtWidget()
void AndroidDeployQtWidget::checkProjectTemplate()
{
QmakeProjectManager::Qt4Project *project = static_cast<QmakeProjectManager::Qt4Project *>(m_step->project());
if (project->rootQt4ProjectNode()->projectType() == QmakeProjectManager::ApplicationTemplate)
QmakeProjectManager::QmakeProject *project = static_cast<QmakeProjectManager::QmakeProject *>(m_step->project());
if (project->rootQmakeProjectNode()->projectType() == QmakeProjectManager::ApplicationTemplate)
m_ui->additionalLibrariesGroupBox->setEnabled(true);
else
m_ui->additionalLibrariesGroupBox->setEnabled(false);
@@ -171,9 +171,9 @@ void AndroidDeployQtWidget::createManifestButton()
void AndroidDeployQtWidget::updateInputFileUi()
{
QmakeProjectManager::Qt4Project *project
= static_cast<QmakeProjectManager::Qt4Project *>(m_step->project());
QList<QmakeProjectManager::Qt4ProFileNode *> nodes = project->applicationProFiles();
QmakeProjectManager::QmakeProject *project
= static_cast<QmakeProjectManager::QmakeProject *>(m_step->project());
QList<QmakeProjectManager::QmakeProFileNode *> nodes = project->applicationProFiles();
int size = nodes.size();
if (size == 0 || size == 1) {
// there's nothing to select, e.g. before parsing
@@ -185,7 +185,7 @@ void AndroidDeployQtWidget::updateInputFileUi()
m_ui->inputFileComboBox->setVisible(true);
m_ui->inputFileComboBox->clear();
foreach (QmakeProjectManager::Qt4ProFileNode *node, nodes) {
foreach (QmakeProjectManager::QmakeProFileNode *node, nodes) {
QString file = node->singleVariableValue(QmakeProjectManager::AndroidDeploySettingsFile);
m_ui->inputFileComboBox->addItem(node->displayName(), file);
}
@@ -325,8 +325,8 @@ void AndroidDeployQtWidget::activeBuildConfigurationChanged()
disconnect(m_currentBuildConfiguration, SIGNAL(qmakeBuildConfigurationChanged()),
this, SLOT(updateSigningWarning()));
updateSigningWarning();
QmakeProjectManager::Qt4BuildConfiguration *bc
= qobject_cast<QmakeProjectManager::Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
QmakeProjectManager::QmakeBuildConfiguration *bc
= qobject_cast<QmakeProjectManager::QmakeBuildConfiguration *>(m_step->target()->activeBuildConfiguration());
m_currentBuildConfiguration = bc;
if (bc)
connect(bc, SIGNAL(qmakeBuildConfigurationChanged()), this, SLOT(updateSigningWarning()));
@@ -335,7 +335,7 @@ void AndroidDeployQtWidget::activeBuildConfigurationChanged()
void AndroidDeployQtWidget::updateSigningWarning()
{
QmakeProjectManager::Qt4BuildConfiguration *bc = qobject_cast<QmakeProjectManager::Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
QmakeProjectManager::QmakeBuildConfiguration *bc = qobject_cast<QmakeProjectManager::QmakeBuildConfiguration *>(m_step->target()->activeBuildConfiguration());
bool debug = bc && (bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild);
if (m_step->signPackage() && debug) {
m_ui->signingDebugWarningIcon->setVisible(true);

View File

@@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE
namespace Ui { class AndroidDeployQtWidget; }
QT_END_NAMESPACE
namespace QmakeProjectManager { class Qt4BuildConfiguration; }
namespace QmakeProjectManager { class QmakeBuildConfiguration; }
namespace Android {
namespace Internal {
@@ -85,7 +85,7 @@ private:
Ui::AndroidDeployQtWidget *m_ui;
AndroidDeployQtStep *m_step;
AndroidExtraLibraryListModel *m_extraLibraryListModel;
QmakeProjectManager::Qt4BuildConfiguration *m_currentBuildConfiguration;
QmakeProjectManager::QmakeBuildConfiguration *m_currentBuildConfiguration;
bool m_ignoreChange;
};

View File

@@ -44,9 +44,9 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/target.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qtsupport/qtkitinformation.h>
@@ -117,7 +117,7 @@ bool AndroidDeployStep::init()
if (!version)
return false;
const Qt4BuildConfiguration *bc = static_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
const QmakeBuildConfiguration *bc = static_cast<QmakeBuildConfiguration *>(target()->activeBuildConfiguration());
if (!bc)
return false;
@@ -134,7 +134,7 @@ bool AndroidDeployStep::init()
m_androidDirPath = AndroidManager::dirPath(target());
m_apkPathDebug = AndroidManager::apkPath(target(), AndroidManager::DebugBuild).toString();
m_apkPathRelease = AndroidManager::apkPath(target(), AndroidManager::ReleaseBuildSigned).toString();
m_buildDirectory = static_cast<Qt4Project *>(target()->project())->rootQt4ProjectNode()->buildDir();
m_buildDirectory = static_cast<QmakeProject *>(target()->project())->rootQmakeProjectNode()->buildDir();
m_runDeployAction = m_deployAction;
ToolChain *tc = ToolChainKitInformation::toolChain(target()->kit());
if (!tc || tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE)) {
@@ -143,7 +143,7 @@ bool AndroidDeployStep::init()
}
m_ndkToolChainVersion = static_cast<AndroidToolChain *>(tc)->ndkToolChainVersion();
QString arch = static_cast<Qt4Project *>(project())->rootQt4ProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
QString arch = static_cast<QmakeProject *>(project())->rootQmakeProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
if (!arch.isEmpty())
m_libgnustl = AndroidManager::libGnuStl(arch, m_ndkToolChainVersion);
return true;

View File

@@ -29,13 +29,13 @@
****************************************************************************/
#include "androidextralibrarylistmodel.h"
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
using namespace Android;
using namespace Internal;
AndroidExtraLibraryListModel::AndroidExtraLibraryListModel(QmakeProjectManager::Qt4Project *project,
AndroidExtraLibraryListModel::AndroidExtraLibraryListModel(QmakeProjectManager::QmakeProject *project,
QObject *parent)
: QAbstractItemModel(parent)
, m_project(project)
@@ -77,18 +77,18 @@ QVariant AndroidExtraLibraryListModel::data(const QModelIndex &index, int role)
void AndroidExtraLibraryListModel::reset()
{
if (m_project->rootQt4ProjectNode()->projectType() != QmakeProjectManager::ApplicationTemplate)
if (m_project->rootQmakeProjectNode()->projectType() != QmakeProjectManager::ApplicationTemplate)
return;
beginResetModel();
QmakeProjectManager::Qt4ProFileNode *node = m_project->rootQt4ProjectNode();
QmakeProjectManager::QmakeProFileNode *node = m_project->rootQmakeProjectNode();
m_entries = node->variableValue(QmakeProjectManager::AndroidExtraLibs);
endResetModel();
}
void AndroidExtraLibraryListModel::addEntries(const QStringList &list)
{
if (m_project->rootQt4ProjectNode()->projectType() != QmakeProjectManager::ApplicationTemplate)
if (m_project->rootQmakeProjectNode()->projectType() != QmakeProjectManager::ApplicationTemplate)
return;
beginInsertRows(QModelIndex(), m_entries.size(), m_entries.size() + list.size());
@@ -96,7 +96,7 @@ void AndroidExtraLibraryListModel::addEntries(const QStringList &list)
foreach (QString path, list)
m_entries += QDir(m_project->projectDirectory()).relativeFilePath(path);
QmakeProjectManager::Qt4ProFileNode *node = m_project->rootQt4ProjectNode();
QmakeProjectManager::QmakeProFileNode *node = m_project->rootQmakeProjectNode();
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries.join(QLatin1String(" ")));
endInsertRows();
@@ -109,7 +109,7 @@ bool greaterModelIndexByRow(const QModelIndex &a, const QModelIndex &b)
void AndroidExtraLibraryListModel::removeEntries(QModelIndexList list)
{
if (list.isEmpty() || m_project->rootQt4ProjectNode()->projectType() != QmakeProjectManager::ApplicationTemplate)
if (list.isEmpty() || m_project->rootQmakeProjectNode()->projectType() != QmakeProjectManager::ApplicationTemplate)
return;
std::sort(list.begin(), list.end(), greaterModelIndexByRow);
@@ -128,6 +128,6 @@ void AndroidExtraLibraryListModel::removeEntries(QModelIndexList list)
endRemoveRows();
}
QmakeProjectManager::Qt4ProFileNode *node = m_project->rootQt4ProjectNode();
QmakeProjectManager::QmakeProFileNode *node = m_project->rootQmakeProjectNode();
node->setProVariable(QLatin1String("ANDROID_EXTRA_LIBS"), m_entries.join(QLatin1String(" ")));
}

View File

@@ -34,7 +34,7 @@
#include <QAbstractItemModel>
#include <QStringList>
namespace QmakeProjectManager { class Qt4Project; }
namespace QmakeProjectManager { class QmakeProject; }
namespace Android {
namespace Internal {
@@ -42,7 +42,7 @@ class AndroidExtraLibraryListModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit AndroidExtraLibraryListModel(QmakeProjectManager::Qt4Project *project,
explicit AndroidExtraLibraryListModel(QmakeProjectManager::QmakeProject *project,
QObject *parent = 0);
QModelIndex index(int row, int column, const QModelIndex &parent) const;
@@ -58,7 +58,7 @@ private slots:
void reset();
private:
QmakeProjectManager::Qt4Project *m_project;
QmakeProjectManager::QmakeProject *m_project;
QStringList m_entries;
};

View File

@@ -42,10 +42,10 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakeprojectmanagerconstants.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -127,7 +127,7 @@ namespace Internal {
bool AndroidManager::supportsAndroid(ProjectExplorer::Target *target)
{
if (!qobject_cast<QmakeProjectManager::Qt4Project *>(target->project()))
if (!qobject_cast<QmakeProjectManager::QmakeProject *>(target->project()))
return false;
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
return version && version->platformName() == QLatin1String(QtSupport::Constants::ANDROID_PLATFORM);
@@ -259,10 +259,10 @@ bool AndroidManager::setBuildTargetSDK(ProjectExplorer::Target *target, const QS
QString AndroidManager::targetArch(ProjectExplorer::Target *target)
{
QmakeProjectManager::Qt4Project *pro = qobject_cast<QmakeProjectManager::Qt4Project *>(target->project());
QmakeProjectManager::QmakeProject *pro = qobject_cast<QmakeProjectManager::QmakeProject *>(target->project());
if (!pro)
return QString();
QmakeProjectManager::Qt4ProFileNode *node = pro->rootQt4ProjectNode();
QmakeProjectManager::QmakeProFileNode *node = pro->rootQmakeProjectNode();
if (!node)
return QString();
return node->singleVariableValue(QmakeProjectManager::AndroidArchVar);
@@ -330,10 +330,10 @@ Utils::FileName AndroidManager::apkPath(ProjectExplorer::Target *target, BuildTy
QStringList AndroidManager::availableTargetApplications(ProjectExplorer::Target *target)
{
QStringList apps;
QmakeProjectManager::Qt4Project *qt4Project = qobject_cast<QmakeProjectManager::Qt4Project *>(target->project());
if (!qt4Project)
QmakeProjectManager::QmakeProject *qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject *>(target->project());
if (!qmakeProject)
return apps;
foreach (QmakeProjectManager::Qt4ProFileNode *proFile, qt4Project->applicationProFiles()) {
foreach (QmakeProjectManager::QmakeProFileNode *proFile, qmakeProject->applicationProFiles()) {
if (proFile->projectType() == QmakeProjectManager::ApplicationTemplate) {
if (proFile->targetInformation().target.startsWith(QLatin1String("lib"))
&& proFile->targetInformation().target.endsWith(QLatin1String(".so")))
@@ -509,8 +509,8 @@ QString AndroidManager::targetApplicationPath(ProjectExplorer::Target *target)
QString selectedApp = targetApplication(target);
if (selectedApp.isEmpty())
return QString();
QmakeProjectManager::Qt4Project *qt4Project = qobject_cast<QmakeProjectManager::Qt4Project *>(target->project());
foreach (QmakeProjectManager::Qt4ProFileNode *proFile, qt4Project->applicationProFiles()) {
QmakeProjectManager::QmakeProject *qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject *>(target->project());
foreach (QmakeProjectManager::QmakeProFileNode *proFile, qmakeProject->applicationProFiles()) {
if (proFile->projectType() == QmakeProjectManager::ApplicationTemplate) {
if (proFile->targetInformation().target.startsWith(QLatin1String("lib"))
&& proFile->targetInformation().target.endsWith(QLatin1String(".so"))) {
@@ -529,8 +529,8 @@ QString AndroidManager::targetApplicationPath(ProjectExplorer::Target *target)
bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *target)
{
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
QmakeProjectManager::Qt4Project *qt4Project = qobject_cast<QmakeProjectManager::Qt4Project*>(target->project());
if (!qt4Project || !qt4Project->rootProjectNode() || !version)
QmakeProjectManager::QmakeProject *qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject*>(target->project());
if (!qmakeProject || !qmakeProject->rootProjectNode() || !version)
return false;
// TODO we should create the AndroidManifest.xml file for that version
@@ -540,7 +540,7 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *
Utils::FileName javaSrcPath
= Utils::FileName::fromString(version->qmakeProperty("QT_INSTALL_PREFIX"))
.appendPath(QLatin1String("src/android/java"));
QDir projectDir(qt4Project->projectDirectory());
QDir projectDir(qmakeProject->projectDirectory());
Utils::FileName androidPath = dirPath(target);
QStringList m_ignoreFiles;
@@ -607,7 +607,7 @@ bool AndroidManager::createAndroidTemplatesIfNecessary(ProjectExplorer::Target *
}
}
if (!androidFiles.isEmpty())
qt4Project->rootProjectNode()->addFiles(androidFiles);
qmakeProject->rootProjectNode()->addFiles(androidFiles);
int minApiLevel = 4;
if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target->kit()))
@@ -804,17 +804,17 @@ QVector<AndroidManager::Library> AndroidManager::availableQtLibsWithDependencies
if (tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE))
return QVector<AndroidManager::Library>();
QmakeProjectManager::Qt4Project *project = static_cast<QmakeProjectManager::Qt4Project *>(target->project());
QString arch = project->rootQt4ProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
QmakeProjectManager::QmakeProject *project = static_cast<QmakeProjectManager::QmakeProject *>(target->project());
QString arch = project->rootQmakeProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
AndroidToolChain *atc = static_cast<AndroidToolChain *>(tc);
QString libgnustl = libGnuStl(arch, atc->ndkToolChainVersion());
Utils::FileName readelfPath = AndroidConfigurations::instance().readelfPath(target->activeRunConfiguration()->abi().architecture(),
atc->ndkToolChainVersion());
const QmakeProjectManager::Qt4Project *const qt4Project
= qobject_cast<const QmakeProjectManager::Qt4Project *>(target->project());
if (!qt4Project || !version)
const QmakeProjectManager::QmakeProject *const qmakeProject
= qobject_cast<const QmakeProjectManager::QmakeProject *>(target->project());
if (!qmakeProject || !version)
return QVector<AndroidManager::Library>();
QString qtLibsPath = version->qmakeProperty("QT_INSTALL_LIBS");
if (!readelfPath.toFileInfo().exists()) {
@@ -904,11 +904,11 @@ bool AndroidManager::setBundledInLib(ProjectExplorer::Target *target, const QStr
QStringList AndroidManager::availablePrebundledLibs(ProjectExplorer::Target *target)
{
QStringList libs;
QmakeProjectManager::Qt4Project *qt4Project = qobject_cast<QmakeProjectManager::Qt4Project *>(target->project());
if (!qt4Project)
QmakeProjectManager::QmakeProject *qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject *>(target->project());
if (!qmakeProject)
return libs;
foreach (QmakeProjectManager::Qt4ProFileNode *node, qt4Project->allProFiles())
foreach (QmakeProjectManager::QmakeProFileNode *node, qmakeProject->allProFiles())
if (node->projectType() == QmakeProjectManager::LibraryTemplate)
libs << node->targetInformation().target;
return libs;

View File

@@ -44,7 +44,7 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/kitinformation.h>
#include <texteditor/texteditoractionhandler.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <QLineEdit>
#include <QFileInfo>

View File

@@ -42,9 +42,9 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/runconfiguration.h>
#include <projectexplorer/target.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qtsupport/qtkitinformation.h>
#include <coreplugin/icore.h>
@@ -98,18 +98,18 @@ void AndroidPackageCreationStep::ctor()
bool AndroidPackageCreationStep::init()
{
const Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
const QmakeBuildConfiguration *bc = qobject_cast<QmakeBuildConfiguration *>(target()->activeBuildConfiguration());
if (!bc) {
raiseError(tr("Cannot create Android package: current build configuration is not Qt 4."));
return false;
}
Qt4Project *project = static_cast<Qt4Project *>(target()->project());
QmakeProject *project = static_cast<QmakeProject *>(target()->project());
m_outputParser.setProjectFileList(project->files(Project::AllFiles));
// Copying
m_androidDir = AndroidManager::dirPath(target());
Utils::FileName path = m_androidDir;
QString androidTargetArch = project->rootQt4ProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
QString androidTargetArch = project->rootQmakeProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
if (androidTargetArch.isEmpty()) {
raiseError(tr("Cannot create Android package: No ANDROID_TARGET_ARCH set in make spec."));
return false;
@@ -434,8 +434,8 @@ void AndroidPackageCreationStep::collectFiles(QList<DeployItem> *deployList,
if (!version)
return;
Qt4Project *project = static_cast<Qt4Project *>(target()->project());
QString androidTargetArch = project->rootQt4ProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
QmakeProject *project = static_cast<QmakeProject *>(target()->project());
QString androidTargetArch = project->rootQmakeProjectNode()->singleVariableValue(QmakeProjectManager::AndroidArchVar);
QString androidAssetsPath = m_androidDir.toString() + QLatin1String("/assets/");
QString androidJarPath = m_androidDir.toString() + QLatin1String("/libs/");

View File

@@ -41,8 +41,8 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/buildmanager.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakestep.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakestep.h>
#include <QTimer>
@@ -182,7 +182,7 @@ void AndroidPackageCreationWidget::initGui()
// Make the buildconfiguration emit a evironmentChanged() signal
// TODO find a better way
Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
QmakeBuildConfiguration *bc = qobject_cast<QmakeBuildConfiguration *>(m_step->target()->activeBuildConfiguration());
if (!bc)
return;
bool use = bc->useSystemEnvironment();
@@ -196,7 +196,7 @@ void AndroidPackageCreationWidget::initGui()
void AndroidPackageCreationWidget::updateSigningWarning()
{
Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
QmakeBuildConfiguration *bc = qobject_cast<QmakeBuildConfiguration *>(m_step->target()->activeBuildConfiguration());
bool debug = bc && (bc->qmakeBuildConfiguration() & QtSupport::BaseQtVersion::DebugBuild);
if (m_step->signPackage() && debug) {
m_ui->signingDebugWarningIcon->setVisible(true);
@@ -213,7 +213,7 @@ void AndroidPackageCreationWidget::activeBuildConfigurationChanged()
disconnect(m_currentBuildConfiguration, SIGNAL(qmakeBuildConfigurationChanged()),
this, SLOT(updateSigningWarning()));
updateSigningWarning();
Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
QmakeBuildConfiguration *bc = qobject_cast<QmakeBuildConfiguration *>(m_step->target()->activeBuildConfiguration());
m_currentBuildConfiguration = bc;
if (bc)
connect(bc, SIGNAL(qmakeBuildConfigurationChanged()), this, SLOT(updateSigningWarning()));
@@ -243,7 +243,7 @@ void AndroidPackageCreationWidget::updateAndroidProjectInfo()
void AndroidPackageCreationWidget::setTargetSDK(const QString &sdk)
{
AndroidManager::setBuildTargetSDK(m_step->target(), sdk);
Qt4BuildConfiguration *bc = qobject_cast<Qt4BuildConfiguration *>(m_step->target()->activeBuildConfiguration());
QmakeBuildConfiguration *bc = qobject_cast<QmakeBuildConfiguration *>(m_step->target()->activeBuildConfiguration());
if (!bc)
return;
QMakeStep *qs = bc->qmakeStep();

View File

@@ -41,7 +41,7 @@ class QFileSystemWatcher;
namespace Ui { class AndroidPackageCreationWidget; }
QT_END_NAMESPACE
namespace QmakeProjectManager { class Qt4BuildConfiguration; }
namespace QmakeProjectManager { class QmakeBuildConfiguration; }
namespace Android {
namespace Internal {
@@ -112,7 +112,7 @@ private:
CheckModel *m_qtLibsModel;
CheckModel *m_prebundledLibs;
QFileSystemWatcher *m_fileSystemWatcher;
QmakeProjectManager::Qt4BuildConfiguration *m_currentBuildConfiguration;
QmakeProjectManager::QmakeBuildConfiguration *m_currentBuildConfiguration;
};
} // namespace Internal

View File

@@ -37,7 +37,7 @@
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/gnumakeparser.h>
#include <utils/hostosinfo.h>
#include <qt4projectmanager/qmakeparser.h>
#include <qmakeprojectmanager/qmakeparser.h>
#include <QDir>

View File

@@ -35,8 +35,8 @@
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakeprojectmanagerconstants.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -109,12 +109,12 @@ void AndroidQtVersion::addToEnvironment(const ProjectExplorer::Kit *k, Utils::En
env.set(QLatin1String("ANDROID_NDK_HOST"), AndroidConfigurations::instance().config().toolchainHost);
env.set(QLatin1String("ANDROID_NDK_ROOT"), AndroidConfigurations::instance().config().ndkLocation.toUserOutput());
Qt4Project *qt4pro = qobject_cast<QmakeProjectManager::Qt4Project *>(ProjectExplorerPlugin::instance()->currentProject());
if (!qt4pro || !qt4pro->activeTarget()
QmakeProject *qmakeProject = qobject_cast<QmakeProjectManager::QmakeProject *>(ProjectExplorerPlugin::instance()->currentProject());
if (!qmakeProject || !qmakeProject->activeTarget()
|| QtSupport::QtKitInformation::qtVersion(k)->type() != QLatin1String(Constants::ANDROIDQT))
return;
Target *target = qt4pro->activeTarget();
Target *target = qmakeProject->activeTarget();
if (DeviceTypeKitInformation::deviceTypeId(target->kit()) != Constants::ANDROID_DEVICE_TYPE)
return;
if (AndroidConfigurations::instance().config().ndkLocation.isEmpty()

View File

@@ -37,8 +37,8 @@
#include <projectexplorer/target.h>
#include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtkitinformation.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <utils/qtcassert.h>
@@ -47,7 +47,7 @@ const char PRO_FILE_KEY[] = "Qt4ProjectManager.Qt4RunConfiguration.ProFile";
}
using namespace ProjectExplorer;
using QmakeProjectManager::Qt4Project;
using QmakeProjectManager::QmakeProject;
namespace Android {
namespace Internal {
@@ -56,7 +56,7 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, Core::Id id, co
: RunConfiguration(parent, id)
, m_proFilePath(path)
{
Qt4Project *project = static_cast<Qt4Project *>(parent->project());
QmakeProject *project = static_cast<QmakeProject *>(parent->project());
m_parseSuccess = project->validParse(m_proFilePath);
m_parseInProgress = project->parseInProgress(m_proFilePath);
init();
@@ -74,16 +74,16 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *parent, AndroidRunConfi
void AndroidRunConfiguration::init()
{
setDefaultDisplayName(defaultDisplayName());
connect(target()->project(), SIGNAL(proFileUpdated(QmakeProjectManager::Qt4ProFileNode*,bool,bool)),
this, SLOT(proFileUpdated(QmakeProjectManager::Qt4ProFileNode*,bool,bool)));
connect(target()->project(), SIGNAL(proFileUpdated(QmakeProjectManager::QmakeProFileNode*,bool,bool)),
this, SLOT(proFileUpdated(QmakeProjectManager::QmakeProFileNode*,bool,bool)));
}
bool AndroidRunConfiguration::fromMap(const QVariantMap &map)
{
const QDir projectDir = QDir(target()->project()->projectDirectory());
m_proFilePath = QDir::cleanPath(projectDir.filePath(map.value(QLatin1String(PRO_FILE_KEY)).toString()));
m_parseSuccess = static_cast<Qt4Project *>(target()->project())->validParse(m_proFilePath);
m_parseInProgress = static_cast<Qt4Project *>(target()->project())->parseInProgress(m_proFilePath);
m_parseSuccess = static_cast<QmakeProject *>(target()->project())->validParse(m_proFilePath);
m_parseInProgress = static_cast<QmakeProject *>(target()->project())->parseInProgress(m_proFilePath);
return RunConfiguration::fromMap(map);
}
@@ -108,11 +108,11 @@ QString AndroidRunConfiguration::disabledReason() const
.arg(QFileInfo(m_proFilePath).fileName());
if (!m_parseSuccess)
return static_cast<Qt4Project *>(target()->project())->disabledReasonForRunConfiguration(m_proFilePath);
return static_cast<QmakeProject *>(target()->project())->disabledReasonForRunConfiguration(m_proFilePath);
return QString();
}
void AndroidRunConfiguration::proFileUpdated(QmakeProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress)
void AndroidRunConfiguration::proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress)
{
if (m_proFilePath != pro->path())
return;

View File

@@ -35,7 +35,7 @@
#include <projectexplorer/runconfiguration.h>
namespace QmakeProjectManager { class Qt4ProFileNode; }
namespace QmakeProjectManager { class QmakeProFileNode; }
namespace Android {
namespace Internal {
@@ -70,7 +70,7 @@ protected:
bool fromMap(const QVariantMap &map);
QVariantMap toMap() const;
private slots:
void proFileUpdated(QmakeProjectManager::Qt4ProFileNode *pro, bool success, bool parseInProgress);
void proFileUpdated(QmakeProjectManager::QmakeProFileNode *pro, bool success, bool parseInProgress);
private:
void init();

View File

@@ -40,8 +40,8 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <debugger/debuggerconstants.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -90,9 +90,9 @@ QList<Core::Id> AndroidRunConfigurationFactory::availableCreationIds(Target *par
QList<Core::Id> ids;
if (!AndroidManager::supportsAndroid(parent))
return ids;
QList<Qt4ProFileNode *> nodes = static_cast<Qt4Project *>(parent->project())->allProFiles();
QList<QmakeProFileNode *> nodes = static_cast<QmakeProject *>(parent->project())->allProFiles();
const Core::Id base = Core::Id(ANDROID_RC_ID_PREFIX);
foreach (Qt4ProFileNode *node, nodes)
foreach (QmakeProFileNode *node, nodes)
if (node->projectType() == ApplicationTemplate || node->projectType() == LibraryTemplate)
ids << base.withSuffix(node->path());
return ids;

View File

@@ -31,7 +31,7 @@
#define ANDROIDRUNFACTORIES_H
#include <projectexplorer/runconfiguration.h>
#include <qt4projectmanager/qmakerunconfigurationfactory.h>
#include <qmakeprojectmanager/qmakerunconfigurationfactory.h>
namespace ProjectExplorer {
class RunControl;

View File

@@ -30,8 +30,8 @@
#include "createandroidmanifestwizard.h"
#include <projectexplorer/target.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <proparser/prowriter.h>
#include <QComboBox>
#include <QFormLayout>
@@ -43,8 +43,8 @@
using namespace Android;
using namespace Android::Internal;
using QmakeProjectManager::Qt4Project;
using QmakeProjectManager::Qt4ProFileNode;
using QmakeProjectManager::QmakeProject;
using QmakeProjectManager::QmakeProFileNode;
//
// NoApplicationProFilePage
@@ -63,7 +63,7 @@ NoApplicationProFilePage::NoApplicationProFilePage(CreateAndroidManifestWizard *
//
// ChooseProFilePage
//
ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard, const QList<Qt4ProFileNode *> &nodes)
ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard, const QList<QmakeProFileNode *> &nodes)
: m_wizard(wizard)
{
QFormLayout *fl = new QFormLayout(this);
@@ -73,7 +73,7 @@ ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard, const
fl->addRow(label);
m_comboBox = new QComboBox(this);
foreach (Qt4ProFileNode *node, nodes)
foreach (QmakeProFileNode *node, nodes)
m_comboBox->addItem(node->displayName(), QVariant::fromValue(static_cast<void *>(node))); // TODO something more?
connect(m_comboBox, SIGNAL(currentIndexChanged(int)),
@@ -86,7 +86,7 @@ ChooseProFilePage::ChooseProFilePage(CreateAndroidManifestWizard *wizard, const
void ChooseProFilePage::nodeSelected(int index)
{
Q_UNUSED(index)
m_wizard->setNode(static_cast<Qt4ProFileNode *>(m_comboBox->itemData(m_comboBox->currentIndex()).value<void *>()));
m_wizard->setNode(static_cast<QmakeProFileNode *>(m_comboBox->itemData(m_comboBox->currentIndex()).value<void *>()));
}
@@ -133,8 +133,8 @@ CreateAndroidManifestWizard::CreateAndroidManifestWizard(ProjectExplorer::Target
{
setWindowTitle(tr("Create Android Manifest Wizard"));
Qt4Project *project = static_cast<Qt4Project *>(target->project());
QList<Qt4ProFileNode *> nodes = project->applicationProFiles();
QmakeProject *project = static_cast<QmakeProject *>(target->project());
QList<QmakeProFileNode *> nodes = project->applicationProFiles();
if (nodes.isEmpty()) {
// oh uhm can't create anything
addPage(new NoApplicationProFilePage(this));
@@ -147,12 +147,12 @@ CreateAndroidManifestWizard::CreateAndroidManifestWizard(ProjectExplorer::Target
}
}
QmakeProjectManager::Qt4ProFileNode *CreateAndroidManifestWizard::node() const
QmakeProjectManager::QmakeProFileNode *CreateAndroidManifestWizard::node() const
{
return m_node;
}
void CreateAndroidManifestWizard::setNode(QmakeProjectManager::Qt4ProFileNode *node)
void CreateAndroidManifestWizard::setNode(QmakeProjectManager::QmakeProFileNode *node)
{
m_node = node;
}

View File

@@ -37,7 +37,7 @@ class QComboBox;
QT_END_NAMESPACE
namespace ProjectExplorer { class Target; }
namespace QmakeProjectManager { class Qt4ProFileNode; }
namespace QmakeProjectManager { class QmakeProFileNode; }
namespace Android {
namespace Internal {
@@ -57,7 +57,7 @@ class ChooseProFilePage : public QWizardPage
{
Q_OBJECT
public:
ChooseProFilePage(CreateAndroidManifestWizard *wizard, const QList<QmakeProjectManager::Qt4ProFileNode *> &nodes);
ChooseProFilePage(CreateAndroidManifestWizard *wizard, const QList<QmakeProjectManager::QmakeProFileNode *> &nodes);
private slots:
void nodeSelected(int index);
private:
@@ -81,8 +81,8 @@ class CreateAndroidManifestWizard : public Utils::Wizard
public:
CreateAndroidManifestWizard(ProjectExplorer::Target *target);
QmakeProjectManager::Qt4ProFileNode *node() const;
void setNode(QmakeProjectManager::Qt4ProFileNode *node);
QmakeProjectManager::QmakeProFileNode *node() const;
void setNode(QmakeProjectManager::QmakeProFileNode *node);
QString sourceFileName() const;
@@ -93,7 +93,7 @@ public slots:
private:
void createAndroidManifestFile();
ProjectExplorer::Target *m_target;
QmakeProjectManager::Qt4ProFileNode *m_node;
QmakeProjectManager::QmakeProFileNode *m_node;
QString m_directory;
};
}

View File

@@ -223,11 +223,6 @@ QString CppPreprocessor::cleanPath(const QString &path)
return result;
}
static inline bool isInjectedFile(const QString &fileName)
{
return fileName.startsWith(QLatin1Char('<')) && fileName.endsWith(QLatin1Char('>'));
}
QString CppPreprocessor::resolveFile_helper(const QString &fileName, IncludeType type)
{
const QFileInfo fileInfo(fileName);

View File

@@ -88,8 +88,10 @@ void DebuggerItem::reinitializeFromFile()
{
QProcess proc;
proc.start(m_command.toString(), QStringList() << QLatin1String("--version"));
proc.waitForStarted();
proc.waitForFinished();
if (!proc.waitForStarted() || !proc.waitForFinished()) {
m_engineType = NoEngineType;
return;
}
QByteArray ba = proc.readAll();
if (ba.contains("gdb")) {
m_engineType = GdbEngineType;
@@ -120,6 +122,19 @@ void DebuggerItem::reinitializeFromFile()
m_engineType = PdbEngineType;
return;
}
if (ba.isEmpty()) {
proc.start(m_command.toString(), QStringList() << QLatin1String("-version"));
if (!proc.waitForStarted() || !proc.waitForFinished()) {
m_engineType = NoEngineType;
return;
}
ba = proc.readAll();
if (ba.startsWith("cdb")) {
m_engineType = CdbEngineType;
m_abis = Abi::abisOfBinary(m_command);
return;
}
}
m_engineType = NoEngineType;
}

View File

@@ -243,11 +243,16 @@ void DebuggerItemManager::autoDetectGdbOrLldbDebuggers()
void DebuggerItemManager::readLegacyDebuggers()
{
QFileInfo settingsLocation(Core::ICore::settings()->fileName());
FileName legacyKits = FileName::fromString(settingsLocation.absolutePath() + QLatin1String(DEBUGGER_LEGACY_FILENAME));
QFileInfo systemLocation(Core::ICore::settings(QSettings::SystemScope)->fileName());
readLegacyDebuggers(FileName::fromString(systemLocation.absolutePath() + QLatin1String(DEBUGGER_LEGACY_FILENAME)));
QFileInfo userLocation(Core::ICore::settings()->fileName());
readLegacyDebuggers(FileName::fromString(userLocation.absolutePath() + QLatin1String(DEBUGGER_LEGACY_FILENAME)));
}
void DebuggerItemManager::readLegacyDebuggers(const FileName &file)
{
PersistentSettingsReader reader;
if (!reader.load(legacyKits))
if (!reader.load(file))
return;
foreach (const QVariant &v, reader.restoreValues()) {

View File

@@ -83,6 +83,7 @@ private:
static void autoDetectGdbOrLldbDebuggers();
static void autoDetectCdbDebuggers();
static void readLegacyDebuggers();
static void readLegacyDebuggers(const Utils::FileName &file);
static Utils::PersistentSettingsWriter *m_writer;
static QList<DebuggerItem> m_debuggers;

View File

@@ -37,6 +37,7 @@
#include <utils/detailswidget.h>
#include <utils/pathchooser.h>
#include <utils/qtcassert.h>
#include <utils/winutils.h>
#include <QFormLayout>
#include <QHeaderView>
@@ -140,7 +141,8 @@ void DebuggerItemConfigWidget::setItem(const DebuggerItem &item)
void DebuggerItemConfigWidget::apply()
{
DebuggerItem item = m_model->currentDebugger();
QTC_ASSERT(item.isValid(), return);
if (!item.isValid())
return; // Nothing was selected here.
item.setDisplayName(m_displayNameLineEdit->text());
item.setCommand(m_binaryChooser->fileName());

View File

@@ -79,12 +79,6 @@
#include <QMessageBox>
#include <QPushButton>
#ifdef Q_OS_UNIX
#include <unistd.h>
#include <dlfcn.h>
#endif
#include <ctype.h>
using namespace ProjectExplorer;
using namespace Utils;
@@ -1332,39 +1326,6 @@ static bool isExitedReason(const QByteArray &reason)
|| reason == "exited"; // inferior exited
}
#if 0
void GdbEngine::handleAqcuiredInferior()
{
// Reverse debugging. FIXME: Should only be used when available.
//if (debuggerCore()->boolSetting(EnableReverseDebugging))
// postCommand("target response");
tryLoadDebuggingHelpers();
# ifndef Q_OS_MAC
// intentionally after tryLoadDebuggingHelpers(),
// otherwise we'd interrupt solib loading.
if (debuggerCore()->boolSetting(AllPluginBreakpoints)) {
postCommand("set auto-solib-add on");
postCommand("set stop-on-solib-events 0");
postCommand("sharedlibrary .*");
} else if (debuggerCore()->boolSetting(SelectedPluginBreakpoints)) {
postCommand("set auto-solib-add on");
postCommand("set stop-on-solib-events 1");
postCommand("sharedlibrary "
+ theDebuggerStringSetting(SelectedPluginBreakpointsPattern));
} else if (debuggerCore()->boolSetting(NoPluginBreakpoints)) {
// should be like that already
postCommand("set auto-solib-add off");
postCommand("set stop-on-solib-events 0");
}
# endif
// It's nicer to see a bit of the world we live in.
reloadModulesInternal();
}
#endif
void GdbEngine::handleStopResponse(const GdbMi &data)
{
// Ignore trap on Windows terminals, which results in

View File

@@ -32,6 +32,7 @@
#include <debugger/debuggeractions.h>
#include <debugger/debuggercore.h>
#include <debugger/debuggerdialogs.h>
#include <debugger/debuggerinternalconstants.h>
#include <debugger/debuggerplugin.h>
#include <debugger/debuggerprotocol.h>
#include <debugger/debuggerstartparameters.h>
@@ -66,9 +67,6 @@
#include <QMessageBox>
#include <QToolTip>
#include <stdio.h>
namespace Debugger {
namespace Internal {
@@ -131,9 +129,16 @@ void LldbEngine::shutdownEngine()
void LldbEngine::setupEngine()
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
if (startParameters().remoteSetupNeeded) {
notifyEngineRequestRemoteSetup();
} else {
startLldb();
}
}
void LldbEngine::startLldb()
{
m_lldbCmd = startParameters().debuggerCommand;
connect(&m_lldbProc, SIGNAL(error(QProcess::ProcessError)),
SLOT(handleLldbError(QProcess::ProcessError)));
connect(&m_lldbProc, SIGNAL(finished(int,QProcess::ExitStatus)),
@@ -170,9 +175,14 @@ void LldbEngine::setupInferior()
const DebuggerStartParameters &sp = startParameters();
Command cmd("setupInferior");
cmd.arg("executable", QFileInfo(sp.executable).absoluteFilePath());
cmd.arg("startMode", sp.startMode);
cmd.arg("startMode", sp.startMode); // directly relying on this is brittle wrt. insertions, so check it here
cmd.arg("processArgs", sp.processArgs);
cmd.arg("attachPid", sp.attachPID);
cmd.arg("attachPid", ((sp.startMode == AttachCrashedExternal || sp.startMode == AttachExternal)
? sp.attachPID : 0));
cmd.arg("sysRoot", sp.sysRoot);
cmd.arg("remoteChannel", ((sp.startMode == AttachToRemoteProcess || sp.startMode == AttachToRemoteServer)
? sp.remoteChannel : QString()));
runCommand(cmd);
requestUpdateWatchers();
}
@@ -1107,6 +1117,39 @@ DebuggerEngine *createLldbEngine(const DebuggerStartParameters &startParameters)
return new LldbEngine(startParameters);
}
void LldbEngine::notifyEngineRemoteSetupDone(int portOrPid, int qmlPort)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupDone(portOrPid, qmlPort);
if (qmlPort != -1)
startParameters().qmlServerPort = qmlPort;
if (portOrPid != -1) {
if (startParameters().startMode == AttachExternal) {
startParameters().attachPID = portOrPid;
} else {
QString &rc = startParameters().remoteChannel;
const int sepIndex = rc.lastIndexOf(QLatin1Char(':'));
if (sepIndex != -1) {
rc.replace(sepIndex + 1, rc.count() - sepIndex - 1,
QString::number(portOrPid));
}
}
}
startLldb();
}
void LldbEngine::notifyEngineRemoteSetupFailed(const QString &reason)
{
QTC_ASSERT(state() == EngineSetupRequested, qDebug() << state());
DebuggerEngine::notifyEngineRemoteSetupFailed(reason);
showMessage(_("ADAPTER START FAILED"));
if (!reason.isEmpty()) {
const QString title = tr("Adapter start failed");
Core::ICore::showWarningWithOptions(title, reason);
}
notifyEngineSetupFailed();
}
///////////////////////////////////////////////////////////////////////
//

View File

@@ -95,6 +95,7 @@ private:
void executeNextI();
void setupEngine();
void startLldb();
void setupInferior();
void runEngine();
void shutdownInferior();
@@ -181,6 +182,9 @@ private:
void handleUpdateStack(const QByteArray &response);
void handleUpdateThreads(const QByteArray &response);
void notifyEngineRemoteSetupDone(int portOrPid, int qmlPort);
void notifyEngineRemoteSetupFailed(const QString &reason);
void handleChildren(const WatchData &data0, const GdbMi &item,
QList<WatchData> *list);

View File

@@ -8,7 +8,7 @@ QtcPlugin {
Depends { name: "Core" }
Depends { name: "ProjectExplorer" }
Depends { name: "Qt4ProjectManager" }
Depends { name: "QmakeProjectManager" }
Depends { name: "Debugger" }
Depends { name: "QtSupport" }
Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] }

View File

@@ -5,4 +5,4 @@ QTC_PLUGIN_DEPENDS += \
coreplugin \
debugger \
projectexplorer \
qt4projectmanager
qmakeprojectmanager

View File

@@ -43,11 +43,11 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/gcctoolchain.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeprojectmanagerconstants.h>
#include <qt4projectmanager/qmakeprojectmanager.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
#include <qmakeprojectmanager/qmakeprojectmanager.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtparser.h>
#include <coreplugin/variablemanager.h>

View File

@@ -312,7 +312,7 @@ void IosConfigurations::updateAutomaticKitList()
//DeviceKitInformation::setDevice(newKit, device);
Debugger::DebuggerItem debugger;
debugger.setCommand(pToolchain->suggestedDebugger());
debugger.setCommand(pToolchain->suggestedDebugger()); // use lldbPath() instead?
debugger.setEngineType(Debugger::LldbEngineType);
debugger.setDisplayName(tr("IOS Debugger"));
debugger.setAutoDetected(true);
@@ -371,6 +371,11 @@ FileName IosConfigurations::developerPath()
return m_instance->m_developerPath;
}
FileName IosConfigurations::lldbPath()
{
return m_instance->m_lldbPath;
}
void IosConfigurations::save()
{
QSettings *settings = Core::ICore::settings();
@@ -432,6 +437,18 @@ void IosConfigurations::setDeveloperPath(const FileName &devPath)
m_instance->m_developerPath = devPath;
m_instance->save();
updateAutomaticKitList();
QProcess lldbInfo;
lldbInfo.start(QLatin1String("xcrun"), QStringList() << QLatin1String("--find")
<< QLatin1String("lldb"));
if (!lldbInfo.waitForFinished(2000)) {
lldbInfo.kill();
} else {
QByteArray lPath=lldbInfo.readAll();
lPath.chop(1);
Utils::FileName lldbPath = Utils::FileName::fromString(QString::fromLocal8Bit(lPath.data(), lPath.size()));
if (lldbPath.toFileInfo().exists())
m_instance->m_lldbPath = lldbPath;
}
emit m_instance->updated();
}
}

View File

@@ -53,6 +53,7 @@ public:
static bool ignoreAllDevices();
static void setIgnoreAllDevices(bool ignoreDevices);
static Utils::FileName developerPath();
static Utils::FileName lldbPath();
signals:
void updated();
@@ -68,6 +69,7 @@ private:
static void setDeveloperPath(const Utils::FileName &devPath);
Utils::FileName m_developerPath;
Utils::FileName m_lldbPath;
bool m_ignoreAllDevices;
};

View File

@@ -37,14 +37,24 @@
#include <debugger/debuggerkitinformation.h>
#include <debugger/debuggerrunner.h>
#include <debugger/debuggerstartparameters.h>
#include <debugger/debuggerrunconfigurationaspect.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/target.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qtsupport/qtkitinformation.h>
#include <QDir>
#include <QTcpServer>
#include <stdio.h>
#include <fcntl.h>
#ifdef Q_OS_UNIX
#include <unistd.h>
#else
#include <io.h>
#endif
using namespace Debugger;
using namespace ProjectExplorer;
@@ -56,14 +66,46 @@ namespace Internal {
RunControl *IosDebugSupport::createDebugRunControl(IosRunConfiguration *runConfig,
QString *errorMessage)
{
//Target *target = runConfig->target();
//Qt4Project *project = static_cast<Qt4Project *>(target->project());
Target *target = runConfig->target();
if (!target)
return 0;
ProjectExplorer::IDevice::ConstPtr device = DeviceKitInformation::device(target->kit());
if (device.isNull())
return 0;
QmakeProject *project = static_cast<QmakeProject *>(target->project());
DebuggerStartParameters params;
params.startMode = AttachToRemoteServer;
//params.displayName = IosManager::packageName(target);
if (device->type() == Core::Id(Ios::Constants::IOS_DEVICE_TYPE))
params.startMode = AttachToRemoteProcess;
else
params.startMode = AttachExternal;
params.displayName = runConfig->appName();
params.remoteSetupNeeded = true;
Debugger::DebuggerRunConfigurationAspect *aspect
= runConfig->extraAspect<Debugger::DebuggerRunConfigurationAspect>();
if (aspect->useCppDebugger()) {
params.languages |= CppLanguage;
Kit *kit = target->kit();
params.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
params.debuggerCommand = DebuggerKitInformation::debuggerCommand(kit).toString();
if (ToolChain *tc = ToolChainKitInformation::toolChain(kit))
params.toolChainAbi = tc->targetAbi();
params.executable = runConfig->exePath().toString();
}
if (aspect->useQmlDebugger()) {
params.languages |= QmlLanguage;
QTcpServer server;
QTC_ASSERT(server.listen(QHostAddress::LocalHost)
|| server.listen(QHostAddress::LocalHostIPv6), return 0);
params.qmlServerAddress = server.serverAddress().toString();
params.remoteSetupNeeded = true;
//TODO: Not sure if these are the right paths.
params.projectSourceDirectory = project->projectDirectory();
params.projectSourceFiles = project->files(QmakeProject::ExcludeGeneratedFiles);
params.projectBuildDirectory = project->rootQmakeProjectNode()->buildDir();
}
DebuggerRunControl * const debuggerRunControl
= DebuggerPlugin::createDebugger(params, runConfig, errorMessage);
new IosDebugSupport(runConfig, debuggerRunControl);
@@ -74,7 +116,7 @@ IosDebugSupport::IosDebugSupport(IosRunConfiguration *runConfig,
DebuggerRunControl *runControl)
: QObject(runControl), m_runControl(runControl),
m_runner(new IosRunner(this, runConfig, true)),
m_gdbServerPort(0), m_qmlPort(0)
m_gdbServerFd(0), m_qmlPort(0)
{
connect(m_runControl->engine(), SIGNAL(requestRemoteSetup()),
@@ -84,6 +126,8 @@ IosDebugSupport::IosDebugSupport(IosRunConfiguration *runConfig,
connect(m_runner, SIGNAL(gotGdbSocket(int)),
SLOT(handleGdbServerFd(int)));
connect(m_runner, SIGNAL(gotInferiorPid(Q_PID)),
SLOT(handleGotInferiorPid(Q_PID)));
connect(m_runner, SIGNAL(finished(bool)),
SLOT(handleRemoteProcessFinished(bool)));
@@ -93,17 +137,43 @@ IosDebugSupport::IosDebugSupport(IosRunConfiguration *runConfig,
SLOT(handleRemoteOutput(QString)));
}
IosDebugSupport::~IosDebugSupport()
{
if (m_gdbServerFd > 0)
close(m_gdbServerFd);
}
void IosDebugSupport::handleGdbServerFd(int gdbServerFd)
{
Q_UNUSED(gdbServerFd);
QTC_CHECK(false); // to do transfer fd to debugger
//m_runControl->engine()->notifyEngineRemoteSetupDone(gdbServerPort, qmlPort);
if (m_gdbServerFd > 0) {
close(m_gdbServerFd);
m_gdbServerFd = 0;
}
if (gdbServerFd > 0) {
m_runControl->engine()->notifyEngineRemoteSetupDone(m_gdbServerFd, m_qmlPort);
} else {
m_runControl->engine()->notifyEngineRemoteSetupFailed(
tr("Could not get debug server file descriptor."));
}
}
void IosDebugSupport::handleGotInferiorPid(Q_PID pid)
{
if (pid > 0) {
//m_runControl->engine()->notifyInferiorPid(pid);
m_runControl->engine()->notifyEngineRemoteSetupDone(int(pid), m_qmlPort);
} else {
m_runControl->engine()->notifyEngineRemoteSetupFailed(
tr("Got an invalid process id."));
}
}
void IosDebugSupport::handleRemoteProcessFinished(bool cleanEnd)
{
if (!cleanEnd && m_runControl)
m_runControl->showMessage(tr("Run failed unexpectedly."), AppStuff);
//m_runControl->engine()->notifyInferiorIll();
m_runControl->engine()->abortDebugger();
}
void IosDebugSupport::handleRemoteOutput(const QString &output)

View File

@@ -30,6 +30,7 @@
#define IOSDEBUGSUPPORT_H
#include "iosrunconfiguration.h"
#include <QProcess>
namespace Debugger { class DebuggerRunControl; }
namespace ProjectExplorer { class RunControl; }
@@ -50,9 +51,11 @@ public:
IosDebugSupport(IosRunConfiguration *runConfig,
Debugger::DebuggerRunControl *runControl);
~IosDebugSupport();
private slots:
void handleGdbServerFd(int gdbServerFd);
void handleGotInferiorPid(Q_PID);
void handleRemoteProcessFinished(bool cleanEnd);
void handleRemoteOutput(const QString &output);
@@ -63,7 +66,7 @@ private:
IosRunner * const m_runner;
const QString m_dumperLib;
int m_gdbServerPort;
int m_gdbServerFd;
int m_qmlPort;
};

View File

@@ -35,7 +35,7 @@
#include <projectexplorer/buildsteplist.h>
#include <projectexplorer/target.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -112,7 +112,7 @@ DeployConfiguration *IosDeployConfigurationFactory::clone(Target *parent, Deploy
QList<Core::Id> IosDeployConfigurationFactory::availableCreationIds(Target *parent) const
{
QList<Core::Id> ids;
if (!qobject_cast<QmakeProjectManager::Qt4Project *>(parent->project()))
if (!qobject_cast<QmakeProjectManager::QmakeProject *>(parent->project()))
return ids;
if (!parent->project()->supportsKit(parent->kit()))
return ids;

View File

@@ -39,9 +39,9 @@
#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qtsupport/qtkitinformation.h>

View File

@@ -35,10 +35,10 @@
#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <projectexplorer/toolchain.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakeprojectmanagerconstants.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -58,7 +58,7 @@ namespace Internal {
bool IosManager::supportsIos(ProjectExplorer::Target *target)
{
if (!qobject_cast<QmakeProjectManager::Qt4Project *>(target->project()))
if (!qobject_cast<QmakeProjectManager::QmakeProject *>(target->project()))
return false;
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target->kit());
return version && version->type() == QLatin1String(Ios::Constants::IOSQT);
@@ -66,8 +66,8 @@ bool IosManager::supportsIos(ProjectExplorer::Target *target)
QString IosManager::resDirForTarget(Target *target)
{
Qt4BuildConfiguration *bc =
qobject_cast<Qt4BuildConfiguration *>(target->activeBuildConfiguration());
QmakeBuildConfiguration *bc =
qobject_cast<QmakeBuildConfiguration *>(target->activeBuildConfiguration());
return bc->buildDirectory().toString();
}

View File

@@ -214,6 +214,7 @@ void IosProbe::setupDefaultToolchains(const QString &devPath, const QString &xco
}
if (hasClang) {
Platform clangProfile;
clangProfile.developerPath = Utils::FileName::fromString(devPath);
clangProfile.platformKind = 0;
clangProfile.name = clangFullName;
clangProfile.platformPath = Utils::FileName(fInfo);
@@ -231,6 +232,7 @@ void IosProbe::setupDefaultToolchains(const QString &devPath, const QString &xco
}
if (hasGcc) {
Platform gccProfile;
gccProfile.developerPath = Utils::FileName::fromString(devPath);
gccProfile.name = gccFullName;
gccProfile.platformKind = 0;
// use the arm-apple-darwin10-llvm-* variant and avoid the extraFlags if available???

View File

@@ -35,8 +35,8 @@
#include <utils/environment.h>
#include <utils/hostosinfo.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakeprojectmanagerconstants.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakeprojectmanagerconstants.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>

View File

@@ -36,9 +36,9 @@
#include <projectexplorer/deployconfiguration.h>
#include <projectexplorer/buildstep.h>
#include <projectexplorer/buildsteplist.h>
#include <qt4projectmanager/qmakebuildconfiguration.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakebuildconfiguration.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtkitinformation.h>
#include "ui_iosrunconfiguration.h"
@@ -144,9 +144,9 @@ QString IosRunConfiguration::profilePath() const
QString IosRunConfiguration::appName() const
{
Qt4Project *pro = qobject_cast<Qt4Project *>(target()->project());
QmakeProject *pro = qobject_cast<QmakeProject *>(target()->project());
if (pro) {
const Qt4ProFileNode *node = pro->rootQt4ProjectNode()->findProFileFor(profilePath());
const QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(profilePath());
if (node) {
TargetInformation ti = node->targetInformation();
if (ti.valid) {
@@ -167,8 +167,8 @@ Utils::FileName IosRunConfiguration::bundleDir() const
qDebug() << "unexpected device type in bundleDirForTarget: " << devType.toString();
return res;
}
Qt4BuildConfiguration *bc =
qobject_cast<Qt4BuildConfiguration *>(target()->activeBuildConfiguration());
QmakeBuildConfiguration *bc =
qobject_cast<QmakeBuildConfiguration *>(target()->activeBuildConfiguration());
if (bc) {
res = bc->buildDirectory();
switch (bc->buildType()) {

View File

@@ -39,8 +39,8 @@
#include <projectexplorer/projectexplorerconstants.h>
#include <projectexplorer/target.h>
#include <debugger/debuggerconstants.h>
#include <qt4projectmanager/qmakeproject.h>
#include <qt4projectmanager/qmakenodes.h>
#include <qmakeprojectmanager/qmakeproject.h>
#include <qmakeprojectmanager/qmakenodes.h>
#include <qtsupport/customexecutablerunconfiguration.h>
#include <qtsupport/qtkitinformation.h>
#include <qtsupport/qtsupportconstants.h>
@@ -97,8 +97,8 @@ QList<Core::Id> IosRunConfigurationFactory::availableCreationIds(Target *parent)
if (!IosManager::supportsIos(parent))
return ids;
Core::Id baseId(IOS_RC_ID_PREFIX);
QList<Qt4ProFileNode *> nodes = static_cast<Qt4Project *>(parent->project())->allProFiles();
foreach (Qt4ProFileNode *node, nodes)
QList<QmakeProFileNode *> nodes = static_cast<QmakeProject *>(parent->project())->allProFiles();
foreach (QmakeProFileNode *node, nodes)
if (node->projectType() == ApplicationTemplate || node->projectType() == LibraryTemplate
|| node->projectType() == AuxTemplate)
ids << baseId.withSuffix(node->path());

View File

@@ -30,7 +30,7 @@
#define IOSRUNFACTORIES_H
#include <projectexplorer/runconfiguration.h>
#include <qt4projectmanager/qmakerunconfigurationfactory.h>
#include <qmakeprojectmanager/qmakerunconfigurationfactory.h>
#include <utils/qtcoverride.h>
namespace ProjectExplorer {

View File

@@ -41,6 +41,7 @@
#include <QCoreApplication>
#include <QList>
#include <QScopedArrayPointer>
#include <QProcessEnvironment>
#if defined(Q_OS_UNIX)
#include <sys/types.h>
@@ -65,6 +66,7 @@ class MyProcess: public QProcess
Q_OBJECT
public:
explicit MyProcess(QObject *parent = 0);
~MyProcess();
int processOutputSocket();
QSocketNotifier *notifier();
protected:
@@ -224,10 +226,15 @@ MyProcess::MyProcess(QObject *parent) : QProcess(parent)
if (socketpair(PF_UNIX, SOCK_STREAM, 0, &m_sockets[0]) == -1) {
qDebug() << "IosToolHandler socketpair failed ";
}
shutdown(m_sockets[0], SHUT_WR);
m_notifier = new QSocketNotifier(m_sockets[0], QSocketNotifier::Read, this);
}
MyProcess::~MyProcess()
{
::close(m_sockets[0]);
::close(m_sockets[1]);
}
int MyProcess::processOutputSocket()
{
return m_sockets[0];
@@ -245,13 +252,16 @@ void MyProcess::setupChildProcess()
emit finished(-1, QProcess::CrashExit);
exit(-1);
}
shutdown(1, SHUT_RD); // leave open for handshake when transferring fd?
}
#else
MyProcess::MyProcess(QObject *parent) : QProcess(parent)
{
}
MyProcess::~MyProcess()
{
}
int MyProcess::processOutputSocket()
{
return 0;
@@ -272,6 +282,11 @@ IosToolHandlerPrivate::IosToolHandlerPrivate(IosToolHandler::DeviceType devType,
q(q), state(NonStarted), devType(devType), buffer(4*lookaheadSize, 0), iBegin(0), iEnd(0),
gdbSocket(-1)
{
QProcessEnvironment env(QProcessEnvironment::systemEnvironment());
foreach (const QString &k, env.keys())
if (k.startsWith(QLatin1String("DYLD_")))
env.remove(k);
process.setProcessEnvironment(env);
QObject::connect(process.notifier(), SIGNAL(activated(int)), q, SLOT(subprocessHasData(int)));
QObject::connect(&process, SIGNAL(finished(int,QProcess::ExitStatus)),
q, SLOT(subprocessFinished(int,QProcess::ExitStatus)));
@@ -498,6 +513,8 @@ int recv_fd(int socket)
if ( (control_message->cmsg_level == SOL_SOCKET) &&
(control_message->cmsg_type == SCM_RIGHTS) ) {
sent_fd = *((int *) CMSG_DATA(control_message));
// aknowledge fd
send(socket, "x", 1, 0);
return sent_fd;
}
}
@@ -777,7 +794,7 @@ void IosToolHandlerPrivate::subprocessHasData(int socket)
currentData = buffer.mid(0, lastXmlSize); // remove this??
}
qptrdiff toRead = lookaheadSize - (iEnd - spacerStart);
qptrdiff reallyRead = recv(socket, buffer.data() + iBegin, toRead, 0);
qptrdiff reallyRead = recv(socket, buffer.data() + iEnd, toRead, 0);
if (reallyRead == 0) { // eof
stop();
return;
@@ -799,14 +816,19 @@ void IosToolHandlerPrivate::subprocessHasData(int socket)
iEnd += reallyRead;
if (reallyRead != toRead)
continue;
if (spacerStart < iEnd && buffer.at(spacerStart) != 'n') {
if (spacerStart < iEnd && buffer.at(spacerStart) != 'N') {
++spacerStart;
while (spacerStart < iEnd && buffer.at(spacerStart) != 'n')
while (spacerStart < iEnd && buffer.at(spacerStart) != 'N')
++spacerStart;
continue;
}
}
if (buffer.at(iEnd-1) != 'd') {
qDebug() << "IosToolHandler: bad alignment of spacer: " << buffer.mid(iBegin, iEnd - iBegin);
return;
}
gdbSocket = recv_fd(socket);
qDebug() << "IosToolHandler: receivedSocket";
gotGdbserverSocket(bundlePath, deviceId, gdbSocket);
stop();
return;

View File

@@ -19,7 +19,7 @@ SUBDIRS = \
cvs \
cpptools \
qtsupport \
qt4projectmanager \
qmakeprojectmanager \
locator \
debugger \
help \

View File

@@ -47,7 +47,7 @@ Project {
"qmlprofiler/qmlprofiler.qbs",
"qmlprojectmanager/qmlprojectmanager.qbs",
"qnx/qnx.qbs",
"qt4projectmanager/qt4projectmanager.qbs",
"qmakeprojectmanager/qmakeprojectmanager.qbs",
"qtsupport/qtsupport.qbs",
"remotelinux/remotelinux.qbs",
"resourceeditor/resourceeditor.qbs",

View File

@@ -111,47 +111,19 @@ static QByteArray runGcc(const FileName &gcc, const QStringList &arguments, cons
return data;
}
static QByteArray gccPredefinedMacros(const FileName &gcc, const QStringList &args, const QStringList &env)
static const QStringList gccPredefinedMacrosOptions()
{
QStringList arguments;
arguments << QLatin1String("-xc++")
<< QLatin1String("-E")
<< QLatin1String("-dM");
foreach (const QString &a, args) {
if (a == QLatin1String("-m128bit-long-double") || a == QLatin1String("-m32")
|| a == QLatin1String("-m3dnow") || a == QLatin1String("-m3dnowa")
|| a == QLatin1String("-m64") || a == QLatin1String("-m96bit-long-double")
|| a == QLatin1String("-mabm") || a == QLatin1String("-maes")
|| a.startsWith(QLatin1String("-march=")) || a == QLatin1String("-mavx")
|| a.startsWith(QLatin1String("-masm=")) || a == QLatin1String("-mcx16")
|| a == QLatin1String("-mfma") || a == QLatin1String("-mfma4")
|| a == QLatin1String("-mlwp") || a == QLatin1String("-mpclmul")
|| a == QLatin1String("-mpopcnt") || a == QLatin1String("-msse")
|| a == QLatin1String("-msse2") || a == QLatin1String("-msse2avx")
|| a == QLatin1String("-msse3") || a == QLatin1String("-msse4")
|| a == QLatin1String("-msse4.1") || a == QLatin1String("-msse4.2")
|| a == QLatin1String("-msse4a") || a == QLatin1String("-mssse3")
|| a.startsWith(QLatin1String("-mtune=")) || a == QLatin1String("-mxop")
|| a == QLatin1String("-Os") || a == QLatin1String("-O0") || a == QLatin1String("-O1")
|| a == QLatin1String("-O2") || a == QLatin1String("-O3")
|| a == QLatin1String("-ffinite-math-only") || a == QLatin1String("-fshort-double")
|| a == QLatin1String("-fshort-wchar") || a == QLatin1String("-fsignaling-nans")
|| a == QLatin1String("-fno-inline") || a == QLatin1String("-fno-exceptions")
|| a == QLatin1String("-fstack-protector") || a == QLatin1String("-fstack-protector-all")
|| a == QLatin1String("-fsanitize=address") || a == QLatin1String("-fno-rtti")
|| a.startsWith(QLatin1String("-std=")) || a.startsWith(QLatin1String("-stdlib="))
|| a.startsWith(QLatin1String("-specs="))
|| a == QLatin1String("-ansi") || a == QLatin1String("-undef")
|| a.startsWith(QLatin1String("-D")) || a.startsWith(QLatin1String("-U"))
|| a == QLatin1String("-fopenmp") || a == QLatin1String("-Wno-deprecated"))
arguments << a;
return QStringList() << QLatin1String("-xc++") << QLatin1String("-E") << QLatin1String("-dM");
}
static QByteArray gccPredefinedMacros(const FileName &gcc, const QStringList &args, const QStringList &env)
{
QStringList arguments = args;
arguments << QLatin1String("-");
QByteArray predefinedMacros = runGcc(gcc, arguments, env);
// Sanity check in case we get an error message instead of real output:
QTC_CHECK(predefinedMacros.startsWith("#define "));
QTC_CHECK(predefinedMacros.isNull() || predefinedMacros.startsWith("#define "));
if (Utils::HostOsInfo::isMacHost()) {
// Turn off flag indicating Apple's blocks support
const QByteArray blocksDefine("#define __BLOCKS__ 1");
@@ -169,23 +141,10 @@ static QByteArray gccPredefinedMacros(const FileName &gcc, const QStringList &ar
const int GccToolChain::PREDEFINED_MACROS_CACHE_SIZE = 16;
QList<HeaderPath> GccToolChain::gccHeaderPaths(const FileName &gcc, const QStringList &args,
const QStringList &env, const FileName &sysrootPath)
QList<HeaderPath> GccToolChain::gccHeaderPaths(const FileName &gcc, const QStringList &arguments,
const QStringList &env)
{
QList<HeaderPath> systemHeaderPaths;
QStringList arguments;
if (!sysrootPath.isEmpty())
arguments.append(QString::fromLatin1("--sysroot=%1").arg(sysrootPath.toString()));
foreach (const QString &a, args) {
if (a.startsWith(QLatin1String("-stdlib=")))
arguments << a;
}
arguments << QLatin1String("-xc++")
<< QLatin1String("-E")
<< QLatin1String("-v")
<< QLatin1String("-");
QByteArray line;
QByteArray data = runGcc(gcc, arguments, env);
QBuffer cpp(&data);
@@ -255,6 +214,7 @@ static QList<Abi> guessGccAbi(const QString &m, const QByteArray &macros)
}
static QList<Abi> guessGccAbi(const FileName &path, const QStringList &env,
const QByteArray &macros,
const QStringList &extraArgs = QStringList())
{
if (path.isEmpty())
@@ -265,7 +225,6 @@ static QList<Abi> guessGccAbi(const FileName &path, const QStringList &env,
QString machine = QString::fromLocal8Bit(runGcc(path, arguments, env)).trimmed();
if (machine.isEmpty())
return QList<Abi>(); // no need to continue if running failed once...
QByteArray macros = gccPredefinedMacros(path, QStringList(), env);
return guessGccAbi(machine, macros);
}
@@ -297,6 +256,38 @@ GccToolChain::GccToolChain(const GccToolChain &tc) :
m_version(tc.m_version)
{ }
void GccToolChain::setMacroCache(const QStringList &allCxxflags, const QByteArray &macros) const
{
if (macros.isNull())
return;
CacheItem runResults;
QByteArray data = macros;
runResults.first = allCxxflags;
if (macros.isNull())
data = QByteArray("");
runResults.second = data;
m_predefinedMacros.push_back(runResults);
if (m_predefinedMacros.size() > PREDEFINED_MACROS_CACHE_SIZE)
m_predefinedMacros.pop_front();
}
QByteArray GccToolChain::macroCache(const QStringList &allCxxflags) const
{
for (GccCache::iterator it = m_predefinedMacros.begin(); it != m_predefinedMacros.end(); ++it) {
if (it->first == allCxxflags) {
// Increase cached item priority
CacheItem pair = *it;
m_predefinedMacros.erase(it);
m_predefinedMacros.push_back(pair);
return pair.second;
}
}
return QByteArray();
}
QString GccToolChain::defaultDisplayName() const
{
if (!m_targetAbi.isValid())
@@ -370,31 +361,49 @@ bool GccToolChain::isValid() const
QByteArray GccToolChain::predefinedMacros(const QStringList &cxxflags) const
{
QStringList allCxxflags = m_platformCodeGenFlags + cxxflags; // add only cxxflags is empty?
typedef QPair<QStringList, QByteArray> CacheItem;
for (GccCache::iterator it = m_predefinedMacros.begin(); it != m_predefinedMacros.end(); ++it)
if (it->first == allCxxflags) {
// Increase cached item priority
CacheItem pair = *it;
m_predefinedMacros.erase(it);
m_predefinedMacros.push_back(pair);
return pair.second;
}
CacheItem runResults;
runResults.first = allCxxflags;
QByteArray macros = macroCache(allCxxflags);
if (!macros.isNull())
return macros;
// Using a clean environment breaks ccache/distcc/etc.
Environment env = Environment::systemEnvironment();
addToEnvironment(env);
runResults.second = gccPredefinedMacros(m_compilerCommand, allCxxflags, env.toStringList());
QStringList arguments = gccPredefinedMacrosOptions();
foreach (const QString &a, allCxxflags) {
if (a == QLatin1String("-m128bit-long-double") || a == QLatin1String("-m32")
|| a == QLatin1String("-m3dnow") || a == QLatin1String("-m3dnowa")
|| a == QLatin1String("-m64") || a == QLatin1String("-m96bit-long-double")
|| a == QLatin1String("-mabm") || a == QLatin1String("-maes")
|| a.startsWith(QLatin1String("-march=")) || a == QLatin1String("-mavx")
|| a.startsWith(QLatin1String("-masm=")) || a == QLatin1String("-mcx16")
|| a == QLatin1String("-mfma") || a == QLatin1String("-mfma4")
|| a == QLatin1String("-mlwp") || a == QLatin1String("-mpclmul")
|| a == QLatin1String("-mpopcnt") || a == QLatin1String("-msse")
|| a == QLatin1String("-msse2") || a == QLatin1String("-msse2avx")
|| a == QLatin1String("-msse3") || a == QLatin1String("-msse4")
|| a == QLatin1String("-msse4.1") || a == QLatin1String("-msse4.2")
|| a == QLatin1String("-msse4a") || a == QLatin1String("-mssse3")
|| a.startsWith(QLatin1String("-mtune=")) || a == QLatin1String("-mxop")
|| a == QLatin1String("-Os") || a == QLatin1String("-O0") || a == QLatin1String("-O1")
|| a == QLatin1String("-O2") || a == QLatin1String("-O3")
|| a == QLatin1String("-ffinite-math-only") || a == QLatin1String("-fshort-double")
|| a == QLatin1String("-fshort-wchar") || a == QLatin1String("-fsignaling-nans")
|| a == QLatin1String("-fno-inline") || a == QLatin1String("-fno-exceptions")
|| a == QLatin1String("-fstack-protector") || a == QLatin1String("-fstack-protector-all")
|| a == QLatin1String("-fsanitize=address") || a == QLatin1String("-fno-rtti")
|| a.startsWith(QLatin1String("-std=")) || a.startsWith(QLatin1String("-stdlib="))
|| a.startsWith(QLatin1String("-specs="))
|| a == QLatin1String("-ansi") || a == QLatin1String("-undef")
|| a.startsWith(QLatin1String("-D")) || a.startsWith(QLatin1String("-U"))
|| a == QLatin1String("-fopenmp") || a == QLatin1String("-Wno-deprecated"))
arguments << a;
}
macros = gccPredefinedMacros(m_compilerCommand, reinterpretOptions(arguments),
env.toStringList());
m_predefinedMacros.push_back(runResults);
if (m_predefinedMacros.size() > PREDEFINED_MACROS_CACHE_SIZE)
m_predefinedMacros.pop_front();
return runResults.second;
setMacroCache(allCxxflags, macros);
return macros;
}
/**
@@ -501,8 +510,24 @@ QList<HeaderPath> GccToolChain::systemHeaderPaths(const QStringList &cxxflags, c
// Using a clean environment breaks ccache/distcc/etc.
Environment env = Environment::systemEnvironment();
addToEnvironment(env);
m_headerPaths = gccHeaderPaths(m_compilerCommand, m_platformCodeGenFlags + cxxflags , // add only cxxflags is empty?
env.toStringList(), sysRoot);
// Prepare arguments
QStringList arguments;
if (!sysRoot.isEmpty())
arguments.append(QString::fromLatin1("--sysroot=%1").arg(sysRoot.toString()));
QStringList flags;
flags << m_platformCodeGenFlags << cxxflags;
foreach (const QString &a, flags) {
if (a.startsWith(QLatin1String("-stdlib=")))
arguments << a;
}
arguments << QLatin1String("-xc++")
<< QLatin1String("-E")
<< QLatin1String("-v")
<< QLatin1String("-");
m_headerPaths = gccHeaderPaths(m_compilerCommand, reinterpretOptions(arguments), env.toStringList());
}
return m_headerPaths;
}
@@ -699,7 +724,8 @@ QList<Abi> GccToolChain::detectSupportedAbis() const
{
Environment env = Environment::systemEnvironment();
addToEnvironment(env);
return guessGccAbi(m_compilerCommand, env.toStringList(), platformCodeGenFlags());
QByteArray macros = predefinedMacros(QStringList());
return guessGccAbi(m_compilerCommand, env.toStringList(), macros, platformCodeGenFlags());
}
QString GccToolChain::detectVersion() const
@@ -778,7 +804,9 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains(const QString &comp
return result;
GccToolChain::addCommandPathToEnvironment(compilerPath, systemEnvironment);
QList<Abi> abiList = guessGccAbi(compilerPath, systemEnvironment.toStringList());
QByteArray macros
= gccPredefinedMacros(compilerPath, gccPredefinedMacrosOptions(), systemEnvironment.toStringList());
QList<Abi> abiList = guessGccAbi(compilerPath, systemEnvironment.toStringList(), macros);
if (!abiList.contains(requiredAbi)) {
if (requiredAbi.wordWidth() != 64
|| !abiList.contains(Abi(requiredAbi.architecture(), requiredAbi.os(), requiredAbi.osFlavor(),
@@ -788,6 +816,7 @@ QList<ToolChain *> GccToolChainFactory::autoDetectToolchains(const QString &comp
foreach (const Abi &abi, abiList) {
QScopedPointer<GccToolChain> tc(createToolChain(true));
tc->setMacroCache(QStringList(), macros);
if (tc.isNull())
return result;
@@ -850,6 +879,7 @@ void GccToolChainConfigWidget::applyImpl()
tc->setDisplayName(displayName); // reset display name
tc->setPlatformCodeGenFlags(splitString(m_platformCodeGenFlagsLineEdit->text()));
tc->setPlatformLinkerFlags(splitString(m_platformLinkerFlagsLineEdit->text()));
tc->setMacroCache(tc->platformCodeGenFlags(), m_macros);
}
void GccToolChainConfigWidget::setFromToolchain()
@@ -912,7 +942,9 @@ void GccToolChainConfigWidget::handleCompilerCommandChange()
if (haveCompiler) {
Environment env = Environment::systemEnvironment();
GccToolChain::addCommandPathToEnvironment(path, env);
abiList = guessGccAbi(path, env.toStringList(),
QStringList args = gccPredefinedMacrosOptions() + splitString(m_platformCodeGenFlagsLineEdit->text());
m_macros = gccPredefinedMacros(path, args, env.toStringList());
abiList = guessGccAbi(path, env.toStringList(), m_macros,
splitString(m_platformCodeGenFlagsLineEdit->text()));
}
m_abiWidget->setEnabled(haveCompiler);

View File

@@ -43,6 +43,7 @@ namespace ProjectExplorer {
namespace Internal {
class ClangToolChainFactory;
class GccToolChainConfigWidget;
class GccToolChainFactory;
class MingwToolChainFactory;
class LinuxIccToolChainFactory;
@@ -98,13 +99,21 @@ protected:
GccToolChain(const GccToolChain &);
typedef QPair<QStringList, QByteArray> CacheItem;
void setMacroCache(const QStringList &allCxxflags, const QByteArray &macroCache) const;
QByteArray macroCache(const QStringList &allCxxflags) const;
virtual QString defaultDisplayName() const;
virtual CompilerFlags defaultCompilerFlags() const;
virtual QList<Abi> detectSupportedAbis() const;
virtual QString detectVersion() const;
static QList<HeaderPath> gccHeaderPaths(const Utils::FileName &gcc, const QStringList &args, const QStringList &env, const Utils::FileName &sysrootPath);
// Reinterpret options for compiler drivers inheriting from GccToolChain (e.g qcc) to apply -Wp option
// that passes the initial options directly down to the gcc compiler
virtual QStringList reinterpretOptions(const QStringList &argument) const { return argument; }
static QList<HeaderPath> gccHeaderPaths(const Utils::FileName &gcc, const QStringList &args, const QStringList &env);
static const int PREDEFINED_MACROS_CACHE_SIZE;
mutable GccCache m_predefinedMacros;
@@ -137,6 +146,7 @@ private:
mutable QList<HeaderPath> m_headerPaths;
mutable QString m_version;
friend class Internal::GccToolChainConfigWidget;
friend class Internal::GccToolChainFactory;
friend class ToolChainFactory;
};

View File

@@ -102,6 +102,7 @@ private:
QList<Abi> m_abiList;
bool m_isReadOnly;
QByteArray m_macros;
};
// --------------------------------------------------------------------------

View File

@@ -312,7 +312,7 @@ FolderNode *FolderNode::findSubFolder(const QString &path)
In-memory presentation of a virtual folder.
Note that the node itself + all children (files and folders) are "managed" by the owning project.
A virtual folder does not correspond to a actual folder on the file system. See for example the
sources, headers and forms folder the qt4projectmanager creates
sources, headers and forms folder the QmakeProjectManager creates
VirtualFolderNodes are always sorted before FolderNodes and are sorted according to their priority.
\sa ProjectExplorer::FileNode, ProjectExplorer::ProjectNode

View File

@@ -1076,7 +1076,7 @@ QVariantMap Version0Handler::convertBuildConfigurations(Project *project, const
if (id == QLatin1String("Qt4ProjectManager.Qt4BuildConfiguration") ||
id.startsWith(QLatin1String("Qt4ProjectManager.Qt4BuildConfiguration."))) {
// Qt4BuildConfiguration:
// QmakeBuildConfiguration:
if (i.key() == QLatin1String("QtVersionId")) {
result.insert(QLatin1String("Qt4ProjectManager.Qt4BuildConfiguration.QtVersionId"),
i.value().toInt());
@@ -1099,7 +1099,7 @@ QVariantMap Version0Handler::convertBuildConfigurations(Project *project, const
result.insert(QLatin1String("Qt4ProjectManager.Qt4BuildConfiguration.BuildDirectory"),
i.value());
} else {
qWarning() << "Unknown Qt4BuildConfiguration Key found:" << i.key() << i.value();
qWarning() << "Unknown QmakeBuildConfiguration Key found:" << i.key() << i.value();
}
continue;
} else if (id == QLatin1String("CMakeProjectManager.CMakeBuildConfiguration")) {

View File

@@ -1,4 +1,4 @@
<plugin name=\"Qt4ProjectManager\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_COMPAT_VERSION\">
<plugin name=\"QmakeProjectManager\" version=\"$$QTCREATOR_VERSION\" compatVersion=\"$$QTCREATOR_COMPAT_VERSION\">
<vendor>Digia Plc</vendor>
<copyright>(C) 2013 Digia Plc</copyright>
<license>
@@ -11,7 +11,7 @@ GNU Lesser General Public License Usage
Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation. Please review the following information to ensure the GNU Lesser General Public License version 2.1 requirements will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
</license>
<category>Build Systems</category>
<description>Provides project type for Qt 4 pro files and tools.</description>
<description>Provides project type for Qt/QMake .pro files and tools.</description>
<url>http://www.qt-project.org</url>
$$dependencyList
</plugin>

Some files were not shown because too many files have changed in this diff Show More