Merge remote-tracking branch 'origin/2.8'

Conflicts:
	src/plugins/cpptools/cppcompletion_test.cpp
	src/plugins/cpptools/cpptoolsplugin.h
	src/plugins/projectexplorer/customtoolchain.cpp
	src/plugins/vcsbase/command.cpp

Change-Id: Ie7b3c9e136c0748b41320227c757471259339b48
This commit is contained in:
Oswald Buddenhagen
2013-08-21 14:39:18 +02:00
92 changed files with 5811 additions and 1686 deletions

134
dist/changes-2.8.1 vendored Normal file
View File

@@ -0,0 +1,134 @@
Qt Creator version 2.8.1 is a bugfix release.
The most important changes are listed in this document. For a complete
list of changes, see the Git log for the Qt Creator sources that
you can check out from the public Git repository. For example:
git clone git://gitorious.org/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline v2.8.0..v2.8.1
There is a total of about 123 changes by 28 individual contributors.
Credits for these changes go to:
Andreas Holzammer
André Pönitz
Aurindam Jana
Christian Kandeler
Christian Stenger
Daniel Teske
David Schulz
Eike Ziller
El Mehdi Fekar
Fawzi Mohamed
Jaroslaw Kobus
Joerg Bornemann
Leena Miettinen
Lukas Holecek
Michal Klocek
Nikolai Kosjar
Orgad Shaneh
Oswald Buddenhagen
Pavel Fric
Petar Perisin
Rainer Keller
Robert Loehning
Sergey Belyashov
Sergio Martins
Thomas Hartmann
Tobias Hunger
Venugopal Shivashankar
Victor Ostashevsky
General
Editing
* Removed trailing whitespace in generated files (QTCREATORBUG-9833)
* Fixed placing cursor after replacing "." with "->" (QTCREATORBUG-9891)
* Fixed crash that occurred when opening non-splittable editors in split
windows (QTCREATORBUG-9843)
* Fixed issues with having same document open in multiple splits
(QTCREATORBUG-9801, QTCREATORBUG-9798)
Managing Projects
Compilers
Devices
* Fixed device changes in kits
QMake Projects
* Fixed tool chain use for cross-compilation
* Avoided deadlock during spec/cache loading
CMake Projects
Qbs Projects
Autotools Projects
Generic Projects
Documentation
* Added tutorial for developing Android applications
* Updated documentation of Android Manifest editor
* Updated some debugger documentation
Debugging
* Fixed dumpers in the presence of -D_GLIBCXX_DEBUG
* Fixed endless loop when stopping without winXXinterrupt.exe
* Added support for GDB builds with Python 3.x
* Added dumper for std::unordered_{set,map} (QTCREATORBUG-9855)
* Improved display performance of unnamed structures (QTCREATORBUG-9947)
* Made C++ debugging continue even if QML debugger fails (QTCREATORBUG-9836)
* Fixed remote QML debugging with port forwarding involved
Analyzer
* Improved Android and QNX support
C++ Support
* Fixed crash in typedef resolving (QTCREATORBUG-9990)
* Improved performance for generated symbols (QTCREATORBUG-9877)
* Added checking whether project has changed before reparsing
(QTCREATORBUG-9581)
Python Support
Diff Viewer
Version Control Systems
* Disabled undo/redo for VCS output window (QTCREATORBUG-7645)
* Git
* Fixed crash on quit while rebase-todo editor is open
* Fixed double stash pop on branch checkout
FakeVim
Platform Specific
Linux
Qt Support
QNX
* Fixed the SSH Key Setup dialog to display native separators in paths
(QTCREATORBUG-9830)
Android
* Ensured that keytool returns English output (QTCREATORBUG-9941)
Translations
* Updated Czech, Polish, Russian and Ukrainian translations
Testing
* Added Squish tests for codepasting, external sort tool,
UI completion, and "Go to slot" in Qt Designer
QML Designer
* Fixed support for layouts
* Fixed several issues in property editor
* Added support for global Qt enums in rewriter

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
doc/images/qtcreator-android-manifest.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

After

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

BIN
doc/images/qtcreator-android-sign-package.png Normal file → Executable file

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@@ -0,0 +1,118 @@
/****************************************************************************
**
** 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

@@ -0,0 +1,47 @@
/****************************************************************************
**
** 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

@@ -0,0 +1,62 @@
/****************************************************************************
**
** 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

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

View File

@@ -0,0 +1,50 @@
/****************************************************************************
**
** 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

@@ -0,0 +1,288 @@
/****************************************************************************
**
** 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.
// **********************************************************************
/*!
\contentspage index.html
\previouspage creator-writing-program.html
\page creator-android-app-tutorial.html
\nextpage creator-project-managing.html
\title Creating an Android Application
This tutorial describes developing Qt Quick applications for Android devices
using Qt Quick Controls.
This tutorial describes how to use \QC to implement a Qt Quick application
that accelerates an SVG (Scalable Vector Graphics) image based on the
changing accelerometer values.
\image creator_android_tutorial_ex_app.png
\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 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).
\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 >
\gui Options > \gui{Build & Run} > \gui Kits.
\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).
\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.
\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.
\list 1
\li Replace the existing import statement with the following:
\snippet qml/tutorial_updatedmainview.qml imports
\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
\skipto ApplicationWindow
\printuntil true
\skipto /^\}/
\printuntil }
\endlist
\section1 Adding an SVG Image
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
\skipto import QtQuick
\printuntil 1.0
\codeline
\skipto ApplicationWindow
\printuntil true
\skipto Image
\printuntil /^\}\
\section1 Moving the Bubble
Now that the visual elements are in place, let us move the bubble based on
Accelerometer sensor values.
\list 1
\li Add the following import statement to accelbubble.qml:
\snippet qml/tutorial_finalmainqml.qml sensorimport
\li Add the Accelerometer type with the necessary properties as shown
in the following code block:
\quotefromfile qml/tutorial_finalmainqml.qml
\skipto Accelerometer
\printuntil true
\skipto }
\printuntil }
\li Add the following JavaScript functions that calculate the
x and y position of the bubble based on the current Accelerometer
values:
\snippet qml/tutorial_finalmainqml.qml jsfunctions
\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
\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
\endlist
\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:
\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.
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.
\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:
\section2 accelbubble.qml
\quotefile qml/tutorial_finalmainqml.qml
\section2 main.cpp
\quotefile tutorial_main.cpp
\section2 accelbubble.pro
\quotefile tutorial_accelbubble.pro
*/

View File

@@ -1,14 +1,13 @@
To specify information for the Android manifest file, select \gui Projects >
To configure Android packages, select \gui Projects >
\gui Run > \gui {Package configurations}. The Android system uses the
information from the file to start application components.
\section2 Specifying Package Data
\image qtcreator-android-manifest.png "Package configuration"
In the \gui Manifest tab, you can select the API level to use for the
Android target SDK and the name and version number for the application
package.
\section2 Selecting API Level
\image qtcreator-android-manifest.png "Manifest tab"
In the \gui {Android target SDK} field, you can select the API level to use
for the Android target SDK.
For more information about Android API levels, see
\l{http://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels}
@@ -21,43 +20,15 @@
\note The android-4 API level does not support multitouch. If your
application needs multitouch, select a higher API level.
In the \gui {Package name} field, enter a package name for the application.
The application is launched by an automatically generated Java launcher that
is packaged with the application into an Android package (.apk). For more
information, see
\l{http://developer.android.com/guide/components/fundamentals.html}
{Android Application Fundamentals}.
\section2 Specifying Application Data
In the \gui Application tab, you can select an icon for the application and
give the application a name.
\image qtcreator-android-application.png "Application tab"
\section2 Setting Permissions
In the \gui Permissions tab, you can specify the permissions that your
application needs. Users are asked to grant the permissions when they
install the application. Android OS then grants the application access to
the appropriate data and features.
\image qtcreator-android-permissions.png "Permissions tab"
Select from existing Android permissions or add new ones to deploy the
application to a particular Android OS.
\section2 Selecting Qt Libraries
In the \gui Libraries tab, specify which Qt libraries the application uses.
In the \gui Libraries group, specify which Qt libraries the application uses.
To automatically determine this, select \gui {Read Infomation from
Application (Must Be Compiled)}. Alternatively, you can manually select the
Qt libraries and the external libraries you think your application needs.
Make sure to arrange the libraries so that depended libraries appear before
the ones that depend on them.
\image qtcreator-android-libraries.png "Libraries tab"
These entries are used by the Ministro tool to determine which Qt libraries
to download.
@@ -66,8 +37,38 @@
\section2 Signing Android Packages
In the \gui {Sign Package} tab, you can sign the Android package by using
In the \gui {Sign Package} group you can sign the Android package by using
a private key from the keystore. To create new keys, select \gui Create.
\image qtcreator-android-sign-package.png "Sign Package tab"
\image qtcreator-android-sign-package.png "Sign Package"
\section1 Editing Manifest Files
To specify information for the Android manifest file, open it in \QC.
\image qtcreator-android-manifest-editor.png "Android Manifest Editor"
Select the \gui {XML Source} tab to edit the file in XML format.
In the \gui {Package name} field, enter a package name for the application.
The application is launched by an automatically generated Java launcher that
is packaged with the application into an Android package (.apk). For more
information, see
\l{http://developer.android.com/guide/components/fundamentals.html}
{Android Application Fundamentals}.
You can specify an internal version number for the package in the
\gui {Version code} field. It is used to determine whether one version of
the application is more recent than another. In the \gui {Version name}
field, specify the version number that is shown to users.
In the \gui Application group, you can give the application a name and
select an icon for it. The three icon fields can contain different versions
of the icon with low, medium, and high DPI values, from left to right.
In the \gui Permissions field, you can specify the permissions that your
application needs. Users are asked to grant the permissions when they
install the application. Android OS then grants the application access to
the appropriate data and features.
To add permissions, select \gui Add and select permissions from the list.

View File

@@ -125,13 +125,33 @@
\list 1
\li Start the application.
\li Build the application by using the appropriate configuration
parameters (if you build the application with \QC, it automatically
uses the correct configuration):
\list
\li Qt Quick 1: \c {CONFIG+=declarative_debug}
\li Qt Quick 2: \c {CONFIG+=qml_debug}
\endlist
\li Start the application with the following arguments:
\c {qmljsdebugger=port:<port>[,host:<ip address>][,block]}
Where \c port (mandatory) specifies the debugging port,
\c {ip address} (optional) specifies the IP address of the host
where the application is running, and \c block (optional) prevents
the application from running until the debug client connects to the
server. This enables debugging from the start.
\li Select \gui {Debug > Start Debugging > Attach to QML Port}.
When debugging on the desktop, you can use the default values for
the connection. When debugging on devices, enter the device IP
address in the \gui Host field.
Choose the kit configured for the device where the application to
be debugged is running. The port number to use is displayed in the
standard output when the application starts.
\endlist

View File

@@ -46,6 +46,11 @@
Learn how to create a Qt widget based application for the desktop.
\li \l{Creating an Android Application}
Learn how to create a Qt Quick application using Qt Quick Controls
for Android devices.
\endlist
*/

View File

@@ -24,7 +24,7 @@
/*!
\contentspage index.html
\previouspage creator-writing-program.html
\previouspage creator-android-app-tutorial.html
\page creator-project-managing.html
\nextpage creator-project-creating.html

View File

@@ -154,6 +154,7 @@
\list
\li \l{Creating a Qt Quick Application}
\li \l{Creating a Qt Widget Based Application}
\li \l{Creating an Android Application}
\endlist
\endlist
\li \l{Managing Projects}

View File

@@ -26,7 +26,7 @@
\contentspage index.html
\previouspage creator-qml-application.html
\page creator-writing-program.html
\nextpage creator-project-managing.html
\nextpage creator-android-app-tutorial.html
\title Creating a Qt Widget Based Application

View File

@@ -2272,6 +2272,12 @@ def qdump__std__map(d, value):
def qdump__std____debug__map(d, value):
qdump__std__map(d, value)
def qdump__std____debug__set(d, value):
qdump__std__set(d, value)
def qdump__std____cxx1998__map(d, value):
qdump__std__map(d, value)
def stdTreeIteratorHelper(d, value):
pnode = value["_M_node"]
node = pnode.dereference()
@@ -2308,6 +2314,9 @@ def qdump__std___Rb_tree_const_iterator(d, value):
def qdump__std__map__iterator(d, value):
stdTreeIteratorHelper(d, value)
def qdump____gnu_debug___Safe_iterator(d, value):
d.putItem(value["_M_current"])
def qdump__std__map__const_iterator(d, value):
stdTreeIteratorHelper(d, value)
@@ -2317,7 +2326,8 @@ def qdump__std__set__iterator(d, value):
def qdump__std__set__const_iterator(d, value):
stdTreeIteratorHelper(d, value)
def qdump__std____cxx1998__set(d, value):
qdump__std__set(d, value)
def qdump__std__set(d, value):
impl = value["_M_t"]["_M_impl"]
@@ -2484,6 +2494,67 @@ def qdump__std____1__unique_ptr(d, value):
d.putSubItem("data", i.dereference())
def qform__std__unordered_map():
return mapForms()
def qform__std____debug__unordered_map():
return mapForms()
def qdump__std__unordered_map(d, value):
try:
size = value["_M_element_count"]
start = value["_M_before_begin"]["_M_nxt"]
except:
size = value["_M_h"]["_M_element_count"]
start = value["_M_h"]["_M_bbegin"]["_M_node"]["_M_nxt"]
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
p = pointerValue(start)
keyType = d.templateArgument(value.type, 0)
valueType = d.templateArgument(value.type, 1)
allocatorType = d.templateArgument(value.type, 4)
pairType = d.templateArgument(allocatorType, 0)
ptrSize = d.ptrSize()
if d.isMapCompact(keyType, valueType):
with Children(d, size, childType=valueType):
for i in d.childRange():
pair = d.createValue(p + ptrSize, pairType)
with SubItem(d, i):
d.putField("iname", d.currentIName)
d.putName("[%s] %s" % (i, pair["first"]))
d.putValue(pair["second"])
p = d.dereference(p)
else:
with Children(d, size, childType=pairType):
for i in d.childRange():
d.putSubItem(i, d.createValue(p + ptrSize, pairType))
p = d.dereference(p)
def qdump__std____debug__unordered_map(d, value):
qdump__std__unordered_map(d, value)
def qdump__std__unordered_set(d, value):
try:
size = value["_M_element_count"]
start = value["_M_before_begin"]["_M_nxt"]
except:
size = value["_M_h"]["_M_element_count"]
start = value["_M_h"]["_M_bbegin"]["_M_node"]["_M_nxt"]
d.putItemCount(size)
d.putNumChild(size)
if d.isExpanded():
p = pointerValue(start)
valueType = d.templateArgument(value.type, 0)
with Children(d, size, childType=valueType):
ptrSize = d.ptrSize()
for i in d.childRange():
d.putSubItem(i, d.createValue(p + ptrSize, valueType))
p = d.dereference(p)
def qdump__std____debug__unordered_set(d, value):
qdump__std__unordered_set(d, value)
def qedit__std__vector(expr, value):
values = value.split(',')
@@ -2917,6 +2988,10 @@ def qdump__CPlusPlus__Literal(d, value):
d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
d.putPlainChildren(value)
def qdump__CPlusPlus__StringLiteral(d, value):
d.putValue(encodeCharArray(value["_chars"]), Hex2EncodedLatin1)
d.putPlainChildren(value)
def qdump__CPlusPlus__Internal__Value(d, value):
d.putValue(value["l"])
d.putPlainChildren(value)

File diff suppressed because it is too large Load Diff

View File

@@ -137,13 +137,6 @@
<translation>Настройки анализатора</translation>
</message>
</context>
<context>
<name>Analyzer::Internal::AnalyzerRunControlFactory</name>
<message>
<source>No analyzer tool selected</source>
<translation>Инструмент анализа не выбран</translation>
</message>
</context>
<context>
<name>Analyzer::Internal::AnalyzerToolDetailWidget</name>
<message>
@@ -811,10 +804,6 @@ Please make sure your application is built successfully and is selected in Appli
</context>
<context>
<name>Android::Internal::AndroidSettingsWidget</name>
<message>
<source>Android SDK Folder</source>
<translation>Каталог Android SDK</translation>
</message>
<message>
<source>&quot;%1&quot; does not seem to be an Android SDK top folder.</source>
<translation>Не похоже, чтобы «%1» был корневым каталогом Android SDK.</translation>
@@ -9875,7 +9864,7 @@ receives a signal like SIGSEGV during debugging.</source>
<name>Debugger::Internal::GdbOptionsPage2</name>
<message>
<source>GDB Extended</source>
<translation type="unfinished">GDB, расширенные</translation>
<translation>GDB, расширенные</translation>
</message>
</context>
<context>
@@ -13151,6 +13140,10 @@ Reason: %3</source>
<source>Flow</source>
<translation>Перетекание</translation>
</message>
<message>
<source>Layout direction</source>
<translation>Направление компоновки</translation>
</message>
<message>
<source>Spacing</source>
<translation>Отступ</translation>
@@ -15627,6 +15620,10 @@ You can choose between stashing the changes or discarding them.</source>
<source>Flow</source>
<translation>Перетекание</translation>
</message>
<message>
<source>Layout direction</source>
<translation>Направление компоновки</translation>
</message>
<message>
<source>Spacing</source>
<translation>Отступ</translation>
@@ -24480,6 +24477,42 @@ Remote stderr was: %1</source>
<source>Reset z Property</source>
<translation>Сбросить свойство z</translation>
</message>
<message>
<source>Layout in Column (Positioner)</source>
<translation>Компоновать в колонку (позиционер)</translation>
</message>
<message>
<source>Layout in Row (Positioner)</source>
<translation>Компоновать в строку (позиционер)</translation>
</message>
<message>
<source>Layout in Grid (Positioner)</source>
<translation>Компоновать по сетке (позиционер)</translation>
</message>
<message>
<source>Layout in Flow (Positioner)</source>
<translation>Перетекающая компоновка (позиционер)</translation>
</message>
<message>
<source>Layout in ColumnLayout</source>
<translation>Компоновать в ColumnLayout</translation>
</message>
<message>
<source>Layout in RowLayout</source>
<translation>Компоновать в RowLayout</translation>
</message>
<message>
<source>Layout in GridLayout</source>
<translation>Компоновать в GridLayout</translation>
</message>
<message>
<source>Fill Width</source>
<translation>Растянуть по ширине</translation>
</message>
<message>
<source>Fill Height</source>
<translation>Растянуть по высоте</translation>
</message>
<message>
<source>Go into Component</source>
<translation>Перейти к элементу</translation>
@@ -24496,22 +24529,6 @@ Remote stderr was: %1</source>
<source>Reset</source>
<translation>Сбросить</translation>
</message>
<message>
<source>Layout in Column</source>
<translation>Компоновать в колонку</translation>
</message>
<message>
<source>Layout in Row</source>
<translation>Компоновать в строку</translation>
</message>
<message>
<source>Layout in Grid</source>
<translation>Компоновать по сетке</translation>
</message>
<message>
<source>Layout in Flow</source>
<translation>Перетекающая компоновка</translation>
</message>
</context>
<context>
<name>QmlDumpBuildTask</name>
@@ -25602,6 +25619,13 @@ Error: %2</source>
<translation>Ожидаемая лексема «%1»</translation>
</message>
</context>
<context>
<name>QmlProfiler::Internal::LocalQmlProfilerRunner</name>
<message>
<source>No executable file to launch.</source>
<translation>Нет программы для запуска.</translation>
</message>
</context>
<context>
<name>QmlProfiler::Internal::QmlProfilerAttachDialog</name>
<message>
@@ -25722,10 +25746,6 @@ Do you want to retry?</source>
<translation>Не удалось подключиться к внутрипроцессному отладчику QML.
%1</translation>
</message>
<message>
<source>No executable file to launch.</source>
<translation>Нет программы для запуска.</translation>
</message>
</context>
<context>
<name>QmlProfiler::Internal::QmlProfilerEventsMainView</name>
@@ -25890,6 +25910,13 @@ references to elements in other files, loops, etc.)</source>
<translation>Сбровить панель событий</translation>
</message>
</context>
<context>
<name>QmlProfiler::Internal::QmlProfilerRunControlFactory</name>
<message>
<source>No analyzer tool selected</source>
<translation>Инструмент анализа не выбран</translation>
</message>
</context>
<context>
<name>QmlProfiler::Internal::QmlProfilerStateWidget</name>
<message>
@@ -31546,6 +31573,10 @@ Remote stderr was: &apos;%1&apos;</source>
<source>Row</source>
<translation>Строка</translation>
</message>
<message>
<source>Layout direction</source>
<translation>Направление компоновки</translation>
</message>
<message>
<source>Spacing</source>
<translation>Отступ</translation>
@@ -35984,6 +36015,13 @@ With cache simulation, further event counters are enabled:
</translation>
</message>
</context>
<context>
<name>Valgrind::Internal::ValgrindRunControlFactory</name>
<message>
<source>No analyzer tool selected</source>
<translation>Инструмент анализа не выбран</translation>
</message>
</context>
<context>
<name>Valgrind::Internal::Visualisation</name>
<message>

View File

@@ -34,6 +34,7 @@ Product {
var list = [
"lrelease.xml",
"lupdate.xml",
"qmlscene.xml",
"qmlviewer.xml",
"sort.xml",
]

View File

@@ -528,6 +528,7 @@ CPLUSPLUS_EXPORT QString simplifySTLType(const QString &typeIn)
type.remove(0, 7);
type.replace(QLatin1String("std::__1::"), QLatin1String("std::"));
type.replace(QLatin1String("std::__debug::"), QLatin1String("std::"));
type.replace(QLatin1Char('*'), QLatin1Char('@'));
for (int i = 0; i < 10; ++i) {
@@ -586,6 +587,14 @@ CPLUSPLUS_EXPORT QString simplifySTLType(const QString &typeIn)
if (setRE.indexIn(type) != -1)
type.replace(setRE.cap(0), QString::fromLatin1("set<%1>").arg(inner));
// std::unordered_set
QRegExp unorderedSetRE(QString::fromLatin1("unordered_set<%1, ?std::hash<%2>, ?std::equal_to<%3>, ?%4\\s*>")
.arg(innerEsc, innerEsc, innerEsc, allocEsc));
unorderedSetRE.setMinimal(true);
QTC_ASSERT(unorderedSetRE.isValid(), return typeIn);
if (unorderedSetRE.indexIn(type) != -1)
type.replace(unorderedSetRE.cap(0), QString::fromLatin1("unordered_set<%1>").arg(inner));
// std::map
if (inner.startsWith(QLatin1String("std::pair<"))) {
// search for outermost ',', split key and value
@@ -621,6 +630,35 @@ CPLUSPLUS_EXPORT QString simplifySTLType(const QString &typeIn)
type.replace(mapRE2.cap(0), QString::fromLatin1("map<const %1, %2>").arg(key, value));
}
}
// std::unordered_map
if (inner.startsWith(QLatin1String("std::pair<"))) {
// search for outermost ',', split key and value
int pos;
int level = 0;
for (pos = 10; pos < inner.size(); ++pos) {
int c = inner.at(pos).unicode();
if (c == '<')
++level;
else if (c == '>')
--level;
else if (c == ',' && level == 0)
break;
}
const QString key = chopConst(inner.mid(10, pos - 10));
const QString keyEsc = QRegExp::escape(key);
// Get value: MSVC: 'pair<a const ,b>', gcc: 'pair<const a, b>'
if (inner.at(++pos) == QLatin1Char(' '))
pos++;
const QString value = inner.mid(pos, inner.size() - pos - 1).trimmed();
const QString valueEsc = QRegExp::escape(value);
QRegExp mapRE1(QString::fromLatin1("unordered_map<%1, ?%2, ?std::hash<%3 ?>, ?std::equal_to<%4 ?>, ?%5\\s*>")
.arg(keyEsc, valueEsc, keyEsc, keyEsc, allocEsc));
mapRE1.setMinimal(true);
QTC_ASSERT(mapRE1.isValid(), return typeIn);
if (mapRE1.indexIn(type) != -1)
type.replace(mapRE1.cap(0), QString::fromLatin1("unordered_map<%1, %2>").arg(key, value));
}
}
type.replace(QLatin1Char('@'), QLatin1Char('*'));
type.replace(QLatin1String(" >"), QLatin1String(">"));

View File

@@ -911,6 +911,8 @@ private:
static QList<LookupItem> typedefsFromScopeUpToFunctionScope(const Name *name, Scope *scope)
{
QList<LookupItem> results;
if (!scope)
return results;
Scope *enclosingBlockScope = 0;
for (Block *block = scope->asBlock(); block;
block = enclosingBlockScope ? enclosingBlockScope->asBlock() : 0) {
@@ -994,7 +996,7 @@ ClassOrNamespace *ResolveExpression::baseExpression(const QList<LookupItem> &bas
TypedefsResolver typedefsResolver(_context);
foreach (const LookupItem &r, baseResults) {
if (!r.type().type())
if (!r.type().type() || !r.scope())
continue;
FullySpecifiedType ty = r.type().simplified();
FullySpecifiedType originalType = ty;

View File

@@ -842,8 +842,9 @@ static void fixValue(const std::string &type, std::wstring *value)
const bool isHexNumber = value->size() > 3 && value->compare(0, 2, L"0x") == 0 && isHexDigit(value->at(2));
if (isHexNumber) {
// Remove dumb 64bit separator
if (value->size() > 10 && value->at(10) == L'`')
value->erase(10, 1);
const size_t separator = value->find(L'`');
if (separator != std::wstring::npos)
value->erase(separator, 1);
const std::string::size_type firstNonNullDigit = value->find_first_not_of(L"0", 2);
// No on-null digits: plain null ptr.
if (firstNonNullDigit == std::string::npos || value->at(firstNonNullDigit) == ' ') {

View File

@@ -30,7 +30,9 @@
#include "hostosinfo.h"
#ifdef Q_OS_WIN
#include <windows.h>
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 /* WinXP, needed for GetNativeSystemInfo() */
#include <qt_windows.h>
#endif
using namespace Utils;

View File

@@ -398,6 +398,9 @@ QAbstractItemModel *AndroidPackageCreationStep::keystoreCertificates()
if (!m_keystorePasswd.length())
return 0;
params << m_keystorePasswd;
Utils::Environment env = Utils::Environment::systemEnvironment();
env.set(QLatin1String("LANG"), QLatin1String("C"));
keytoolProc.setProcessEnvironment(env.toProcessEnvironment());
keytoolProc.start(AndroidConfigurations::instance().keytoolPath().toString(), params);
if (!keytoolProc.waitForStarted() || !keytoolProc.waitForFinished()) {
QMessageBox::critical(0, tr("Error"),

View File

@@ -162,6 +162,7 @@ private slots:
void test_quickfix_InsertDefFromDecl_notTriggeringWhenDefinitionExists();
void test_quickfix_InsertDefFromDecl_notTriggeringStatement();
void test_quickfix_InsertDefFromDecl_findRightImplementationFile();
void test_quickfix_InsertDefFromDecl_ignoreSurroundingGeneratedDeclarations();
void test_quickfix_InsertDefFromDecl_respectWsInOperatorNames1();
void test_quickfix_InsertDefFromDecl_respectWsInOperatorNames2();

View File

@@ -1161,6 +1161,63 @@ void CppEditorPlugin::test_quickfix_InsertDefFromDecl_findRightImplementationFil
data.run(&factory);
}
/// Ignore generated functions declarations when looking at the surrounding
/// functions declarations in order to find the right implementation file.
void CppEditorPlugin::test_quickfix_InsertDefFromDecl_ignoreSurroundingGeneratedDeclarations()
{
QList<TestDocumentPtr> testFiles;
QByteArray original;
QByteArray expected;
// Header File
original =
"#define DECLARE_HIDDEN_FUNCTION void hidden();\n"
"struct Foo\n"
"{\n"
" void a();\n"
" DECLARE_HIDDEN_FUNCTION\n"
" void b@();\n"
"};\n"
"}\n";
expected = original + '\n';
testFiles << TestDocument::create(original, expected, QLatin1String("file.h"));
// Source File #1
original =
"#include \"file.h\"\n"
"\n"
"void Foo::a()\n"
"{\n\n"
"}\n";
expected =
"#include \"file.h\"\n"
"\n"
"void Foo::a()\n"
"{\n\n"
"}\n"
"\n"
"void Foo::b()\n"
"{\n\n"
"}\n"
"\n";
testFiles << TestDocument::create(original, expected, QLatin1String("file.cpp"));
// Source File #2
original =
"#include \"file.h\"\n"
"\n"
"void Foo::hidden()\n"
"{\n\n"
"}\n";
expected = original + '\n';
testFiles << TestDocument::create(original, expected, QLatin1String("file2.cpp"));
InsertDefFromDecl factory;
TestCase data(testFiles);
data.run(&factory);
}
/// Check if whitespace is respected for operator functions
void CppEditorPlugin::test_quickfix_InsertDefFromDecl_respectWsInOperatorNames1()
{

File diff suppressed because it is too large Load Diff

View File

@@ -476,8 +476,10 @@ private:
void CppAssistProposal::makeCorrection(BaseTextEditor *editor)
{
const int oldPosition = editor->position();
editor->setCursorPosition(basePosition() - 1);
editor->replace(1, QLatin1String("->"));
editor->setCursorPosition(oldPosition + 1);
moveBasePosition(1);
}
@@ -604,6 +606,24 @@ Function *asFunctionOrTemplateFunctionType(FullySpecifiedType ty)
return 0;
}
bool isQPrivateSignal(const Symbol *symbol)
{
if (!symbol)
return false;
static Identifier qPrivateSignalIdentifier("QPrivateSignal", 14);
if (FullySpecifiedType type = symbol->type()) {
if (NamedType *namedType = type->asNamedType()) {
if (const Name *name = namedType->name()) {
if (name->isEqualTo(&qPrivateSignalIdentifier))
return true;
}
}
}
return false;
}
} // Anonymous
// ----------------------------
@@ -1639,6 +1659,8 @@ bool CppCompletionAssistProcessor::completeQtMethod(const QList<CPlusPlus::Looku
signature += QLatin1Char('(');
for (unsigned i = 0; i < count; ++i) {
Symbol *arg = fun->argumentAt(i);
if (isQPrivateSignal(arg))
continue;
if (i != 0)
signature += QLatin1Char(',');
signature += o.prettyType(arg->type());

View File

@@ -176,6 +176,8 @@ private slots:
void test_completion_local_type_and_member_5();
void test_completion_local_type_and_member_6();
void test_completion_signals_hide_QPrivateSignal();
void test_format_pointerdeclaration_in_simpledeclarations();
void test_format_pointerdeclaration_in_simpledeclarations_data();
void test_format_pointerdeclaration_in_controlflowstatements();

View File

@@ -498,8 +498,7 @@ static InsertionLocation nextToSurroundingDefinitions(Symbol *declaration,
Declaration *surroundingFunctionDecl = 0;
for (int i = declIndex - 1; i >= 0; --i) {
Symbol *s = klass->memberAt(i);
surroundingFunctionDecl = isNonVirtualFunctionDeclaration(s);
if (!surroundingFunctionDecl)
if (s->isGenerated() || !(surroundingFunctionDecl = isNonVirtualFunctionDeclaration(s)))
continue;
if ((definitionFunction = symbolFinder.findMatchingDefinition(surroundingFunctionDecl,
changes.snapshot())))

View File

@@ -1156,19 +1156,20 @@ void CdbEngine::interruptInferior()
if (debug)
qDebug() << "CdbEngine::interruptInferior()" << stateName(state());
bool ok = false;
if (!canInterruptInferior())
if (!canInterruptInferior()) {
// Restore running state if inferior can't be stoped.
showMessage(tr("Interrupting is not possible in remote sessions."), LogError);
else
ok = doInterruptInferior(NoSpecialStop);
// Restore running state if stop failed.
if (!ok) {
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorStopOk")
notifyInferiorStopOk();
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorRunRequested")
notifyInferiorRunRequested();
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorRunOk")
notifyInferiorRunOk();
return;
}
if (!doInterruptInferior(NoSpecialStop)) {
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorStopFailed")
notifyInferiorStopFailed();
}
}

View File

@@ -325,14 +325,14 @@ DebuggerKitInformation::DebuggerItem DebuggerKitInformation::variantToItem(const
break;
}
}
result.binary = Utils::FileName::fromString(binary);
result.binary = Utils::FileName::fromUserInput(binary);
return result;
}
QVariant DebuggerKitInformation::itemToVariant(const DebuggerItem &i)
{
QVariantMap vmap;
vmap.insert(QLatin1String(binaryKeyC), QVariant(i.binary.toUserOutput()));
vmap.insert(QLatin1String(binaryKeyC), QVariant(i.binary.toString()));
vmap.insert(QLatin1String(engineTypeKeyC), QVariant(int(i.engineType)));
return QVariant(vmap);
}

View File

@@ -2664,6 +2664,7 @@ void DebuggerPluginPrivate::runControlFinished(DebuggerEngine *engine)
m_snapshotHandler->activateSnapshot(0);
}
action(OperateByInstruction)->setValue(QVariant(false));
m_logWindow->clearUndoRedoStacks();
}
void DebuggerPluginPrivate::remoteCommand(const QStringList &options,

View File

@@ -114,7 +114,6 @@ public:
QString remoteChannel;
QString symbolFileName;
QString serverStartScript;
QString searchPath; // Gdb "set solib-search-path"
QString debugInfoLocation; // Gdb "set-debug-file-directory".
QStringList debugSourceLocation; // Gdb "directory"
QByteArray remoteSourcesDir;

View File

@@ -1829,7 +1829,7 @@ void GdbEngine::handleShowVersion(const GdbResponse &response)
postCommand("set detach-on-fork off", ConsoleCommand);
//postCommand("set build-id-verbose 2", ConsoleCommand);
postCommand("python print 43", ConsoleCommand, CB(handleHasPython));
postCommand("python print(sys.version)", ConsoleCommand, CB(handleHasPython));
}
}

View File

@@ -200,6 +200,13 @@ public:
appendPlainText(text);
}
void clearUndoRedoStacks()
{
if (!isUndoRedoEnabled())
return;
setUndoRedoEnabled(false);
setUndoRedoEnabled(true);
}
private slots:
void saveContents();
@@ -551,6 +558,12 @@ QString LogWindow::inputContents() const
return m_inputText->toPlainText();
}
void LogWindow::clearUndoRedoStacks()
{
m_inputText->clearUndoRedoStacks();
m_combinedText->clearUndoRedoStacks();
}
QString LogWindow::logTimeStamp()
{
// Cache the last log time entry by ms. If time progresses,

View File

@@ -61,6 +61,8 @@ public:
QString combinedContents() const;
QString inputContents() const;
void clearUndoRedoStacks();
static QString logTimeStamp();
static bool writeLogContents(const QPlainTextEdit *editor, QWidget *parent = 0);

View File

@@ -761,9 +761,6 @@ void QmlCppEngine::slaveEngineStateChanged
QTC_ASSERT(state() == InferiorRunRequested, qDebug() << state());
notifyInferiorRunOk();
}
} else if (newState == EngineRunFailed) {
if (d->m_cppEngine->targetState() != DebuggerFinished)
d->m_cppEngine->quitDebugger();
}
}
}

View File

@@ -965,9 +965,10 @@ bool WatchTreeView::event(QEvent *ev)
return BaseTreeView::event(ev);
}
void WatchTreeView::currentChanged(const QModelIndex &current, const QModelIndex &)
void WatchTreeView::currentChanged(const QModelIndex &current, const QModelIndex &previous)
{
emit currentIndexChanged(current);
BaseTreeView::currentChanged(current, previous);
}
void WatchTreeView::editItem(const QModelIndex &idx)

View File

@@ -1026,7 +1026,6 @@ FakeVimPluginPrivate::~FakeVimPluginPrivate()
q->removeObject(m_fakeVimOptionsPage);
delete m_fakeVimOptionsPage;
m_fakeVimOptionsPage = 0;
delete theFakeVimSettings();
q->removeObject(m_fakeVimExCommandsPage);
delete m_fakeVimExCommandsPage;
@@ -1035,6 +1034,8 @@ FakeVimPluginPrivate::~FakeVimPluginPrivate()
q->removeObject(m_fakeVimUserCommandsPage);
delete m_fakeVimUserCommandsPage;
m_fakeVimUserCommandsPage = 0;
theFakeVimSettings()->deleteLater();
}
void FakeVimPluginPrivate::onCoreAboutToClose()

View File

@@ -203,8 +203,8 @@ void BranchDialog::checkout()
} else if (branchCheckoutDialog.exec() == QDialog::Accepted && m_model) {
if (branchCheckoutDialog.makeStashOfCurrentBranch()) {
if (!gitClient->executeSynchronousStash(m_repository,
currentBranch + QLatin1String("-AutoStash"))) {
if (gitClient->synchronousStash(m_repository,
currentBranch + QLatin1String("-AutoStash")).isEmpty()) {
return;
}
} else if (branchCheckoutDialog.moveLocalChangesToNextBranch()) {

View File

@@ -697,7 +697,10 @@ public:
~ConflictHandler()
{
GitClient *client = GitPlugin::instance()->gitClient();
// If interactive rebase editor window is closed, plugin is terminated
// but referenced here when the command ends
if (GitPlugin *plugin = GitPlugin::instance()) {
GitClient *client = plugin->gitClient();
if (m_commit.isEmpty() && m_files.isEmpty()) {
if (client->checkCommandInProgress(m_workingDirectory) == GitClient::NoCommand)
client->endStashScope(m_workingDirectory);
@@ -705,6 +708,7 @@ public:
client->handleMergeConflicts(m_workingDirectory, m_commit, m_files, m_command);
}
}
}
public slots:
void readStdOut(const QString &data)

View File

@@ -278,7 +278,9 @@ bool AbstractMsvcToolChain::generateEnvironmentSettings(Utils::Environment &env,
// if Creator is launched within a session set up by setenv.cmd.
env.unset(QLatin1String("ORIGINALPATH"));
run.setEnvironment(env);
const QString cmdPath = QString::fromLocal8Bit(qgetenv("COMSPEC"));
QString cmdPath = QString::fromLocal8Bit(qgetenv("COMSPEC"));
if (cmdPath.isEmpty())
cmdPath = env.searchInPath(QLatin1String("cmd.exe"));
// Windows SDK setup scripts require command line switches for environment expansion.
QString cmdArguments = QLatin1String(" /E:ON /V:ON /c \"");
cmdArguments += QDir::toNativeSeparators(saver.fileName());

View File

@@ -519,9 +519,13 @@ CustomToolChainConfigWidget::CustomToolChainConfigWidget(CustomToolChain *tc) :
m_predefinedDetails->updateSummaryText();
m_headerDetails->updateSummaryText();
connect(m_compilerCommand, SIGNAL(changed(QString)), this, SIGNAL(dirty()));
connect(m_makeCommand, SIGNAL(changed(QString)), this, SIGNAL(dirty()));
connect(m_abiWidget, SIGNAL(abiChanged()), this, SIGNAL(dirty()));
connect(m_predefinedMacros, SIGNAL(textChanged()), this, SLOT(updateSummaries()));
connect(m_headerPaths, SIGNAL(textChanged()), this, SLOT(updateSummaries()));
connect(m_cxx11Flags, SIGNAL(textChanged(QString)), this, SIGNAL(dirty()));
connect(m_mkspecs, SIGNAL(textChanged(QString)), this, SIGNAL(dirty()));
connect(m_errorParserComboBox, SIGNAL(currentIndexChanged(int)),
this, SLOT(errorParserChanged(int)));
connect(m_customParserSettingsButton, SIGNAL(clicked()),
@@ -535,6 +539,7 @@ void CustomToolChainConfigWidget::updateSummaries()
m_predefinedDetails->updateSummaryText();
else
m_headerDetails->updateSummaryText();
emit dirty();
}
void CustomToolChainConfigWidget::errorParserChanged(int index)

View File

@@ -935,6 +935,8 @@ void GccToolChainConfigWidget::makeReadOnlyImpl()
{
m_compilerCommand->setEnabled(false);
m_abiWidget->setEnabled(false);
m_platformCodeGenFlagsLineEdit->setEnabled(false);
m_platformLinkerFlagsLineEdit->setEnabled(false);
m_isReadOnly = true;
}

View File

@@ -48,6 +48,7 @@
#include <texteditor/icodestylepreferencesfactory.h>
#include <texteditor/normalindenter.h>
#include <texteditor/tabsettings.h>
#include <texteditor/storagesettings.h>
#include <projectexplorer/project.h>
#include <projectexplorer/editorconfiguration.h>
@@ -571,13 +572,19 @@ void ProjectFileWizardExtension::applyCodeStyle(Core::GeneratedFile *file) const
TextEditor::ICodeStylePreferences *codeStylePrefs = codeStylePreferences(baseProject, languageId);
indenter->setCodeStylePreferences(codeStylePrefs);
QTextDocument doc(file->contents());
QTextCursor cursor(&doc);
cursor.select(QTextCursor::Document);
indenter->indent(&doc, cursor, QChar::Null, codeStylePrefs->currentTabSettings());
file->setContents(doc.toPlainText());
delete indenter;
if (TextEditor::TextEditorSettings::instance()->storageSettings().m_cleanWhitespace) {
QTextBlock block = doc.firstBlock();
while (block.isValid()) {
codeStylePrefs->currentTabSettings().removeTrailingWhitespace(cursor, block);
block = block.next();
}
}
file->setContents(doc.toPlainText());
}
QStringList ProjectFileWizardExtension::getProjectChoices() const

View File

@@ -577,6 +577,8 @@ QVariantMap mergeSharedSettings(const QVariantMap &userMap, const QVariantMap &s
QVariantMap result = userMap;
if (sharedMap.isEmpty())
return result;
if (userMap.isEmpty())
return sharedMap;
QSet<QString> stickyKeys;
const QVariant stickyList = result.take(QLatin1String(USER_STICKY_KEYS_KEY)).toList();
@@ -897,19 +899,23 @@ SettingsAccessor::SettingsData SettingsAccessor::mergeSettings(const SettingsAcc
{
SettingsData newUser = user;
SettingsData newShared = shared;
SettingsData result;
if (shared.isValid() && user.isValid()) {
while (newUser.version() < newShared.version())
incrementVersion(newUser);
while (newShared.version() < newUser.version())
incrementVersion(newShared);
result = newUser;
result.m_map = mergeSharedSettings(newUser.m_map, newShared.m_map);
} else if (shared.isValid()) {
result = shared;
} else if (user.isValid()) {
result = user;
}
m_project->setProperty(SHARED_SETTINGS, newShared.m_map);
SettingsData result = newUser;
result.m_map = mergeSharedSettings(newUser.m_map, newShared.m_map);
if (!result.isValid())
return result;

View File

@@ -85,11 +85,9 @@ bool Exception::shouldAssert()
}
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
Constructs an exception. \a line uses the __LINE__ macro, \a function uses
the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
the __FILE__ macro.
*/
Exception::Exception(int line,
const QString &function,

View File

@@ -40,11 +40,9 @@ argument.
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
Constructs the exception for \a argument. \a line uses the __LINE__ macro,
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
the __FILE__ macro.
*/
InvalidArgumentException::InvalidArgumentException(int line,
const QString &function,

View File

@@ -39,11 +39,9 @@ info.
*/
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
Constructs an exception. \a line uses the __LINE__ macro,
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
the __FILE__ macro.
*/
InvalidMetaInfoException::InvalidMetaInfoException(int line,
const QString &function,

View File

@@ -39,11 +39,9 @@ model node.
*/
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
Constructs an exception. \a line uses the __LINE__ macro,
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
the __FILE__ macro.
*/
InvalidModelNodeException::InvalidModelNodeException(int line,
const QString &function,

View File

@@ -40,11 +40,9 @@ invalid model state.
*/
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
Constructs an exception. \a line uses the __LINE__ macro,
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
the __FILE__ macro.
*/
InvalidModelStateException::InvalidModelStateException(int line,
const QString &function,

View File

@@ -38,11 +38,9 @@ property.
*/
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
Constructs an exception. \a line uses the __LINE__ macro,
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
the __FILE__ macro.
*/
InvalidPropertyException::InvalidPropertyException(int line,
const QString &function,

View File

@@ -38,12 +38,9 @@ source code.
*/
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
\param qmlSource qml source string
Constructs an exception for \qmlSource. \a line uses the __LINE__ macro,
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
the __FILE__ macro.
*/
InvalidQmlSourceException::InvalidQmlSourceException(int line,
const QString &function,

View File

@@ -38,11 +38,9 @@
*/
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
Constructs an exception. \a line uses the __LINE__ macro,
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
the __FILE__ macro.
*/
InvalidReparentingException::InvalidReparentingException(int line,
const QString &function,

View File

@@ -39,11 +39,8 @@ index for a slide.
*/
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
Constructs an exception. \a line uses the __LINE__ macro,
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
*/
InvalidSlideIndexException::InvalidSlideIndexException(int line,
const QString &function,

View File

@@ -38,11 +38,9 @@ modification group.
*/
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
Constructs an exception. \a line uses the __LINE__ macro,
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
the __FILE__ macro.
*/
ModificationGroupException::ModificationGroupException(int line,
const QString &function,

View File

@@ -39,11 +39,9 @@
*/
namespace QmlDesigner {
/*!
\brief Constructor
\param line use the __LINE__ macro
\param function use the __FUNCTION__ or the Q_FUNC_INFO macro
\param file use the __FILE__ macro
Constructs an exception. \a line uses the __LINE__ macro,
\a function uses the __FUNCTION__ or the Q_FUNC_INFO macro, and \a file uses
the __FILE__ macro.
*/
RemoveBaseStateException::RemoveBaseStateException(int line,
const QString &function,

View File

@@ -91,12 +91,12 @@ For this purpose this view can be rendered offscreen.
namespace QmlDesigner {
/*! \brief Constructor
/*!
Constructs a node instance view object as a child of \a parent. If \a parent
is destructed, this instance is destructed, too.
The class will be rendered offscreen if not set otherwise.
\param Parent of this object. If this parent is d this instance is
d too.
\see ~NodeInstanceView setRenderOffScreen
*/

View File

@@ -245,7 +245,7 @@ ModelManager::ModelManager(QObject *parent):
connect(m_updateCppQmlTypesTimer, SIGNAL(timeout()), SLOT(startCppQmlTypeUpdate()));
m_asyncResetTimer = new QTimer(this);
m_asyncResetTimer->setInterval(1000);
m_asyncResetTimer->setInterval(15000);
m_asyncResetTimer->setSingleShot(true);
connect(m_asyncResetTimer, SIGNAL(timeout()), SLOT(resetCodeModel()));

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2013 Kläralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2013 Kläralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.

View File

@@ -14,6 +14,7 @@ QtcPlugin {
Depends { name: "Qt4ProjectManager" }
Depends { name: "RemoteLinux" }
Depends { name: "TextEditor" }
Depends { name: "QmlDebug" }
Depends { name: "Qt"; submodules: ["widgets", "xml", "network"] }
cpp.includePaths: base.concat("../../shared")

View File

@@ -95,7 +95,7 @@ void QmakeKitInformation::setup(ProjectExplorer::Kit *k)
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(k);
if (!tc || !tc->suggestedMkspecList().contains(spec)) {
if (!tc || (!tc->suggestedMkspecList().empty() && !tc->suggestedMkspecList().contains(spec))) {
QList<ProjectExplorer::ToolChain *> tcList = ProjectExplorer::ToolChainManager::instance()->toolChains();
ProjectExplorer::ToolChain *possibleTc = 0;
foreach (ProjectExplorer::ToolChain *current, tcList) {

View File

@@ -466,11 +466,7 @@ void BaseTextDocument::cleanWhitespace(QTextCursor &cursor, bool cleanIndentatio
if (inEntireDocument || block.revision() != documentLayout->lastSaveRevision) {
QString blockText = block.text();
if (int trailing = d->m_tabSettings.trailingWhitespaces(blockText)) {
cursor.setPosition(block.position() + block.length() - 1);
cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, trailing);
cursor.removeSelectedText();
}
d->m_tabSettings.removeTrailingWhitespace(cursor, block);
if (cleanIndentation && !d->m_tabSettings.isIndentationClean(block)) {
cursor.setPosition(block.position());
int firstNonSpace = d->m_tabSettings.firstNonSpace(blockText);

View File

@@ -152,6 +152,15 @@ int TabSettings::trailingWhitespaces(const QString &text) const
return i;
}
void TabSettings::removeTrailingWhitespace(QTextCursor cursor, QTextBlock &block) const
{
if (const int trailing = trailingWhitespaces(block.text())) {
cursor.setPosition(block.position() + block.length() - 1);
cursor.movePosition(QTextCursor::PreviousCharacter, QTextCursor::KeepAnchor, trailing);
cursor.removeSelectedText();
}
}
bool TabSettings::isIndentationClean(const QTextBlock &block) const
{
int i = 0;

View File

@@ -85,6 +85,7 @@ public:
void reindentLine(QTextBlock block, int delta) const;
int trailingWhitespaces(const QString &text) const;
void removeTrailingWhitespace(QTextCursor cursor, QTextBlock &block) const;
bool isIndentationClean(const QTextBlock &block) const;
bool guessSpacesForTabs(const QTextBlock &block) const;

View File

@@ -322,19 +322,21 @@ void TextEditorPlugin::updateVariable(const QByteArray &variable)
void TextEditorPlugin::updateCurrentSelection(const QString &text)
{
Core::IEditor *iface = Core::EditorManager::currentEditor();
ITextEditor *editor = qobject_cast<ITextEditor *>(iface);
if (editor) {
int pos = editor->position();
if (ITextEditor *editor = qobject_cast<ITextEditor *>(Core::EditorManager::currentEditor())) {
const int pos = editor->position();
int anchor = editor->position(ITextEditor::Anchor);
if (anchor < 0) // no selection
anchor = pos;
int selectionLength = anchor-pos;
if (selectionLength < 0)
int selectionLength = pos - anchor;
const bool selectionInTextDirection = selectionLength >= 0;
if (!selectionInTextDirection)
selectionLength = -selectionLength;
int start = qMin(pos, anchor);
const int start = qMin(pos, anchor);
editor->setCursorPosition(start);
editor->replace(selectionLength, text);
const int replacementEnd = editor->position();
editor->setCursorPosition(selectionInTextDirection ? start : replacementEnd);
editor->select(selectionInTextDirection ? replacementEnd : start);
}
}

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2013 Kläralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.

View File

@@ -1,6 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
** Copyright (C) 2013 Kläralvdalens Datakonsult AB, a KDAB Group company, info@kdab.com
** Contact: http://www.qt-project.org/legal
**
** This file is part of Qt Creator.

View File

@@ -34,6 +34,7 @@
#include <coreplugin/progressmanager/progressmanager.h>
#include <coreplugin/vcsmanager.h>
#include <utils/synchronousprocess.h>
#include <utils/runextensions.h>
#include <QDebug>
#include <QProcess>
@@ -184,7 +185,7 @@ void Command::execute()
return;
// For some reason QtConcurrent::run() only works on this
QFuture<void> task = QtConcurrent::run(this, &Command::run);
QFuture<void> task = QtConcurrent::run(&Command::run, this);
QString binary = QFileInfo(d->m_binaryPath).baseName();
if (!binary.isEmpty())
binary = binary.replace(0, 1, binary[0].toUpper()); // Upper the first letter
@@ -203,7 +204,7 @@ int Command::lastExecutionExitCode() const
return d->m_lastExecExitCode;
}
void Command::run()
void Command::run(QFutureInterface<void> &future)
{
// Check that the binary path is not empty
if (binaryPath().trimmed().isEmpty()) {
@@ -233,6 +234,7 @@ void Command::run()
break;
}
if (!future.isCanceled()) {
emit output(stdOut);
if (!stdErr.isEmpty())
emit errorText(stdErr);
@@ -240,6 +242,7 @@ void Command::run()
emit finished(d->m_lastExecSuccess, d->m_lastExecExitCode, cookie());
if (d->m_lastExecSuccess)
emit success(cookie());
}
// As it is used asynchronously, we need to delete ourselves
this->deleteLater();

View File

@@ -34,9 +34,13 @@
#include <QObject>
QT_FORWARD_DECLARE_CLASS(QStringList)
QT_FORWARD_DECLARE_CLASS(QVariant)
QT_FORWARD_DECLARE_CLASS(QProcessEnvironment)
QT_BEGIN_NAMESPACE
class QStringList;
class QVariant;
class QProcessEnvironment;
template <typename T>
class QFutureInterface;
QT_END_NAMESPACE
namespace VcsBase {
@@ -79,7 +83,7 @@ public:
void setCodec(QTextCodec *codec);
private:
void run();
void run(QFutureInterface<void> &future);
signals:
void output(const QString &);

View File

@@ -117,6 +117,7 @@ OutputWindowPlainTextEdit::OutputWindowPlainTextEdit(QWidget *parent) :
m_messageFormat(m_defaultFormat)
{
setReadOnly(true);
setUndoRedoEnabled(false);
setFrameStyle(QFrame::NoFrame);
m_errorFormat.setForeground(Qt::red);
m_warningFormat.setForeground(Qt::darkYellow);

View File

@@ -44,6 +44,9 @@
#include <qset.h>
#include <qstringlist.h>
#include <qtextstream.h>
#ifdef PROEVALUATOR_THREAD_SAFE
# include <qthreadpool.h>
#endif
#ifdef Q_OS_UNIX
#include <time.h>
@@ -1526,8 +1529,31 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
ProStringList newval;
bool changed = false;
for (bool hostBuild = false; ; hostBuild = true) {
if (QMakeBaseEnv *baseEnv = m_option->baseEnvs.value(
QMakeBaseKey(m_buildRoot, hostBuild))) {
#ifdef PROEVALUATOR_THREAD_SAFE
m_option->mutex.lock();
#endif
QMakeBaseEnv *baseEnv =
m_option->baseEnvs.value(QMakeBaseKey(m_buildRoot, hostBuild));
#ifdef PROEVALUATOR_THREAD_SAFE
// It's ok to unlock this before locking baseEnv,
// as we have no intention to initialize the env.
m_option->mutex.unlock();
#endif
do {
if (!baseEnv)
break;
#ifdef PROEVALUATOR_THREAD_SAFE
QMutexLocker locker(&baseEnv->mutex);
if (baseEnv->inProgress && baseEnv->evaluator != this) {
// The env is still in the works, but it may be already past the cache
// loading. So we need to wait for completion and amend it as usual.
QThreadPool::globalInstance()->releaseThread();
baseEnv->cond.wait(&baseEnv->mutex);
QThreadPool::globalInstance()->reserveThread();
}
if (!baseEnv->isOk)
break;
#endif
QMakeEvaluator *baseEval = baseEnv->evaluator;
const ProStringList &oldval = baseEval->values(dstvar);
if (mode == CacheSet) {
@@ -1558,7 +1584,7 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::evaluateBuiltinConditional(
}
changed = true;
}
}
} while (false);
if (hostBuild)
break;
}

View File

@@ -1302,7 +1302,6 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
QMakeBaseEnv *baseEnv = *baseEnvPtr;
#ifdef PROEVALUATOR_THREAD_SAFE
{
QMutexLocker locker(&baseEnv->mutex);
m_option->mutex.unlock();
if (baseEnv->inProgress) {
@@ -1340,7 +1339,8 @@ QMakeEvaluator::VisitReturn QMakeEvaluator::visitProFile(
return ReturnFalse;
}
#ifdef PROEVALUATOR_THREAD_SAFE
}
else if (!baseEnv->isOk)
return ReturnFalse;
#endif
initFrom(*baseEnv->evaluator);

View File

@@ -42,6 +42,8 @@ const char *description[] =
"g++_stringset",
"g++_stringvector",
"g++_wstringvector",
"g++_unordered_set",
"g++_unordered_map",
"libc++_stringvector",
"msvc_stdstring",
"msvc_stdwstring",
@@ -64,6 +66,10 @@ const char *input[] =
"std::set<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >",
"std::vector<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >",
"std::vector<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >, std::allocator<std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > > >",
"std::unordered_set<int, std::hash<int>, std::equal_to<int>, std::allocator<int> >",
"std::unordered_map<int, int, std::hash<int>, std::equal_to<int>, std::allocator<std::pair<int const, int> > >",
// libc++
"std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > >",
// MSVC
@@ -88,6 +94,8 @@ const char *output[] =
"std::set<std::string>",
"std::vector<std::string>",
"std::vector<std::wstring>",
"std::unordered_set<int>",
"std::unordered_map<int, int>",
// libc++
"std::vector<std::string>",
// MSVC

View File

@@ -97,15 +97,14 @@ static char *mkdtemp(char *templateName)
v /= 62;
XXXXXX[5] = letters[v % 62];
QString templateNameStr = QFile::decodeName(templateName);
QFileSystemEntry fileSystemEntry(templateNameStr);
if (QFileSystemEngine::createDirectory(fileSystemEntry, false)) {
QSystemError error;
QFileSystemEngine::setPermissions(fileSystemEntry,
QFile::ReadOwner |
QFileInfo fileInfo(templateNameStr);
if (fileInfo.absoluteDir().mkdir(fileInfo.fileName())) {
if (!QFile::setPermissions(fileInfo.absoluteFilePath(), QFile::ReadOwner |
QFile::WriteOwner |
QFile::ExeOwner, error);
if (error.error() != 0)
QFile::ExeOwner)) {
continue;
}
return templateName;
}
}
@@ -134,7 +133,7 @@ static bool removeRecursively(QDir directory)
| QDir::System | QDir::NoDotAndDotDot);
foreach (QFileInfo fdInfo, filesAndDirs) {
if (fdInfo.isDir())
success &= removeRecursively(fdInfo.dir());
success &= removeRecursively(QDir(fdInfo.absoluteFilePath()));
else
success &= directory.remove(fdInfo.fileName());
}

View File

@@ -414,7 +414,8 @@ struct DataBase
{
DataBase()
: useQt(false), useQHash(false),
forceC(false), gdbOnly(false), lldbOnly(false)
forceC(false), gdbOnly(false), lldbOnly(false),
glibcxxDebug(false)
{}
mutable bool useQt;
@@ -422,6 +423,7 @@ struct DataBase
mutable bool forceC;
mutable bool gdbOnly;
mutable bool lldbOnly;
mutable bool glibcxxDebug;
mutable GdbVersion neededGdbVersion;
mutable LldbVersion neededLldbVersion;
};
@@ -551,11 +553,13 @@ public:
{
t = 0;
m_keepTemp = true;
m_forceKeepTemp = false;
m_gdbVersion = 0;
m_gdbBuildVersion = 0;
m_lldbVersion = 0;
m_isMacGdb = false;
m_isQnxGdb = false;
m_useGLibCxxDebug = false;
}
private slots:
@@ -566,6 +570,7 @@ private slots:
void cleanup();
private:
bool keepTemp() const { return m_keepTemp || m_forceKeepTemp; }
TempStuff *t;
QByteArray m_debuggerBinary;
QByteArray m_qmakeBinary;
@@ -573,11 +578,13 @@ private:
bool m_usePython;
DebuggerEngine m_debuggerEngine;
bool m_keepTemp;
bool m_forceKeepTemp;
int m_gdbVersion; // 7.5.1 -> 70501
int m_gdbBuildVersion;
int m_lldbVersion;
bool m_isMacGdb;
bool m_isQnxGdb;
bool m_useGLibCxxDebug;
};
void tst_Dumpers::initTestCase()
@@ -599,6 +606,12 @@ void tst_Dumpers::initTestCase()
m_qmakeBinary = "qmake";
qDebug() << "QMake : " << m_qmakeBinary.constData();
m_useGLibCxxDebug = qgetenv("QTC_USE_GLIBCXXDEBUG_FOR_TEST").toInt();
qDebug() << "Use _GLIBCXX_DEBUG : " << m_useGLibCxxDebug;
m_forceKeepTemp = qgetenv("QTC_KEEP_TEMP_FOR_TEST").toInt();
qDebug() << "Force keep temp : " << m_forceKeepTemp;
Environment utilsEnv = Environment::systemEnvironment();
if (m_debuggerEngine == DumpTestGdbEngine) {
@@ -654,7 +667,7 @@ void tst_Dumpers::initTestCase()
if (pos >= 0)
ba = ba.left(pos);
m_lldbVersion = ba.toInt();
qDebug() << "Lldb version " << output << ba << m_lldbVersion;
qDebug() << "Lldb version :" << output << ba << m_lldbVersion;
QVERIFY(m_lldbVersion);
}
m_env = utilsEnv.toProcessEnvironment();
@@ -721,6 +734,8 @@ void tst_Dumpers::dumper()
proFile.write("QT -= widgets gui\n");
else
proFile.write("CONFIG -= QT\n");
if (m_useGLibCxxDebug)
proFile.write("DEFINES += _GLIBCXX_DEBUG\n");
proFile.write(data.profileExtra);
proFile.close();
@@ -884,7 +899,7 @@ void tst_Dumpers::dumper()
error = debugger.readAllStandardError();
if (!error.isEmpty()) { qDebug() << error; }
if (m_keepTemp) {
if (keepTemp()) {
QFile logger(t->buildPath + QLatin1String("/output.txt"));
logger.open(QIODevice::ReadWrite);
logger.write("=== STDOUT ===\n");
@@ -1003,14 +1018,16 @@ void tst_Dumpers::dumper()
qDebug() << "EXPANDED : " << expanded;
ok = false;
}
if (!ok) {
if (ok) {
m_keepTemp = false;
} else {
qDebug() << "CONTENTS : " << contents;
qDebug() << "Qt VERSION : "
<< qPrintable(QString::number(context.qtVersion, 16));
qDebug() << "BUILD DIR : " << qPrintable(t->buildPath);
}
QVERIFY(ok);
t->buildTemp.setAutoRemove(m_keepTemp);
t->buildTemp.setAutoRemove(!keepTemp());
}
void tst_Dumpers::dumper_data()
@@ -2975,6 +2992,44 @@ void tst_Dumpers::dumper_data()
% Check("is", "", "std::ifstream")
% Check("ok", "true", "bool");
QTest::newRow("StdUnorderedMap1")
<< Data("#include <unordered_map>\n",
"std::unordered_map<unsigned int, unsigned int> map;\n"
"map[11] = 1;\n"
"map[22] = 2;\n")
% Check("map", "<2 items>", "std::unordered_map<unsigned int, unsigned int>")
% Cxx11Profile()
% Check("map.0", "[0] 22", "2", "unsigned int")
% Check("map.1", "[1] 11", "1", "unsigned int");
QTest::newRow("StdUnorderedMap2")
<< Data("#include <unordered_map>\n"
"#include <string>\n",
"std::unordered_map<std::string, float> map;\n"
"map[\"11.0\"] = 11.0;\n"
"map[\"22.0\"] = 22.0;\n")
% Cxx11Profile()
% Check("map", "<2 items>", "std::unordered_map<std::string, float>")
//% Check("map.0", "[0]", "", "std::pair<std:string const, float>")
% Check("map.0.first", "\"22.0\"", "std::string")
% Check("map.0.second", "22", "float")
//% Check("map.1", "[1]", "", "std::pair<std::string const, float>")
% Check("map.1.first", "\"11.0\"", "std::string")
% Check("map.1.second", "11", "float");
QTest::newRow("StdUnorderedSet1")
<< Data("#include <unordered_set>\n",
"std::unordered_set<int> set;\n"
"set.insert(11);\n"
"set.insert(22);\n"
"set.insert(33);\n")
% Cxx11Profile()
% Check("set", "<3 items>", "std::unordered_set<int>")
% Check("set.0", "[0]", "33", "int")
% Check("set.1", "[1]", "22", "int")
% Check("set.2", "[2]", "11", "int");
QTest::newRow("ItemModel")
<< Data("#include <QStandardItemModel>\n",
"QStandardItemModel m;\n"

View File

@@ -38,6 +38,11 @@
:CMake Wizard.Next_QPushButton {name='__qt__passive_wizardbutton1' text~='(Next.*|Continue)' type='QPushButton' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard.Run CMake_QPushButton {text='Run CMake' type='QPushButton' unnamed='1' visible='1' window=':CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard'}
:CMake Wizard_CMakeProjectManager::Internal::CMakeOpenProjectWizard {type='CMakeProjectManager::Internal::CMakeOpenProjectWizard' unnamed='1' visible='1' windowTitle='CMake Wizard'}
:CodePaster__Internal__PasteSelectDialog.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}
:CodePaster__Internal__PasteSelectDialog.OK_QPushButton {text='OK' type='QPushButton' unnamed='1' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}
:CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget {name='listWidget' type='QListWidget' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}
:CodePaster__Internal__PasteSelectDialog.protocolBox_QComboBox {name='protocolBox' type='QComboBox' visible='1' window=':CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog'}
:CodePaster__Internal__PasteSelectDialog_CodePaster::PasteSelectDialog {name='CodePaster__Internal__PasteSelectDialog' type='CodePaster::PasteSelectDialog' visible='1'}
:CompilerPath.Utils_BaseValidatingLineEdit {container=':qt_tabwidget_stackedwidget_QWidget' name='LineEdit' type='Utils::BaseValidatingLineEdit' visible='1'}
:Core__Internal__GeneralSettings.User Interface_QGroupBox {container=':qt_tabwidget_stackedwidget.Core__Internal__GeneralSettings_QWidget' name='interfaceBox' title='User Interface' type='QGroupBox' visible='1'}
:CppTools__Internal__CompletionSettingsPage.Behavior_QGroupBox {container=':qt_tabwidget_stackedwidget.CppTools__Internal__CompletionSettingsPage_QWidget' name='groupBox' title='Behavior' type='QGroupBox' visible='1'}
@@ -125,6 +130,7 @@
:Qt Creator_Core::Internal::MainWindow {type='Core::Internal::MainWindow' visible='1' windowTitle?='*Qt Creator'}
:Qt Creator_Core::Internal::NavComboBox {type='Core::Internal::NavComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::Internal::ProgressBar {type='Core::Internal::ProgressBar' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Core::OutputWindow {type='Core::OutputWindow' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_CppEditor::Internal::CPPEditorWidget {type='CppEditor::Internal::CPPEditorWidget' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_FilenameQComboBox {type='QComboBox' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:Qt Creator_Find::Internal::SearchResultTreeView {type='Find::Internal::SearchResultTreeView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
@@ -157,6 +163,11 @@
:RunSettingsEnvironmentDetails_Utils::DetailsButton {leftWidget=':RunSettingsUseBuildEnvironment_QLabel' text='Details' type='Utils::DetailsButton' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:RunSettingsUseBuildEnvironment_QLabel {text~='Us(e|ing) <b>Build Environment</b>' type='QLabel' unnamed='1' visible='1'}
:Select signal.signalList_QTreeWidget {container=':Go to slot.Select signal_QGroupBox' name='signalList' type='QTreeWidget' visible='1'}
:Send to Codepaster.Cancel_QPushButton {text='Cancel' type='QPushButton' unnamed='1' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}
:Send to Codepaster.Paste_QPushButton {text='Paste' type='QPushButton' unnamed='1' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}
:Send to Codepaster.protocolBox_QComboBox {name='protocolBox' type='QComboBox' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}
:Send to Codepaster.stackedWidget_QStackedWidget {name='stackedWidget' type='QStackedWidget' visible='1' window=':Send to Codepaster_CodePaster::PasteView'}
:Send to Codepaster_CodePaster::PasteView {name='CodePaster__Internal__ViewDialog' type='CodePaster::PasteView' visible='1' windowTitle='Send to Codepaster'}
:Session Manager_ProjectExplorer::Internal::SessionDialog {name='ProjectExplorer__Internal__SessionDialog' type='ProjectExplorer::Internal::SessionDialog' visible='1' windowTitle='Session Manager'}
:Startup.contextHelpComboBox_QComboBox {container=':Form.Startup_QGroupBox' name='contextHelpComboBox' type='QComboBox' visible='1'}
:User Interface.languageBox_QComboBox {container=':Core__Internal__GeneralSettings.User Interface_QGroupBox' name='languageBox' type='QComboBox' visible='1'}
@@ -184,3 +195,4 @@
:scrollArea.qmlDebuggingLibraryCheckBox_QCheckBox {name='qmlDebuggingLibraryCheckBox' type='QCheckBox' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:scrollArea_QTableView {type='QTableView' unnamed='1' visible='1' window=':Qt Creator_Core::Internal::MainWindow'}
:sourceFileLineEdit_Utils::FileNameValidatingLineEdit {buddy=':Qt Gui Application.Source file:_QLabel' name='sourceFileLineEdit' type='Utils::FileNameValidatingLineEdit' visible='1'}
:stackedWidget.plainTextEdit_QPlainTextEdit {container=':Send to Codepaster.stackedWidget_QStackedWidget' name='plainTextEdit' type='QPlainTextEdit' visible='1'}

View File

@@ -176,9 +176,8 @@ def __startDebugger__(kitCount, currentKit, config):
isMsvcBuild = isMsvcConfig(kitCount, currentKit)
clickButton(waitForObject(":*Qt Creator.Start Debugging_Core::Internal::FancyToolButton"))
handleDebuggerWarnings(config, isMsvcBuild)
hasNotTimedOut = waitFor("object.exists(':Debugger Toolbar.Continue_QToolButton')", 60000)
try:
mBox = findObject(":Failed to start application_QMessageBox")
mBox = waitForObject(":Failed to start application_QMessageBox", 5000)
mBoxText = mBox.text
mBoxIText = mBox.informativeText
clickButton(":DebugModeWidget.OK_QPushButton")
@@ -188,10 +187,8 @@ def __startDebugger__(kitCount, currentKit, config):
return False
except:
pass
if hasNotTimedOut:
test.passes("Debugger started...")
else:
test.fail("Debugger seems to have not started...")
if not test.verify(waitFor("object.exists(':Debugger Toolbar.Continue_QToolButton')", 60000),
"Verify start of debugger"):
if "MSVC" in config:
debuggerLog = takeDebuggerLog()
if "lib\qtcreatorcdbext64\qtcreatorcdbext.dll cannot be found." in debuggerLog:

View File

@@ -225,7 +225,7 @@ def cleanUpUserFiles(pathsToProFiles=None):
doneWithoutErrors = False
return doneWithoutErrors
def invokeMenuItem(menu, item, subItem = None):
def invokeMenuItem(menu, item, *subItems):
if platform.system() == "Darwin":
try:
waitForObject(":Qt Creator.QtCreator.MenuBar_QMenuBar", 2000)
@@ -237,10 +237,11 @@ def invokeMenuItem(menu, item, subItem = None):
itemObject = waitForObjectItem(objectMap.realName(menuObject), item)
waitFor("itemObject.enabled", 2000)
activateItem(itemObject)
if subItem != None:
for subItem in subItems:
sub = itemObject.menu()
waitFor("sub.visible", 1000)
activateItem(waitForObjectItem(sub, subItem))
itemObject = waitForObjectItem(sub, subItem)
activateItem(itemObject)
def logApplicationOutput():
# make sure application output is shown

View File

@@ -54,6 +54,16 @@ def getQtCreatorVersionFromFile():
test.fail("Failed to get the exact version from File")
return ""
def checkQtCreatorHelpVersion(expectedVersion):
switchViewTo(ViewConstants.HELP)
try:
creatorManual = waitForObject("{column='0' container=':Qt Creator_QHelpContentWidget' "
"text?='Qt Creator Manual*' type='QModelIndex'}", 5000)
test.compare(str(creatorManual.text)[18:], expectedVersion,
"Verifying whether manual uses expected version.")
except LookupError:
test.fail("Missing Qt Creator Manual.")
def main():
expectedVersion = getQtCreatorVersionFromFile()
if not expectedVersion:
@@ -77,6 +87,7 @@ def main():
"window=':About Qt Creator_Core::Internal::VersionDialog'}"))
test.verify(checkIfObjectExists(":About Qt Creator_Core::Internal::VersionDialog", False),
"Verifying if About dialog closed.")
checkQtCreatorHelpVersion(expectedVersion)
# exit qt creator
invokeMenuItem("File", "Exit")
# verify if qt creator closed properly

View File

@@ -7,6 +7,6 @@ HOOK_SUB_PROCESSES=false
IMPLICITAUTSTART=0
LANGUAGE=Python
OBJECTMAP=../objects.map
TEST_CASES=tst_designer_autocomplete tst_designer_goto_slot
TEST_CASES=tst_codepasting tst_designer_autocomplete tst_designer_goto_slot tst_external_sort
VERSION=2
WRAPPERS=Qt

View File

@@ -0,0 +1,101 @@
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Digia. For licensing terms and
## conditions see http://qt.digia.com/licensing. For further information
## use the contact form at http://qt.digia.com/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. 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.
##
## In addition, as a special exception, Digia gives you certain additional
## rights. These rights are described in the Digia Qt LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
#############################################################################
source("../../shared/qtcreator.py")
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
protocolsToTest = ["Paste.KDE.Org"]
# Be careful with Pastebin.Com, there are only 10 pastes per 24h
# for all machines using the same IP-address like you.
# protocolsToTest += ["Pastebin.Com"]
sourceFile = os.path.join(os.getcwd(), "testdata", "main.cpp")
for protocol in protocolsToTest:
invokeMenuItem("File", "Open File or Project...")
selectFromFileDialog(sourceFile)
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
type(editor, "<Up>")
typeLines(editor, "// tst_codepasting %s" % datetime.utcnow())
sourceText = editor.plainText
invokeMenuItem("Tools", "Code Pasting", "Paste Snippet...")
selectFromCombo(":Send to Codepaster.protocolBox_QComboBox", protocol)
pasteEditor = waitForObject(":stackedWidget.plainTextEdit_QPlainTextEdit")
test.compare(pasteEditor.plainText, sourceText, "Verify that dialog shows text from the editor")
typeLines(pasteEditor, "// tst_codepasting %s" % datetime.utcnow())
pastedText = pasteEditor.plainText
clickButton(waitForObject(":Send to Codepaster.Paste_QPushButton"))
outputWindow = waitForObject(":Qt Creator_Core::OutputWindow")
waitFor("not outputWindow.plainText.isEmpty()", 20000)
pasteId = str(outputWindow.plainText).rsplit("/", 1)[1]
clickButton(waitForObject(":*Qt Creator.Clear_QToolButton"))
invokeMenuItem('File', 'Revert "main.cpp" to Saved')
clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton"))
invokeMenuItem("File", "Close All")
if not pasteId:
test.fatal("Could not get id of paste to %s" % protocol)
continue
invokeMenuItem("Tools", "Code Pasting", "Fetch Snippet...")
selectFromCombo(":CodePaster__Internal__PasteSelectDialog.protocolBox_QComboBox", protocol)
pasteModel = waitForObject(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget").model()
waitFor("pasteModel.rowCount() > 1", 20000)
try:
pasteLine = filter(lambda str: pasteId in str, dumpItems(pasteModel))[0]
except:
test.fail("Could not find id '%s' in list of pastes from %s" % (pasteId, protocol))
clickButton(waitForObject(":CodePaster__Internal__PasteSelectDialog.Cancel_QPushButton"))
continue
waitForObjectItem(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget", pasteLine)
clickItem(":CodePaster__Internal__PasteSelectDialog.listWidget_QListWidget", pasteLine, 5, 5, 0, Qt.LeftButton)
clickButton(waitForObject(":CodePaster__Internal__PasteSelectDialog.OK_QPushButton"))
filenameCombo = waitForObject(":Qt Creator_FilenameQComboBox")
waitFor("not filenameCombo.currentText.isEmpty()", 20000)
if protocol == "Pastebin.Com" and JIRA.isBugStillOpen(9997, JIRA.Bug.CREATOR):
protocol = "Pastebin.com"
test.compare(filenameCombo.currentText, "%s: %s" % (protocol, pasteId), "Verify title of editor")
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
if protocol == "Paste.KDE.Org" and JIRA.isBugStillOpen(9995, JIRA.Bug.CREATOR):
test.xcompare(editor.plainText, pastedText, "Verify that pasted and fetched texts are the same")
else:
test.compare(editor.plainText, pastedText, "Verify that pasted and fetched texts are the same")
invokeMenuItem("File", "Close All")
invokeMenuItem("File", "Open File or Project...")
selectFromFileDialog(sourceFile)
editor = waitForObject(":Qt Creator_CppEditor::Internal::CPPEditorWidget")
markText(editor, "Down", 7)
# QString QTextCursor::selectedText () const:
# "Note: If the selection obtained from an editor spans a line break, the text will contain a
# Unicode U+2029 paragraph separator character instead of a newline \n character."
selectedText = str(editor.textCursor().selectedText()).replace(unichr(0x2029), "\n")
invokeMenuItem("Tools", "Code Pasting", "Paste Snippet...")
test.compare(waitForObject(":stackedWidget.plainTextEdit_QPlainTextEdit").plainText,
selectedText, "Verify that dialog shows selected text from the editor")
clickButton(waitForObject(":Send to Codepaster.Cancel_QPushButton"))
invokeMenuItem("File", "Exit")

View File

@@ -0,0 +1,11 @@
#include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}

View File

@@ -0,0 +1,48 @@
#############################################################################
##
## Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
## Contact: http://www.qt-project.org/legal
##
## This file is part of Qt Creator.
##
## Commercial License Usage
## Licensees holding valid commercial Qt licenses may use this file in
## accordance with the commercial license agreement provided with the
## Software or, alternatively, in accordance with the terms contained in
## a written agreement between you and Digia. For licensing terms and
## conditions see http://qt.digia.com/licensing. For further information
## use the contact form at http://qt.digia.com/contact-us.
##
## GNU Lesser General Public License Usage
## Alternatively, this file may be used under the terms of the GNU Lesser
## General Public License version 2.1 as published by the Free Software
## Foundation and appearing in the file LICENSE.LGPL included in the
## packaging of this file. 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.
##
## In addition, as a special exception, Digia gives you certain additional
## rights. These rights are described in the Digia Qt LGPL Exception
## version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
##
#############################################################################
source("../../shared/qtcreator.py")
def main():
startApplication("qtcreator" + SettingsPath)
if not startedWithoutPluginError():
return
invokeMenuItem("File", "Open File or Project...")
unsortedFile = os.path.join(os.getcwd(), "testdata", "unsorted.txt")
sorted = getOutputFromCmdline("sort %s" % unsortedFile).replace("\r", "")
selectFromFileDialog(unsortedFile)
invokeMenuItem("Edit", "Select All")
invokeMenuItem("Tools", "External", "Text", "Sort Selection")
editor = waitForObject("{type='TextEditor::PlainTextEditorWidget' unnamed='1' "
"visible='1' window=':Qt Creator_Core::Internal::MainWindow'}", 3000)
test.verify(waitFor("str(editor.plainText) == sorted", 2000),
"Verify that sorted text\n%s\nmatches the expected text\n%s" % (editor.plainText, sorted))
invokeMenuItem('File', 'Revert "unsorted.txt" to Saved')
clickButton(waitForObject(":Revert to Saved.Proceed_QPushButton"))
invokeMenuItem("File", "Exit")

View File

@@ -0,0 +1,25 @@
bbb
aaa2
AAA
c >> dir
aa a
b > nul
aaa1
a | ls
aaa
1A
aa
aba
ab
a
1a
aa
12.345
12,345
1a
*
?
-
_
!