Merge branch '2.7'
Conflicts: doc/src/qtquick/qtquick-components.qdoc doc/src/qtquick/qtquick-designer.qdoc qtcreator.pri qtcreator.qbs src/plugins/cppeditor/cppinsertdecldef.cpp src/plugins/qnx/qnxruncontrolfactory.cpp Change-Id: I0a37a07c42719bc0d9ef5b3ac4641d01a63c0d88
|
Before Width: | Height: | Size: 106 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 45 KiB After Width: | Height: | Size: 30 KiB |
|
After Width: | Height: | Size: 43 KiB |
@@ -70,16 +70,17 @@
|
||||
several options, such as the
|
||||
\l{http://developer.android.com/sdk/index.html}{Android SDK} and
|
||||
\l{http://developer.android.com/tools/sdk/ndk/index.html}
|
||||
{Android NDK} from Google or the
|
||||
{Android NDK} from Google (supported for development with Qt 5) or the
|
||||
\l{http://necessitas.kde.org/necessitas/necessitas_sdk_installer.php}
|
||||
{Necessitas SDK}.
|
||||
{Necessitas SDK} (supported for development with Qt 4).
|
||||
|
||||
\endlist
|
||||
|
||||
\section1 Configuring Connections
|
||||
\section1 Developing with Qt 4
|
||||
|
||||
The Qt for Android SDK automatically sets the paths to the required software
|
||||
in \QC.
|
||||
The Necessitas SDK automatically sets the paths to the required software
|
||||
in \QC, but you need to add the Qt version. \QC can then create the
|
||||
necessary kits for you.
|
||||
|
||||
To configure connections between \QC and Android devices:
|
||||
|
||||
@@ -89,8 +90,8 @@
|
||||
\gui {Qt Versions} > \gui Add to add the path to \c qmake path in
|
||||
the Qt for Android SDK.
|
||||
|
||||
\li Select \gui Tools > \gui Options > \gui Android to view and edit
|
||||
paths to the required software.
|
||||
\li Select \gui Tools > \gui Options > \gui Android to check the paths
|
||||
to the required software.
|
||||
|
||||
\image qtcreator-options-android.png "Android options"
|
||||
|
||||
@@ -98,9 +99,12 @@
|
||||
check box to allow \QC to create the kits for you. \QC displays a
|
||||
warning if it cannot find a suitable Qt version.
|
||||
|
||||
\li Select \gui {Start Android AVD Manager} to create Android virtual
|
||||
devices (AVD) that enable you to emulate device hardware and software
|
||||
on the Android Emulator.
|
||||
\li To create an application, select \gui File >
|
||||
\gui {New File or Project} > \gui Applications >
|
||||
\gui {Qt Quick Application 1 (Built-in Elements)} or
|
||||
\gui {Qt Quick Application 2 (Built-in Elements)} > \gui Choose, and
|
||||
follow the instructions of the wizard. For more information, see
|
||||
\l{Creating Qt Quick Projects}.
|
||||
|
||||
\li To specify information for the Android manifest file, select
|
||||
\gui Projects > \gui Run for the \gui Android kit.
|
||||
@@ -108,7 +112,7 @@
|
||||
\li Select \gui Details to view the
|
||||
\gui {Package configurations}. For more information about the
|
||||
options you have, see
|
||||
\l{Specifying Run Settings for Android Devices}.
|
||||
\l{Specifying Settings for Application Packages}.
|
||||
|
||||
\li To specify settings for deploying applications to Android, select
|
||||
\gui Details to view the \gui {Deploy configurations}. For more
|
||||
@@ -117,6 +121,69 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\section1 Developing with Qt 5
|
||||
|
||||
You must download and install the latest Android NDK and SDK, and update the
|
||||
SDK to get the API and tools packages needed for development. In addition,
|
||||
you must install Qt for Android from the Qt 5.1 packages.
|
||||
|
||||
For more information, see
|
||||
\l{http://qt-project.org/doc/qt-5.0/qtdoc/android-support.html}{Android}.
|
||||
|
||||
To configure connections between \QC and Android devices:
|
||||
|
||||
\list 1
|
||||
|
||||
\li Select \gui Tools > \gui Options > \gui Android to add paths to the
|
||||
Android NDK and SDK.
|
||||
|
||||
\image qtcreator-options-android1.png "Android options"
|
||||
|
||||
\li Select the \gui {Automatically create kits for Android tool chains}
|
||||
check box to allow \QC to create the kits for you. \QC displays a
|
||||
warning if it cannot find a suitable Qt version.
|
||||
|
||||
\li Select \gui File > \gui {New File or Project} > \gui Applications >
|
||||
\gui {Qt Quick Application 2 (Built-in Elements)} > \gui Choose, and
|
||||
follow the instructions of the wizard. For more information, see
|
||||
\l{Creating Qt Quick Projects}.
|
||||
|
||||
\li To specify information for the Android manifest file, select
|
||||
\gui Projects > \gui Run for the \gui Android kit.
|
||||
|
||||
\li Select \gui Details to view the
|
||||
\gui {Package configurations}. For more information about the
|
||||
options you have, see
|
||||
\l{Specifying Settings for Application Packages}.
|
||||
|
||||
\li To specify settings for deploying applications to Android, select
|
||||
\gui Details to view the \gui {Deploy configurations}. For more
|
||||
information about the options you have, see
|
||||
\l{Deploying Applications to Android Devices}.
|
||||
|
||||
\li Enable debugging on your Android device and connect it to the PC.
|
||||
|
||||
Debugging is enabled in different ways on different Android devices.
|
||||
Look for \gui {USB Debugging} under \gui {Developer Options}. On
|
||||
some devices \gui {Developer Options} is hidden and becomes visible
|
||||
when you tap the \gui {Build number} field in \gui Settings >
|
||||
\gui About several times.
|
||||
|
||||
\endlist
|
||||
|
||||
\section1 Using the Android Emulator
|
||||
|
||||
To run your application on the Android Emulator, you must create Android
|
||||
virtual devices (AVD). Select \gui Tools > \gui Options > \gui Android >
|
||||
\gui Add. If you run an application without a device connected to the
|
||||
development PC and without an AVD specified, \QC asks you to add an AVD.
|
||||
|
||||
To manage AVDs, select \gui {Start Android AVD Manager}.
|
||||
|
||||
\note The Android Emulator has a bug that prevents it from starting on some
|
||||
systems. If the Android Emulator does not start, you can try starting it
|
||||
manually by running the \c {emulator-arm} command from the command line.
|
||||
|
||||
\section1 Debugging on Android Devices
|
||||
|
||||
\QC is integrated with the GDB and GDB server that are delivered with the
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
\section2 Specifying Run Settings for Android Devices
|
||||
To specify information for the Android manifest file, select \gui Projects >
|
||||
\gui Run > \gui {Package configurations}. The Android system uses the
|
||||
information from the file to start application components.
|
||||
|
||||
In \gui {Package configurations}, you can specify information for the
|
||||
Android manifest file. The Android system uses the information from the file
|
||||
to start application components.
|
||||
|
||||
\section3 Specifying Package Data
|
||||
\section2 Specifying Package Data
|
||||
|
||||
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
|
||||
@@ -30,14 +28,14 @@
|
||||
\l{http://developer.android.com/guide/components/fundamentals.html}
|
||||
{Android Application Fundamentals}.
|
||||
|
||||
\section3 Specifying Application Data
|
||||
\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"
|
||||
|
||||
\section3 Setting Permissions
|
||||
\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
|
||||
@@ -49,7 +47,7 @@
|
||||
Select from existing Android permissions or add new ones to deploy the
|
||||
application to a particular Android OS.
|
||||
|
||||
\section3 Selecting Qt Libraries
|
||||
\section2 Selecting Qt Libraries
|
||||
|
||||
In the \gui Libraries tab, specify which Qt libraries the application uses.
|
||||
To automatically determine this, select \gui {Read Infomation from
|
||||
@@ -66,7 +64,7 @@
|
||||
In addition, the Java Loader uses this list to determine which Qt Libraries
|
||||
and other prebundled libraries to load with your application.
|
||||
|
||||
\section3 Signing Android Packages
|
||||
\section2 Signing Android Packages
|
||||
|
||||
In the \gui {Sign Package} tab, you can sign the Android package by using
|
||||
a private key from the keystore. To create new keys, select \gui Create.
|
||||
|
||||
@@ -25,31 +25,132 @@
|
||||
|
||||
\title Deploying Applications to Android Devices
|
||||
|
||||
When you select a \gui {Qt for Android Kit} for a project, \QC creates and
|
||||
maintains a set of files that are required to make your application run on
|
||||
Android devices.
|
||||
|
||||
\QC adds the following files to your project:
|
||||
|
||||
\list
|
||||
|
||||
\li Java files, which serve as the entry point into your application and
|
||||
that automatically load Qt and execute the native code in your
|
||||
application.
|
||||
|
||||
\li AndroidManifest.xml, which provides meta-information about your
|
||||
application.
|
||||
|
||||
\li Other XML files, which specify the dependencies of your application.
|
||||
|
||||
\li Resource files.
|
||||
|
||||
\li Libraries and QML files, which can be included in the project
|
||||
depending on the deployment method that you select.
|
||||
|
||||
\endlist
|
||||
|
||||
\QC adds the files to the project to a subdirectory called \c android. The
|
||||
contents of the \c android folder are used to create a distributable
|
||||
application package.
|
||||
|
||||
\QC supports the following methods of deployment for Android applications:
|
||||
|
||||
\list
|
||||
|
||||
\li As a stand-alone, distributable application package (APK).
|
||||
|
||||
\li As a minimal APK that contains a dependency to the Ministro tool.
|
||||
The Ministro tool downloads the necessary Qt libraries from a
|
||||
repository of your choice.
|
||||
|
||||
\li As an incomplete APK that is suitable for testing and debugging
|
||||
applications on a device connected to the development host. The APK
|
||||
relies on the device containing the Qt libraries in the correct
|
||||
location. \QC copies the libraries to that location the first time
|
||||
you deploy the application.
|
||||
|
||||
\endlist
|
||||
|
||||
The default option depends on whether you are developing with Qt 4 or Qt 5.
|
||||
The Necessitas SDK does not support bundling Qt libraries with applications,
|
||||
so you must use Ministro when developing with Qt 4.
|
||||
|
||||
\section1 Specifying Settings for Application Packages
|
||||
|
||||
On Android, applications are distributed in packages called APK. \QC creates
|
||||
the APK for you. If you want to do this manually, you must first make sure
|
||||
that the appropriate packaging and build files are in place. \QC places the
|
||||
files in the \c android subfolder of the project.
|
||||
|
||||
\include android/creator-projects-settings-run-android.qdocinc
|
||||
|
||||
\section1 Deploying Application Packages
|
||||
|
||||
To specify settings for deploying applications to Android devices, select
|
||||
\gui Projects > \gui Run.
|
||||
\gui Projects > \gui Run > \gui {Deploy configurations} > \gui Details.
|
||||
|
||||
\image qtcreator-deploy-android.png "Deploy configurations"
|
||||
|
||||
Select the \gui {Use Qt libraries from device} option to use Qt libraries installed
|
||||
on the device. If you also select the \gui {Use local Qt libraries} check box, \QC passes
|
||||
special parameters to the application, forcing it to use Qt libraries from the
|
||||
\c{/data/local/tmp/qt} folder on the device. If you do not select it, the application needs
|
||||
the Ministro package to run.
|
||||
To copy Qt libraries and files to the project directory and to bundle them
|
||||
as part of the APK, select the \gui {Use Qt libraries from device} option
|
||||
and the \gui {Use local Qt libraries} check box. This is the default option
|
||||
when developing with Qt 5.
|
||||
|
||||
Select the \gui {Deploy local Qt libraries} option to deploy Qt libraries from
|
||||
the specified Qt for Android SDK (for example, android-lighthouse-4.8.0).
|
||||
This option enables you to develop on the Qt framework to test it. This
|
||||
option automatically selects the \gui {Use local Qt libraries} check box, but you
|
||||
can use it also independently.
|
||||
\section1 Using Ministro to Install Qt Libraries
|
||||
|
||||
To minimize the size of your APK, you can package the application with an
|
||||
external dependency called Ministro. If a user downloads your application,
|
||||
and it is the first application on their device to depend on Ministro, they
|
||||
are asked to install Ministro before they can run your application.
|
||||
|
||||
Ministro serves as a central repository for Qt libraries. This enables
|
||||
several applications to share the libraries, which only need to be installed
|
||||
once. To use this deployment method, you must set up a repository for the
|
||||
libraries that you want to distribute. To specify the
|
||||
repository URL, edit the file \c {android/res/values/libs.xml}, which is
|
||||
created by \QC.
|
||||
|
||||
To use Ministro to install the Qt libraries, select the
|
||||
\gui {Use Qt libraries from device} option (without any other options).
|
||||
|
||||
This is the default option when developing with Qt 4.
|
||||
|
||||
\section1 Deploying Qt Libraries for Debugging
|
||||
|
||||
To test your application on a device that is physically connected to the
|
||||
development host (or on an emulator), you can copy the Qt libraries into a
|
||||
temporary directory on your device and run the application against them.
|
||||
|
||||
An APK built in this way is not distributable, since it relies on the device
|
||||
containing the Qt libraries in the correct location. However, as the Qt
|
||||
libraries are only copied into the device once, this method provides a fast
|
||||
turn-around time, and is therefore convenient for testing the application
|
||||
during development.
|
||||
|
||||
Select \gui Projects > \gui Run > \gui {Deploy configurations} >
|
||||
\gui Details, and then select the \gui {Deploy local Qt libraries} option
|
||||
and the \gui {Use local Qt libraries} check box to deploy Qt libraries to
|
||||
the \c{/data/local/tmp/qt} folder on the device and to run the application
|
||||
against them.
|
||||
|
||||
\section1 Installing Ministro
|
||||
|
||||
To install Ministro, select the \gui {Install Ministro, system-wide Qt shared
|
||||
libraries installer} option. You
|
||||
can use this option also to install any Android package (.apk). You can use this
|
||||
option to install applications on an Android Virtual Device (AVD). Download
|
||||
the Ministro .apk from the Google Market or from the
|
||||
The easiest way to install Ministro is to do it on the device via Google
|
||||
Play. When you run the application for the first time, a dialog pops up and
|
||||
guides you through the installation.
|
||||
|
||||
To use \QC to install Ministro, you must first download the Ministro .apk
|
||||
from the Google Market or from the
|
||||
\l{http://necessitas.kde.org/necessitas/ministro.php}{Ministro} home page.
|
||||
|
||||
Then select the \gui {Install Ministro, system-wide Qt shared
|
||||
libraries installer} option in \gui Projects > \gui Run >
|
||||
\gui {Deploy configurations} > \gui Details.
|
||||
|
||||
You can use this option also to install any Android package (.apk).
|
||||
|
||||
You can use this option to install applications on an Android Virtual
|
||||
Device (AVD).
|
||||
|
||||
*/
|
||||
|
||||
|
||||
@@ -147,6 +147,14 @@
|
||||
installed on your computer to create and run this type of
|
||||
projects
|
||||
|
||||
\li Qt Quick 2 UI with Controls
|
||||
|
||||
Uses a single QML file that contains the main view and that
|
||||
imports the Qt Quick Controls. You can view the UI in the QML
|
||||
Scene and you need not build it. This project requires that
|
||||
you have installed the Qt Quick Controls for your Qt version
|
||||
(5.1 or later)
|
||||
|
||||
\endlist
|
||||
|
||||
\li Libraries
|
||||
|
||||
@@ -51,7 +51,6 @@
|
||||
\include projects/creator-projects-settings-run-debug.qdocinc
|
||||
\include linux-mobile/creator-projects-settings-run-linux.qdocinc
|
||||
\include qnx/creator-projects-settings-run-qnx.qdocinc
|
||||
\include android/creator-projects-settings-run-android.qdocinc
|
||||
\endif
|
||||
|
||||
\section1 Specifying a Custom Executable to Run
|
||||
|
||||
@@ -74,12 +74,16 @@
|
||||
\endlist
|
||||
|
||||
QML types allow you to write cross-platform applications with custom look
|
||||
and feel. You can also use ready-made Qt Quick Components that enable you to
|
||||
create applications with a native look and feel for a particular target
|
||||
platform. You can install the components as part of the Qt 4 SDK.
|
||||
and feel. You can also use ready-made Qt Quick Components (for Qt 4) to
|
||||
create screens with a native look and feel for a particular target platform.
|
||||
Since Qt 5.1, a set of Qt Quick Controls is available for creating classic
|
||||
desktop-style user interfaces using Qt Quick 2.1.
|
||||
|
||||
When you use the \QC project wizard to create Qt Quick applications, you
|
||||
can select which component set to use in your application.
|
||||
You can install Qt Quick 1 Components as part of the Qt 4 SDK and the Qt
|
||||
Quick Controls as part of Qt 5.1, or later.
|
||||
|
||||
The \QC project wizards create Qt Quick applications that use Qt Quick
|
||||
Components or Controls.
|
||||
|
||||
Even if you use the Qt Quick Components, you can still write cross-platform
|
||||
applications, by using different sets of QML files for each platform.
|
||||
|
||||
@@ -64,6 +64,10 @@
|
||||
need to have the development environment installed on your
|
||||
computer to create and run this type of project.
|
||||
|
||||
\gui {Qt Quick 2 UI with Controls} imports the Qt Quick Controls.
|
||||
This project requires that you have installed the Qt Quick Controls
|
||||
for your Qt version (5.1 or later).
|
||||
|
||||
\li \gui {Qt Quick Application (from Existing QML File)} converts
|
||||
existing Qt Quick applications to Qt Quick application projects.
|
||||
This enables you to run them from \QC and to deploy them to mobile
|
||||
@@ -80,8 +84,10 @@
|
||||
|
||||
\section1 Creating Qt Quick UI Projects
|
||||
|
||||
Select \gui File > \gui {New File or Project} > \gui Applications > \gui {Qt Quick 1 UI}
|
||||
or \gui {Qt Quick 2 UI} > \gui Choose and follow the instructions of the wizard.
|
||||
Select \gui File > \gui {New File or Project} > \gui Applications >
|
||||
\gui {Qt Quick 1 UI}, \gui {Qt Quick 2 UI}, or
|
||||
\gui {Qt Quick 2 UI with Controls} > \gui Choose and follow the instructions
|
||||
of the wizard.
|
||||
|
||||
\QC creates the following files:
|
||||
|
||||
|
||||
@@ -56,7 +56,8 @@
|
||||
|
||||
\li \gui {Library} pane (2) displays the building blocks that you can use to
|
||||
design applications: predefined QML types, your own QML
|
||||
components, Qt Quick components that you import to the project, and
|
||||
components, Qt Quick components or Qt Quick Controls that you import
|
||||
to the project, and
|
||||
other resources.
|
||||
|
||||
\li \gui Canvas (3) is the working area where you create QML components and
|
||||
@@ -150,18 +151,23 @@
|
||||
components, basic types, positioner types, and views.
|
||||
|
||||
Sets of UI components with the look and feel of a particular mobile device
|
||||
platform have been defined for Qt Quick. They are based on standard QML
|
||||
types. To view the UI components in the \gui {Library} pane, add import
|
||||
platform have been defined for Qt Quick 1. Since Qt 5.1, a set of Qt Quick
|
||||
Controls is available for creating classic desktop-style user interfaces
|
||||
using Qt Quick 2.1. The Qt Quick Components and Controls are based on
|
||||
standard QML types. To view the components and controls in the
|
||||
\gui {Library} pane, add import
|
||||
statements to the .pro file of your project. For example:
|
||||
|
||||
\list
|
||||
|
||||
\li \c {import com.nokia.meego 1.0} for MeeGo
|
||||
\li \c {import QtQuick.Controls 1.0} for Qt Quick Controls
|
||||
|
||||
\endlist
|
||||
|
||||
The Qt Quick Application wizard adds the import statements automatically
|
||||
when you select the component set to use for your project.
|
||||
The \gui {Qt Quick Application} wizards for a particular platform, such as
|
||||
MeeGo Harmattan, and the \gui {Qt Quick 2 UI with Controls} wizard add the
|
||||
import statements automatically.
|
||||
|
||||
\image qmldesigner-qml-components.png "QML Components pane"
|
||||
|
||||
|
||||
@@ -40,9 +40,12 @@
|
||||
in the \gui Library pane.
|
||||
\endif
|
||||
|
||||
You can also use ready-made Qt Quick Components that allow you to create
|
||||
screens with a native look and feel for a particular target platform. You
|
||||
can install the components as part of the Qt 4 SDK.
|
||||
You can also use ready-made Qt Quick 1 Components (for Qt 4) to create
|
||||
screens with a native look and feel for a particular target platform.
|
||||
Since Qt 5.1, a set of Qt Quick Controls is available for creating classic
|
||||
desktop-style user interfaces using Qt Quick 2.1. You
|
||||
can install Qt Quick 1 Components as part of the Qt 4 SDK and the Qt Quick
|
||||
Controls as part of Qt 5.1, or later.
|
||||
|
||||
\if defined(qcmanual)
|
||||
\section1 Adding Components to Screens
|
||||
|
||||
@@ -2,7 +2,7 @@ include(../../../qtcreator.pri)
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = phony_target3
|
||||
CONFIG -= qt separate_debug_info gdb_dwarf_index
|
||||
CONFIG -= qt sdk separate_debug_info gdb_dwarf_index
|
||||
QT =
|
||||
LIBS =
|
||||
macx:CONFIG -= app_bundle
|
||||
|
||||
@@ -38,6 +38,8 @@ exists(src/shared/qbs/qbs.pro) {
|
||||
system("echo CONFIG += qbs_no_dev_install >> $$qmake_cache")
|
||||
}
|
||||
|
||||
_QMAKE_CACHE_ = $$qmake_cache # Qt 4 support prevents us from using cache(), so tell Qt 5 about the cache
|
||||
|
||||
contains(QT_ARCH, i386): ARCHITECTURE = x86
|
||||
else: ARCHITECTURE = $$QT_ARCH
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ def copy_ignore_patterns_helper(dir, filenames):
|
||||
filenames = wrong_dlls + filter(windows_debug_files_filter, filenames)
|
||||
return filenames
|
||||
|
||||
def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, plugins, imports):
|
||||
def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, qt_qml_dir, plugins, imports):
|
||||
print "copying Qt libraries..."
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
@@ -175,7 +175,7 @@ def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, plugins
|
||||
|
||||
print "Copying plugins:", plugins
|
||||
for plugin in plugins:
|
||||
target = os.path.join(install_dir, 'bin', plugin)
|
||||
target = os.path.join(install_dir, 'bin', 'plugins', plugin)
|
||||
if (os.path.exists(target)):
|
||||
shutil.rmtree(target)
|
||||
pluginPath = os.path.join(qt_plugin_dir, plugin)
|
||||
@@ -184,16 +184,26 @@ def copy_qt_libs(install_dir, qt_libs_dir, qt_plugin_dir, qt_import_dir, plugins
|
||||
|
||||
print "Copying imports:", imports
|
||||
for qtimport in imports:
|
||||
target = os.path.join(install_dir, 'bin', qtimport)
|
||||
target = os.path.join(install_dir, 'bin', 'imports', qtimport)
|
||||
if (os.path.exists(target)):
|
||||
shutil.rmtree(target)
|
||||
shutil.copytree(os.path.join(qt_import_dir, qtimport), target, ignore=copy_ignore_func, symlinks=True)
|
||||
|
||||
if (os.path.exists(qt_qml_dir)):
|
||||
print "Copying qt quick 2 imports"
|
||||
target = os.path.join(install_dir, 'bin', 'qml')
|
||||
if (os.path.exists(target)):
|
||||
shutil.rmtree(target)
|
||||
shutil.copytree(qt_qml_dir, target, ignore=copy_ignore_func, symlinks=True)
|
||||
|
||||
def add_qt_conf(install_dir):
|
||||
print "Creating qt.conf:"
|
||||
f = open(install_dir + '/bin/qt.conf', 'w')
|
||||
f.write('[Paths]\n')
|
||||
f.write('Libraries=../lib/qtcreator\n')
|
||||
f.write('Plugins=plugins\n')
|
||||
f.write('Imports=imports\n')
|
||||
f.write('Qml2Imports=qml\n')
|
||||
f.close()
|
||||
|
||||
def copy_translations(install_dir, qt_tr_dir):
|
||||
@@ -249,6 +259,7 @@ def main():
|
||||
QT_INSTALL_BINS = readQmakeVar(qmake_bin, 'QT_INSTALL_BINS')
|
||||
QT_INSTALL_PLUGINS = readQmakeVar(qmake_bin, 'QT_INSTALL_PLUGINS')
|
||||
QT_INSTALL_IMPORTS = readQmakeVar(qmake_bin, 'QT_INSTALL_IMPORTS')
|
||||
QT_INSTALL_QML = readQmakeVar(qmake_bin, 'QT_INSTALL_QML')
|
||||
QT_INSTALL_TRANSLATIONS = readQmakeVar(qmake_bin, 'QT_INSTALL_TRANSLATIONS')
|
||||
|
||||
plugins = ['accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platforms', 'printsupport', 'sqldrivers']
|
||||
@@ -259,9 +270,9 @@ def main():
|
||||
debug_build = is_debug_build(install_dir)
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
copy_qt_libs(install_dir, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports)
|
||||
copy_qt_libs(install_dir, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports)
|
||||
else:
|
||||
copy_qt_libs(install_dir, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, plugins, imports)
|
||||
copy_qt_libs(install_dir, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports)
|
||||
copy_translations(install_dir, QT_INSTALL_TRANSLATIONS)
|
||||
|
||||
if not sys.platform.startswith('win'):
|
||||
|
||||
@@ -97,12 +97,15 @@ bool Qt5InformationNodeInstanceServer::isDirtyRecursiveForNonInstanceItems(QQuic
|
||||
return true;
|
||||
|
||||
foreach (QQuickItem *childItem, item->childItems()) {
|
||||
if (!hasInstanceForObject(childItem) && DesignerSupport::isDirty(childItem, informationsDirty))
|
||||
if (!hasInstanceForObject(childItem)) {
|
||||
if (DesignerSupport::isDirty(childItem, informationsDirty))
|
||||
return true;
|
||||
else if (isDirtyRecursiveForNonInstanceItems(childItem))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
void Qt5InformationNodeInstanceServer::collectItemChangesAndSendChangeCommands()
|
||||
|
||||
@@ -34,6 +34,9 @@
|
||||
|
||||
#include <qt5nodeinstanceclientproxy.h>
|
||||
|
||||
#include <QQmlComponent>
|
||||
#include <QQmlEngine>
|
||||
|
||||
#ifdef ENABLE_QT_BREAKPAD
|
||||
#include <qtsystemexceptionhandler.h>
|
||||
#endif
|
||||
@@ -51,6 +54,25 @@ int main(int argc, char *argv[])
|
||||
QCoreApplication::setApplicationName("Qml2Puppet");
|
||||
QCoreApplication::setApplicationVersion("1.0.0");
|
||||
|
||||
if (application.arguments().count() == 2 && application.arguments().at(1) == "--test") {
|
||||
qDebug() << QCoreApplication::applicationVersion();
|
||||
QQmlEngine engine;
|
||||
|
||||
QQmlComponent component(&engine);
|
||||
component.setData("import QtQuick 2.0\nItem {\n}\n", QUrl::fromLocalFile("test.qml"));
|
||||
|
||||
QObject *object = component.create();
|
||||
|
||||
if (object) {
|
||||
qDebug() << "Basic QtQuick 2.0 working...";
|
||||
} else {
|
||||
qDebug() << "Basic QtQuick 2.0 not working...";
|
||||
qDebug() << component.errorString();
|
||||
}
|
||||
delete object;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (application.arguments().count() == 2 && application.arguments().at(1) == "--version") {
|
||||
qDebug() << QCoreApplication::applicationVersion();
|
||||
return 0;
|
||||
|
||||
@@ -61,7 +61,7 @@ QWidget {
|
||||
backendValues.source.value = fileName;
|
||||
}
|
||||
itemNode: anchorBackend.itemNode
|
||||
filter: "*.png *.gif *.jpg *.bmp *.jpeg"
|
||||
filter: "*.png *.gif *.jpg *.bmp *.jpeg *.svg"
|
||||
showComboBox: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ QWidget {
|
||||
backendValues.source.value = fileName;
|
||||
}
|
||||
itemNode: anchorBackend.itemNode
|
||||
filter: "*.png *.gif *.jpg *.bmp *.jpeg"
|
||||
filter: "*.png *.gif *.jpg *.bmp *.jpeg *.svg"
|
||||
showComboBox: true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ include(../../qtcreator.pri)
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = phony_target
|
||||
CONFIG -= qt separate_debug_info gdb_dwarf_index
|
||||
CONFIG -= qt sdk separate_debug_info gdb_dwarf_index
|
||||
QT =
|
||||
LIBS =
|
||||
macx:CONFIG -= app_bundle
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import QtQuick 2.0
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Controls 1.0
|
||||
import QtQuick.Window 2.0
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ QMAKE_EXTRA_TARGETS += ts
|
||||
|
||||
TEMPLATE = app
|
||||
TARGET = phony_target2
|
||||
CONFIG -= qt separate_debug_info gdb_dwarf_index
|
||||
CONFIG -= qt sdk separate_debug_info gdb_dwarf_index
|
||||
QT =
|
||||
LIBS =
|
||||
|
||||
|
||||
@@ -152,38 +152,34 @@ uint qHash(const FullyQualifiedName &fullyQualifiedName)
|
||||
// LookupContext
|
||||
/////////////////////////////////////////////////////////////////////
|
||||
LookupContext::LookupContext()
|
||||
: _control(new Control())
|
||||
, m_expandTemplates(false)
|
||||
: m_expandTemplates(false)
|
||||
{ }
|
||||
|
||||
LookupContext::LookupContext(Document::Ptr thisDocument,
|
||||
const Snapshot &snapshot)
|
||||
: _expressionDocument(Document::create(QLatin1String("<LookupContext>"))),
|
||||
_thisDocument(thisDocument),
|
||||
_snapshot(snapshot),
|
||||
_control(new Control()),
|
||||
m_expandTemplates(false)
|
||||
: _expressionDocument(Document::create(QLatin1String("<LookupContext>")))
|
||||
, _thisDocument(thisDocument)
|
||||
, _snapshot(snapshot)
|
||||
, m_expandTemplates(false)
|
||||
{
|
||||
}
|
||||
|
||||
LookupContext::LookupContext(Document::Ptr expressionDocument,
|
||||
Document::Ptr thisDocument,
|
||||
const Snapshot &snapshot)
|
||||
: _expressionDocument(expressionDocument),
|
||||
_thisDocument(thisDocument),
|
||||
_snapshot(snapshot),
|
||||
_control(new Control()),
|
||||
m_expandTemplates(false)
|
||||
: _expressionDocument(expressionDocument)
|
||||
, _thisDocument(thisDocument)
|
||||
, _snapshot(snapshot)
|
||||
, m_expandTemplates(false)
|
||||
{
|
||||
}
|
||||
|
||||
LookupContext::LookupContext(const LookupContext &other)
|
||||
: _expressionDocument(other._expressionDocument),
|
||||
_thisDocument(other._thisDocument),
|
||||
_snapshot(other._snapshot),
|
||||
_bindings(other._bindings),
|
||||
_control(other._control),
|
||||
m_expandTemplates(other.m_expandTemplates)
|
||||
: _expressionDocument(other._expressionDocument)
|
||||
, _thisDocument(other._thisDocument)
|
||||
, _snapshot(other._snapshot)
|
||||
, _bindings(other._bindings)
|
||||
, m_expandTemplates(other.m_expandTemplates)
|
||||
{ }
|
||||
|
||||
LookupContext &LookupContext::operator=(const LookupContext &other)
|
||||
@@ -192,7 +188,6 @@ LookupContext &LookupContext::operator = (const LookupContext &other)
|
||||
_thisDocument = other._thisDocument;
|
||||
_snapshot = other._snapshot;
|
||||
_bindings = other._bindings;
|
||||
_control = other._control;
|
||||
m_expandTemplates = other.m_expandTemplates;
|
||||
return *this;
|
||||
}
|
||||
@@ -278,7 +273,7 @@ QList<LookupItem> LookupContext::lookupByUsing(const Name *name, Scope *scope) c
|
||||
QSharedPointer<CreateBindings> LookupContext::bindings() const
|
||||
{
|
||||
if (! _bindings) {
|
||||
_bindings = QSharedPointer<CreateBindings>(new CreateBindings(_thisDocument, _snapshot, control()));
|
||||
_bindings = QSharedPointer<CreateBindings>(new CreateBindings(_thisDocument, _snapshot));
|
||||
_bindings->setExpandTemplates(m_expandTemplates);
|
||||
}
|
||||
|
||||
@@ -290,11 +285,6 @@ void LookupContext::setBindings(QSharedPointer<CreateBindings> bindings)
|
||||
_bindings = bindings;
|
||||
}
|
||||
|
||||
QSharedPointer<Control> LookupContext::control() const
|
||||
{
|
||||
return _control;
|
||||
}
|
||||
|
||||
Document::Ptr LookupContext::expressionDocument() const
|
||||
{ return _expressionDocument; }
|
||||
|
||||
@@ -694,7 +684,7 @@ void CreateBindings::lookupInScope(const Name *name, Scope *scope,
|
||||
}
|
||||
|
||||
if (templateId && (s->isDeclaration() || s->isFunction())) {
|
||||
FullySpecifiedType ty = DeprecatedGenTemplateInstance::instantiate(templateId, s, _control);
|
||||
FullySpecifiedType ty = DeprecatedGenTemplateInstance::instantiate(templateId, s, control());
|
||||
item.setType(ty); // override the type.
|
||||
}
|
||||
|
||||
@@ -1278,8 +1268,10 @@ ClassOrNamespace *ClassOrNamespace::findOrCreateType(const Name *name, ClassOrNa
|
||||
return 0;
|
||||
}
|
||||
|
||||
CreateBindings::CreateBindings(Document::Ptr thisDocument, const Snapshot &snapshot, QSharedPointer<Control> control)
|
||||
: _snapshot(snapshot), _control(control), _expandTemplates(false)
|
||||
CreateBindings::CreateBindings(Document::Ptr thisDocument, const Snapshot &snapshot)
|
||||
: _snapshot(snapshot)
|
||||
, _control(QSharedPointer<Control>(new Control))
|
||||
, _expandTemplates(false)
|
||||
{
|
||||
_globalNamespace = allocClassOrNamespace(/*parent = */ 0);
|
||||
_currentClassOrNamespace = _globalNamespace;
|
||||
@@ -1340,11 +1332,6 @@ void CreateBindings::process(Symbol *symbol)
|
||||
_currentClassOrNamespace->addTodo(symbol);
|
||||
}
|
||||
|
||||
QSharedPointer<Control> CreateBindings::control() const
|
||||
{
|
||||
return _control;
|
||||
}
|
||||
|
||||
ClassOrNamespace *CreateBindings::allocClassOrNamespace(ClassOrNamespace *parent)
|
||||
{
|
||||
ClassOrNamespace *e = new ClassOrNamespace(this, parent);
|
||||
|
||||
@@ -177,7 +177,7 @@ class CPLUSPLUS_EXPORT CreateBindings: protected SymbolVisitor
|
||||
Q_DISABLE_COPY(CreateBindings)
|
||||
|
||||
public:
|
||||
CreateBindings(Document::Ptr thisDocument, const Snapshot &snapshot, QSharedPointer<Control> control);
|
||||
CreateBindings(Document::Ptr thisDocument, const Snapshot &snapshot);
|
||||
virtual ~CreateBindings();
|
||||
|
||||
/// Returns the binding for the global namespace.
|
||||
@@ -191,7 +191,8 @@ public:
|
||||
|
||||
/// Returns the Control that must be used to create temporary symbols.
|
||||
/// \internal
|
||||
QSharedPointer<Control> control() const;
|
||||
QSharedPointer<Control> control() const
|
||||
{ return _control; }
|
||||
|
||||
bool expandTemplates() const
|
||||
{ return _expandTemplates; }
|
||||
@@ -296,8 +297,6 @@ public:
|
||||
/// \internal
|
||||
void setBindings(QSharedPointer<CreateBindings> bindings);
|
||||
|
||||
QSharedPointer<Control> control() const; // ### deprecate
|
||||
|
||||
static QList<const Name *> fullyQualifiedName(Symbol *symbol);
|
||||
static QList<const Name *> path(Symbol *symbol);
|
||||
|
||||
@@ -325,8 +324,6 @@ private:
|
||||
// Bindings
|
||||
mutable QSharedPointer<CreateBindings> _bindings;
|
||||
|
||||
QSharedPointer<Control> _control;
|
||||
|
||||
bool m_expandTemplates;
|
||||
};
|
||||
|
||||
|
||||
@@ -50,10 +50,12 @@
|
||||
const wchar_t szTitle[] = L"qtcctrlcstub";
|
||||
const wchar_t szWindowClass[] = L"wcqtcctrlcstub";
|
||||
UINT uiShutDownWindowMessage;
|
||||
UINT uiInterruptMessage;
|
||||
HWND hwndMain = 0;
|
||||
|
||||
LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
|
||||
BOOL WINAPI ctrlHandler(DWORD dwCtrlType);
|
||||
BOOL WINAPI shutdownHandler(DWORD dwCtrlType);
|
||||
BOOL WINAPI interruptHandler(DWORD dwCtrlType);
|
||||
bool isSpaceOrTab(const wchar_t c);
|
||||
bool startProcess(wchar_t pCommandLine[]);
|
||||
|
||||
@@ -64,8 +66,8 @@ int main(int argc, char **)
|
||||
return 1;
|
||||
}
|
||||
|
||||
SetConsoleCtrlHandler(ctrlHandler, TRUE);
|
||||
uiShutDownWindowMessage = RegisterWindowMessage(L"qtcctrlcstub_shutdown");
|
||||
uiInterruptMessage = RegisterWindowMessage(L"qtcctrlcstub_interrupt");
|
||||
|
||||
WNDCLASSEX wcex = {0};
|
||||
wcex.cbSize = sizeof(wcex);
|
||||
@@ -117,9 +119,16 @@ int main(int argc, char **)
|
||||
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
if (message == uiShutDownWindowMessage) {
|
||||
SetConsoleCtrlHandler(interruptHandler, FALSE);
|
||||
SetConsoleCtrlHandler(shutdownHandler, TRUE);
|
||||
GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0);
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
} else if (message == uiInterruptMessage) {
|
||||
SetConsoleCtrlHandler(interruptHandler, TRUE);
|
||||
SetConsoleCtrlHandler(shutdownHandler, FALSE);
|
||||
GenerateConsoleCtrlEvent(CTRL_C_EVENT, 0);
|
||||
return 0;
|
||||
}
|
||||
|
||||
switch (message)
|
||||
@@ -138,12 +147,17 @@ bool isSpaceOrTab(const wchar_t c)
|
||||
return c == L' ' || c == L'\t';
|
||||
}
|
||||
|
||||
BOOL WINAPI ctrlHandler(DWORD /*dwCtrlType*/)
|
||||
BOOL WINAPI shutdownHandler(DWORD /*dwCtrlType*/)
|
||||
{
|
||||
PostMessage(hwndMain, WM_DESTROY, 0, 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL WINAPI interruptHandler(DWORD /*dwCtrlType*/)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
DWORD WINAPI processWatcherThread(LPVOID lpParameter)
|
||||
{
|
||||
HANDLE hProcess = reinterpret_cast<HANDLE>(lpParameter);
|
||||
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "qtcprocess.h"
|
||||
#include "stringutils.h"
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
|
||||
#include <QDir>
|
||||
#include <QDebug>
|
||||
#include <QCoreApplication>
|
||||
@@ -699,17 +701,28 @@ void QtcProcess::start()
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
BOOL CALLBACK sendShutDownMessageToAllWindowsOfProcess_enumWnd(HWND hwnd, LPARAM lParam)
|
||||
static BOOL sendMessage(UINT message, HWND hwnd, LPARAM lParam)
|
||||
{
|
||||
static UINT uiShutDownMessage = RegisterWindowMessage(L"qtcctrlcstub_shutdown");
|
||||
DWORD dwProcessID;
|
||||
GetWindowThreadProcessId(hwnd, &dwProcessID);
|
||||
if ((DWORD)lParam == dwProcessID) {
|
||||
SendNotifyMessage(hwnd, uiShutDownMessage, 0, 0);
|
||||
SendNotifyMessage(hwnd, message, 0, 0);
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
BOOL CALLBACK sendShutDownMessageToAllWindowsOfProcess_enumWnd(HWND hwnd, LPARAM lParam)
|
||||
{
|
||||
static UINT uiShutDownMessage = RegisterWindowMessage(L"qtcctrlcstub_shutdown");
|
||||
return sendMessage(uiShutDownMessage, hwnd, lParam);
|
||||
}
|
||||
|
||||
BOOL CALLBACK sendInterruptMessageToAllWindowsOfProcess_enumWnd(HWND hwnd, LPARAM lParam)
|
||||
{
|
||||
static UINT uiInterruptMessage = RegisterWindowMessage(L"qtcctrlcstub_interrupt");
|
||||
return sendMessage(uiInterruptMessage, hwnd, lParam);
|
||||
}
|
||||
#endif
|
||||
|
||||
void QtcProcess::terminate()
|
||||
@@ -723,6 +736,11 @@ void QtcProcess::terminate()
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
void QtcProcess::interrupt()
|
||||
{
|
||||
QTC_ASSERT(m_useCtrlCStub, return);
|
||||
EnumWindows(sendInterruptMessageToAllWindowsOfProcess_enumWnd, pid()->dwProcessId);
|
||||
}
|
||||
|
||||
// This function assumes that the resulting string will be quoted.
|
||||
// That's irrelevant if it does not contain quotes itself.
|
||||
|
||||
@@ -58,6 +58,9 @@ public:
|
||||
#endif
|
||||
void start();
|
||||
void terminate();
|
||||
#ifdef Q_OS_WIN
|
||||
void interrupt();
|
||||
#endif
|
||||
|
||||
enum SplitError {
|
||||
SplitOk = 0, //! All went just fine
|
||||
|
||||
@@ -82,7 +82,11 @@ void AndroidDeployStep::ctor()
|
||||
//: AndroidDeployStep default display name
|
||||
setDefaultDisplayName(tr("Deploy to Android device"));
|
||||
m_deployAction = NoDeploy;
|
||||
|
||||
m_useLocalQtLibs = false;
|
||||
if (QtSupport::BaseQtVersion *qt = QtSupport::QtKitInformation::qtVersion(target()->kit()))
|
||||
if (qt->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0))
|
||||
m_useLocalQtLibs = true;
|
||||
}
|
||||
|
||||
bool AndroidDeployStep::init()
|
||||
@@ -201,22 +205,20 @@ void AndroidDeployStep::cleanLibsFinished()
|
||||
void AndroidDeployStep::setDeployAction(AndroidDeployStep::AndroidDeployAction deploy)
|
||||
{
|
||||
m_deployAction = deploy;
|
||||
|
||||
AndroidManager::updateDeploymentSettings(target());
|
||||
}
|
||||
|
||||
void AndroidDeployStep::setDeployQASIPackagePath(const QString &package)
|
||||
{
|
||||
m_QASIPackagePath = package;
|
||||
m_deployAction = InstallQASI;
|
||||
setDeployAction(InstallQASI);
|
||||
}
|
||||
|
||||
void AndroidDeployStep::setUseLocalQtLibs(bool useLocal)
|
||||
{
|
||||
m_useLocalQtLibs = useLocal;
|
||||
|
||||
// ### Passes -1 for API level, which means it won't work with setups that require
|
||||
// library selection based on API level. Use the old approach (command line argument)
|
||||
// in these cases.
|
||||
AndroidManager::setUseLocalLibs(target(), useLocal, -1);
|
||||
AndroidManager::updateDeploymentSettings(target());
|
||||
}
|
||||
|
||||
bool AndroidDeployStep::runCommand(QProcess *buildProc,
|
||||
|
||||
@@ -62,6 +62,7 @@ namespace {
|
||||
const QLatin1String AndroidLibsFileName("/res/values/libs.xml");
|
||||
const QLatin1String AndroidStringsFileName("/res/values/strings.xml");
|
||||
const QLatin1String AndroidDefaultPropertiesName("project.properties");
|
||||
const QLatin1String AndroidLibraryPrefix("--Managed_by_Qt_Creator--");
|
||||
|
||||
QString cleanPackageName(QString packageName)
|
||||
{
|
||||
@@ -428,7 +429,20 @@ QString AndroidManager::targetApplication(ProjectExplorer::Target *target)
|
||||
return QString();
|
||||
}
|
||||
|
||||
bool AndroidManager::setUseLocalLibs(ProjectExplorer::Target *target, bool useLocalLibs, int deviceAPILevel)
|
||||
bool AndroidManager::bundleQt(ProjectExplorer::Target *target)
|
||||
{
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = target->activeRunConfiguration();
|
||||
AndroidRunConfiguration *androidRunConfiguration = qobject_cast<AndroidRunConfiguration *>(runConfiguration);
|
||||
if (androidRunConfiguration != 0) {
|
||||
AndroidDeployStep *deployStep = androidRunConfiguration->deployStep();
|
||||
return deployStep->deployAction() == AndroidDeployStep::NoDeploy
|
||||
&& deployStep->useLocalQtLibs();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AndroidManager::updateDeploymentSettings(ProjectExplorer::Target *target)
|
||||
{
|
||||
// For Qt 4, the "use local libs" options is handled by passing command line arguments to the
|
||||
// app, so no need to alter the AndroidManifest.xml
|
||||
@@ -436,19 +450,32 @@ bool AndroidManager::setUseLocalLibs(ProjectExplorer::Target *target, bool useLo
|
||||
if (baseQtVersion == 0 || baseQtVersion->qtVersion() < QtSupport::QtVersionNumber(5,0,0))
|
||||
return true;
|
||||
|
||||
ProjectExplorer::RunConfiguration *runConfiguration = target->activeRunConfiguration();
|
||||
AndroidRunConfiguration *androidRunConfiguration = qobject_cast<AndroidRunConfiguration *>(runConfiguration);
|
||||
if (androidRunConfiguration == 0)
|
||||
return false;
|
||||
|
||||
AndroidDeployStep *deployStep = androidRunConfiguration->deployStep();
|
||||
bool useLocalLibs = deployStep->useLocalQtLibs();
|
||||
bool deployQtLibs = deployStep->deployAction() != AndroidDeployStep::NoDeploy;
|
||||
bool bundleQtLibs = useLocalLibs && !deployQtLibs;
|
||||
|
||||
QDomDocument doc;
|
||||
if (!openManifest(target, doc))
|
||||
return false;
|
||||
|
||||
QDomElement metadataElem = doc.documentElement().firstChildElement(QLatin1String("application")).firstChildElement(QLatin1String("activity")).firstChildElement(QLatin1String("meta-data"));
|
||||
|
||||
// ### Passes -1 for API level, which means it won't work with setups that require
|
||||
// library selection based on API level. Use the old approach (command line argument)
|
||||
// in these cases. Hence the Qt version > 4 condition at the beginning of this function.
|
||||
QString localLibs;
|
||||
QString localJars;
|
||||
QString staticInitClasses;
|
||||
if (useLocalLibs) {
|
||||
localLibs = loadLocalLibs(target, deviceAPILevel);
|
||||
localJars = loadLocalJars(target, deviceAPILevel);
|
||||
staticInitClasses = loadLocalJarsInitClasses(target, deviceAPILevel);
|
||||
localLibs = loadLocalLibs(target, -1);
|
||||
localJars = loadLocalJars(target, -1);
|
||||
staticInitClasses = loadLocalJarsInitClasses(target, -1);
|
||||
}
|
||||
|
||||
bool changedManifest = false;
|
||||
@@ -473,6 +500,11 @@ bool AndroidManager::setUseLocalLibs(ProjectExplorer::Target *target, bool useLo
|
||||
metadataElem.setAttribute(QLatin1String("android:value"), staticInitClasses);
|
||||
changedManifest = true;
|
||||
}
|
||||
} else if (metadataElem.attribute(QLatin1String("android:name")) == QLatin1String("android.app.bundle_local_qt_libs")) {
|
||||
if (metadataElem.attribute(QLatin1String("android:value")).toInt() != bundleQtLibs) {
|
||||
metadataElem.setAttribute(QLatin1String("android:value"), int(bundleQtLibs));
|
||||
changedManifest = true;
|
||||
}
|
||||
}
|
||||
|
||||
metadataElem = metadataElem.nextSiblingElement(QLatin1String("meta-data"));
|
||||
@@ -708,14 +740,21 @@ QString AndroidManager::loadLocalLibs(ProjectExplorer::Target *target, int apiLe
|
||||
return loadLocal(target, apiLevel, Lib);
|
||||
}
|
||||
|
||||
QString AndroidManager::loadLocalBundledFiles(ProjectExplorer::Target *target, int apiLevel)
|
||||
{
|
||||
return loadLocal(target, apiLevel, BundledFile);
|
||||
}
|
||||
|
||||
QString AndroidManager::loadLocalJars(ProjectExplorer::Target *target, int apiLevel)
|
||||
{
|
||||
return loadLocal(target, apiLevel, Jar);
|
||||
ItemType type = bundleQt(target) ? BundledJar : Jar;
|
||||
return loadLocal(target, apiLevel, type);
|
||||
}
|
||||
|
||||
QString AndroidManager::loadLocalJarsInitClasses(ProjectExplorer::Target *target, int apiLevel)
|
||||
{
|
||||
return loadLocal(target, apiLevel, Jar, QLatin1String("initClass"));
|
||||
ItemType type = bundleQt(target) ? BundledJar : Jar;
|
||||
return loadLocal(target, apiLevel, type, QLatin1String("initClass"));
|
||||
}
|
||||
|
||||
QVector<AndroidManager::Library> AndroidManager::availableQtLibsWithDependencies(ProjectExplorer::Target *target)
|
||||
@@ -815,6 +854,16 @@ bool AndroidManager::setQtLibs(ProjectExplorer::Target *target, const QStringLis
|
||||
return setLibsXml(target, libs, QLatin1String("qt_libs"));
|
||||
}
|
||||
|
||||
bool AndroidManager::setBundledInAssets(ProjectExplorer::Target *target, const QStringList &fileList)
|
||||
{
|
||||
return setLibsXml(target, fileList, QLatin1String("bundled_in_assets"));
|
||||
}
|
||||
|
||||
bool AndroidManager::setBundledInLib(ProjectExplorer::Target *target, const QStringList &fileList)
|
||||
{
|
||||
return setLibsXml(target, fileList, QLatin1String("bundled_in_lib"));
|
||||
}
|
||||
|
||||
QStringList AndroidManager::availablePrebundledLibs(ProjectExplorer::Target *target)
|
||||
{
|
||||
QStringList libs;
|
||||
@@ -858,7 +907,9 @@ QString AndroidManager::loadLocal(ProjectExplorer::Target *target, int apiLevel,
|
||||
QString itemType;
|
||||
if (item == Lib)
|
||||
itemType = QLatin1String("lib");
|
||||
else
|
||||
else if (item == BundledFile)
|
||||
itemType = QLatin1String("bundled");
|
||||
else // Jar or BundledJar
|
||||
itemType = QLatin1String("jar");
|
||||
|
||||
QString localLibs;
|
||||
@@ -900,6 +951,7 @@ QString AndroidManager::loadLocal(ProjectExplorer::Target *target, int apiLevel,
|
||||
if (libs.contains(element.attribute(QLatin1String("name")))) {
|
||||
QDomElement libElement = element.firstChildElement(QLatin1String("depends")).firstChildElement(itemType);
|
||||
while (!libElement.isNull()) {
|
||||
if (libElement.attribute(QLatin1String("bundling")).toInt() == (item == BundledJar ? 1 : 0)) {
|
||||
if (libElement.hasAttribute(attribute)) {
|
||||
QString dependencyLib = libElement.attribute(attribute).arg(apiLevel);
|
||||
if (!dependencyLibs.contains(dependencyLib))
|
||||
@@ -911,6 +963,7 @@ QString AndroidManager::loadLocal(ProjectExplorer::Target *target, int apiLevel,
|
||||
if (!replacedLibs.contains(replacedLib))
|
||||
replacedLibs << replacedLib;
|
||||
}
|
||||
}
|
||||
|
||||
libElement = libElement.nextSiblingElement(itemType);
|
||||
}
|
||||
@@ -1117,5 +1170,10 @@ QString AndroidManager::libGnuStl(const QString &arch, const QString &ndkToolCha
|
||||
+ QLatin1String("/libgnustl_shared.so");
|
||||
}
|
||||
|
||||
QString AndroidManager::libraryPrefix()
|
||||
{
|
||||
return AndroidLibraryPrefix;
|
||||
}
|
||||
|
||||
} // namespace Internal
|
||||
} // namespace Qt4ProjectManager
|
||||
|
||||
@@ -85,7 +85,8 @@ public:
|
||||
static bool setTargetApplication(ProjectExplorer::Target *target, const QString &name);
|
||||
static QString targetApplicationPath(ProjectExplorer::Target *target);
|
||||
|
||||
static bool setUseLocalLibs(ProjectExplorer::Target *target, bool useLocalLibs, int deviceAPILevel);
|
||||
static bool updateDeploymentSettings(ProjectExplorer::Target *target);
|
||||
static bool bundleQt(ProjectExplorer::Target *target);
|
||||
|
||||
static QString targetSDK(ProjectExplorer::Target *target);
|
||||
static bool setTargetSDK(ProjectExplorer::Target *target, const QString &sdk);
|
||||
@@ -105,9 +106,10 @@ public:
|
||||
const QString &name = QString());
|
||||
|
||||
static Utils::FileName localLibsRulesFilePath(ProjectExplorer::Target *target);
|
||||
static QString loadLocalLibs(ProjectExplorer::Target *target, int apiLevel);
|
||||
static QString loadLocalJars(ProjectExplorer::Target *target, int apiLevel);
|
||||
static QString loadLocalJarsInitClasses(ProjectExplorer::Target *target, int apiLevel);
|
||||
static QString loadLocalLibs(ProjectExplorer::Target *target, int apiLevel = -1);
|
||||
static QString loadLocalJars(ProjectExplorer::Target *target, int apiLevel = -1);
|
||||
static QString loadLocalBundledFiles(ProjectExplorer::Target *target, int apiLevel = -1);
|
||||
static QString loadLocalJarsInitClasses(ProjectExplorer::Target *target, int apiLevel = -1);
|
||||
|
||||
class Library
|
||||
{
|
||||
@@ -125,11 +127,17 @@ public:
|
||||
static QStringList qtLibs(ProjectExplorer::Target *target);
|
||||
static bool setQtLibs(ProjectExplorer::Target *target, const QStringList &libs);
|
||||
|
||||
static bool setBundledInLib(ProjectExplorer::Target *target,
|
||||
const QStringList &fileList);
|
||||
static bool setBundledInAssets(ProjectExplorer::Target *target,
|
||||
const QStringList &fileList);
|
||||
|
||||
static QStringList availablePrebundledLibs(ProjectExplorer::Target *target);
|
||||
static QStringList prebundledLibs(ProjectExplorer::Target *target);
|
||||
static bool setPrebundledLibs(ProjectExplorer::Target *target, const QStringList &libs);
|
||||
|
||||
static QString libGnuStl(const QString &arch, const QString &ndkToolChainVersion);
|
||||
static QString libraryPrefix();
|
||||
|
||||
private:
|
||||
static void raiseError(const QString &reason);
|
||||
@@ -145,7 +153,9 @@ private:
|
||||
enum ItemType
|
||||
{
|
||||
Lib,
|
||||
Jar
|
||||
Jar,
|
||||
BundledFile,
|
||||
BundledJar
|
||||
};
|
||||
static QString loadLocal(ProjectExplorer::Target *target, int apiLevel, ItemType item, const QString &attribute=QLatin1String("file"));
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
#include <qt4projectmanager/qt4nodes.h>
|
||||
#include <qtsupport/qtkitinformation.h>
|
||||
|
||||
#include <coreplugin/icore.h>
|
||||
#include <coreplugin/fileutils.h>
|
||||
@@ -129,6 +130,7 @@ void AndroidPackageCreationStep::ctor()
|
||||
{
|
||||
setDefaultDisplayName(tr("Packaging for Android"));
|
||||
m_openPackageLocation = true;
|
||||
m_bundleQt = false;
|
||||
connect(&m_outputParser, SIGNAL(addTask(ProjectExplorer::Task)), this, SIGNAL(addTask(ProjectExplorer::Task)));
|
||||
}
|
||||
|
||||
@@ -314,6 +316,17 @@ void AndroidPackageCreationStep::initCheckRequiredLibrariesForRun()
|
||||
m_prebundledLibs = AndroidManager::prebundledLibs(target());
|
||||
}
|
||||
|
||||
void AndroidPackageCreationStep::getBundleInformation()
|
||||
{
|
||||
m_bundleQt = AndroidManager::bundleQt(target());
|
||||
if (m_bundleQt) {
|
||||
m_bundledJars = AndroidManager::loadLocalJars(target()).split(QLatin1Char(':'),
|
||||
QString::SkipEmptyParts);
|
||||
m_otherBundledFiles = AndroidManager::loadLocalBundledFiles(target()).split(QLatin1Char(':'),
|
||||
QString::SkipEmptyParts);
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidPackageCreationStep::checkRequiredLibrariesForRun()
|
||||
{
|
||||
QProcess readelfProc;
|
||||
@@ -329,8 +342,11 @@ void AndroidPackageCreationStep::checkRequiredLibrariesForRun()
|
||||
QStringList libs;
|
||||
parseSharedLibs(readelfProc.readAll(), &libs);
|
||||
|
||||
m_qtLibsWithDependencies = requiredLibraries(m_availableQtLibs, m_qtLibs, libs);
|
||||
QMetaObject::invokeMethod(this, "setQtLibs",Qt::BlockingQueuedConnection,
|
||||
Q_ARG(QStringList, requiredLibraries(m_availableQtLibs, m_qtLibs, libs)));
|
||||
Q_ARG(QStringList, m_qtLibsWithDependencies));
|
||||
|
||||
QMetaObject::invokeMethod(this, "getBundleInformation");
|
||||
|
||||
QStringList prebundledLibraries;
|
||||
foreach (const AndroidManager::Library &qtLib, m_availableQtLibs) {
|
||||
@@ -429,6 +445,176 @@ QVariantMap AndroidPackageCreationStep::toMap() const
|
||||
return map;
|
||||
}
|
||||
|
||||
QStringList AndroidPackageCreationStep::collectRelativeFilePaths(const QString &parentPath)
|
||||
{
|
||||
QStringList relativeFilePaths;
|
||||
|
||||
QDirIterator libsIt(parentPath, QDir::NoFilter, QDirIterator::Subdirectories);
|
||||
int pos = parentPath.size();
|
||||
while (libsIt.hasNext()) {
|
||||
libsIt.next();
|
||||
if (!libsIt.fileInfo().isDir())
|
||||
relativeFilePaths.append(libsIt.filePath().mid(pos));
|
||||
}
|
||||
|
||||
return relativeFilePaths;
|
||||
}
|
||||
|
||||
void AndroidPackageCreationStep::collectFiles(QList<DeployItem> *deployList,
|
||||
QList<DeployItem> *pluginsAndImportsList)
|
||||
{
|
||||
Q_ASSERT(deployList != 0);
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||
if (!version)
|
||||
return;
|
||||
|
||||
Qt4Project *project = static_cast<Qt4Project *>(target()->project());
|
||||
QString androidTargetArch = project->rootQt4ProjectNode()->singleVariableValue(Qt4ProjectManager::AndroidArchVar);
|
||||
|
||||
QString androidAssetsPath = m_androidDir.toString() + QLatin1String("/assets/");
|
||||
QString androidJarPath = m_androidDir.toString() + QLatin1String("/libs/");
|
||||
QString androidLibPath = m_androidDir.toString() + QLatin1String("/libs/") + androidTargetArch;
|
||||
|
||||
QString qtVersionSourcePath = version->sourcePath().toString();
|
||||
|
||||
foreach (QString qtLib, m_qtLibsWithDependencies) {
|
||||
QString fullPath = qtVersionSourcePath
|
||||
+ QLatin1String("/lib/lib")
|
||||
+ qtLib
|
||||
+ QLatin1String(".so");
|
||||
QString destinationPath = androidLibPath
|
||||
+ QLatin1String("/lib")
|
||||
+ qtLib
|
||||
+ QLatin1String(".so");
|
||||
|
||||
// If the Qt lib/ folder contains libgnustl_shared.so, don't deploy it from there, since
|
||||
// it will be deployed directly from the NDK instead.
|
||||
if (qtLib != QLatin1String("gnustl_shared")) {
|
||||
DeployItem deployItem(fullPath, 0, destinationPath, true);
|
||||
deployList->append(deployItem);
|
||||
}
|
||||
}
|
||||
|
||||
if (!androidTargetArch.isEmpty()) {
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||
if (tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE))
|
||||
return;
|
||||
|
||||
AndroidToolChain *atc = static_cast<AndroidToolChain *>(tc);
|
||||
|
||||
QString libgnustl = AndroidManager::libGnuStl(androidTargetArch, atc->ndkToolChainVersion());
|
||||
DeployItem deployItem(libgnustl, 0, androidLibPath + QLatin1String("/libgnustl_shared.so"), false);
|
||||
deployList->append(deployItem);
|
||||
}
|
||||
|
||||
foreach (QString jar, m_bundledJars) {
|
||||
QString fullPath = qtVersionSourcePath + QLatin1Char('/') + jar;
|
||||
QFileInfo fileInfo(fullPath);
|
||||
if (fileInfo.exists()) {
|
||||
QString destinationPath = androidJarPath
|
||||
+ AndroidManager::libraryPrefix()
|
||||
+ fileInfo.fileName();
|
||||
deployList->append(DeployItem(fullPath, 0, destinationPath, true));
|
||||
}
|
||||
}
|
||||
|
||||
QSet<QString> alreadyListed;
|
||||
foreach (QString bundledFile, m_otherBundledFiles) {
|
||||
if (!bundledFile.endsWith(QLatin1Char('/')))
|
||||
bundledFile.append(QLatin1Char('/'));
|
||||
|
||||
QStringList allFiles = collectRelativeFilePaths(qtVersionSourcePath + QLatin1Char('/') + bundledFile);
|
||||
foreach (QString file, allFiles) {
|
||||
QString fullPath = qtVersionSourcePath + QLatin1Char('/') + bundledFile + QLatin1Char('/') + file;
|
||||
if (alreadyListed.contains(fullPath))
|
||||
continue;
|
||||
|
||||
alreadyListed.insert(fullPath);
|
||||
|
||||
QString garbledFileName;
|
||||
QString destinationPath;
|
||||
bool shouldStrip = false;
|
||||
if (file.endsWith(QLatin1String(".so"))) {
|
||||
garbledFileName = QLatin1String("lib")
|
||||
+ AndroidManager::libraryPrefix()
|
||||
+ QString(bundledFile).replace(QLatin1Char('/'), QLatin1Char('_'))
|
||||
+ QString(file).replace(QLatin1Char('/'), QLatin1Char('_'));
|
||||
destinationPath = androidLibPath + QLatin1Char('/') + garbledFileName;
|
||||
shouldStrip = true;
|
||||
} else {
|
||||
garbledFileName = AndroidManager::libraryPrefix() + bundledFile + file;
|
||||
destinationPath = androidAssetsPath + garbledFileName;
|
||||
}
|
||||
|
||||
deployList->append(DeployItem(fullPath, 0, destinationPath, shouldStrip));
|
||||
pluginsAndImportsList->append(DeployItem(garbledFileName,
|
||||
0,
|
||||
bundledFile + file,
|
||||
shouldStrip));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidPackageCreationStep::removeManagedFilesFromPackage()
|
||||
{
|
||||
// Clean up all files managed by Qt Creator
|
||||
{
|
||||
QString androidLibPath = m_androidDir.toString() + QLatin1String("/libs/");
|
||||
QDirIterator dirIt(m_androidDir.toString(), QDirIterator::Subdirectories);
|
||||
while (dirIt.hasNext()) {
|
||||
dirIt.next();
|
||||
|
||||
if (!dirIt.fileInfo().isDir()) {
|
||||
bool isQtLibrary = dirIt.fileInfo().path().startsWith(androidLibPath)
|
||||
&& dirIt.fileName().startsWith(QLatin1String("libQt5"))
|
||||
&& dirIt.fileName().endsWith(QLatin1String(".so"));
|
||||
|
||||
if (dirIt.filePath().contains(AndroidManager::libraryPrefix()) || isQtLibrary)
|
||||
QFile::remove(dirIt.filePath());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidPackageCreationStep::copyFilesIntoPackage(const QList<DeployItem> &deployList)
|
||||
{
|
||||
foreach (DeployItem item, deployList) {
|
||||
QFileInfo info(item.remoteFileName);
|
||||
if (info.exists())
|
||||
QFile::remove(item.remoteFileName);
|
||||
else
|
||||
QDir().mkpath(info.absolutePath());
|
||||
|
||||
QFile::copy(item.localFileName, item.remoteFileName);
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidPackageCreationStep::stripFiles(const QList<DeployItem> &deployList)
|
||||
{
|
||||
|
||||
QStringList fileList;
|
||||
foreach (DeployItem item, deployList)
|
||||
if (item.needsStrip)
|
||||
fileList.append(item.remoteFileName);
|
||||
|
||||
ProjectExplorer::ToolChain *tc = ProjectExplorer::ToolChainKitInformation::toolChain(target()->kit());
|
||||
if (tc->type() != QLatin1String(Constants::ANDROID_TOOLCHAIN_TYPE))
|
||||
return;
|
||||
|
||||
AndroidToolChain *atc = static_cast<AndroidToolChain *>(tc);
|
||||
stripAndroidLibs(fileList,
|
||||
target()->activeRunConfiguration()->abi().architecture(),
|
||||
atc->ndkToolChainVersion());
|
||||
}
|
||||
|
||||
void AndroidPackageCreationStep::updateXmlForFiles(const QStringList &inLibList,
|
||||
const QStringList &inAssetsList)
|
||||
{
|
||||
AndroidManager::setBundledInLib(target(), inLibList);
|
||||
AndroidManager::setBundledInAssets(target(), inAssetsList);
|
||||
}
|
||||
|
||||
|
||||
bool AndroidPackageCreationStep::createPackage()
|
||||
{
|
||||
checkRequiredLibrariesForRun();
|
||||
@@ -451,6 +637,49 @@ bool AndroidPackageCreationStep::createPackage()
|
||||
build << QLatin1String("release");
|
||||
}
|
||||
|
||||
QList<DeployItem> deployFiles;
|
||||
QList<DeployItem> importsAndPlugins;
|
||||
|
||||
QtSupport::BaseQtVersion *version = QtSupport::QtKitInformation::qtVersion(target()->kit());
|
||||
|
||||
// Qt 5 supports bundling libraries inside the apk. We guard the code for Qt 5 to be sure we
|
||||
// do not disrupt existing projects.
|
||||
if (version && version->qtVersion() >= QtSupport::QtVersionNumber(5, 0, 0)) {
|
||||
bool bundleQt = AndroidManager::bundleQt(target());
|
||||
|
||||
// Collect the files to bundle in the package
|
||||
if (bundleQt)
|
||||
collectFiles(&deployFiles, &importsAndPlugins);
|
||||
|
||||
// Remove files from package if they are not needed
|
||||
removeManagedFilesFromPackage();
|
||||
|
||||
// Deploy files to package
|
||||
if (bundleQt) {
|
||||
copyFilesIntoPackage(deployFiles);
|
||||
stripFiles(deployFiles);
|
||||
|
||||
QStringList inLibList;
|
||||
QStringList inAssetsList;
|
||||
foreach (DeployItem deployItem, importsAndPlugins) {
|
||||
QString conversionInfo = deployItem.localFileName
|
||||
+ QLatin1Char(':')
|
||||
+ deployItem.remoteFileName;
|
||||
|
||||
if (deployItem.localFileName.endsWith(QLatin1String(".so")))
|
||||
inLibList.append(conversionInfo);
|
||||
else
|
||||
inAssetsList.append(conversionInfo);
|
||||
}
|
||||
|
||||
QMetaObject::invokeMethod(this,
|
||||
"updateXmlForFiles",
|
||||
Qt::BlockingQueuedConnection,
|
||||
Q_ARG(QStringList, inLibList),
|
||||
Q_ARG(QStringList, inAssetsList));
|
||||
}
|
||||
}
|
||||
|
||||
emit addOutput(tr("Creating package file ..."), MessageOutput);
|
||||
|
||||
QProcess *const buildProc = new QProcess;
|
||||
|
||||
@@ -45,6 +45,8 @@ QT_END_NAMESPACE
|
||||
namespace Android {
|
||||
namespace Internal {
|
||||
|
||||
class DeployItem;
|
||||
|
||||
class AndroidPackageCreationStep : public ProjectExplorer::BuildStep
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -82,6 +84,8 @@ private slots:
|
||||
void showInGraphicalShell();
|
||||
void setQtLibs(const QStringList &qtLibs);
|
||||
void setPrebundledLibs(const QStringList &prebundledLibs);
|
||||
void updateXmlForFiles(const QStringList &inLibList, const QStringList &inAssetsList);
|
||||
void getBundleInformation();
|
||||
|
||||
signals:
|
||||
void updateRequiredLibrariesModels();
|
||||
@@ -100,6 +104,12 @@ private:
|
||||
void raiseError(const QString &shortMsg,
|
||||
const QString &detailedMsg = QString());
|
||||
|
||||
QStringList collectRelativeFilePaths(const QString &parentPath);
|
||||
void collectFiles(QList<DeployItem> *deployList, QList<DeployItem> *pluginsAndImports);
|
||||
void removeManagedFilesFromPackage();
|
||||
void copyFilesIntoPackage(const QList<DeployItem> &deployList);
|
||||
void stripFiles(const QList<DeployItem> &deployList);
|
||||
|
||||
static const Core::Id CreatePackageId;
|
||||
|
||||
private:
|
||||
@@ -126,8 +136,13 @@ private:
|
||||
Utils::FileName m_appPath;
|
||||
Utils::FileName m_readElf;
|
||||
QStringList m_qtLibs;
|
||||
QStringList m_qtLibsWithDependencies;
|
||||
QVector<AndroidManager::Library> m_availableQtLibs;
|
||||
QStringList m_prebundledLibs;
|
||||
|
||||
QStringList m_bundledJars;
|
||||
QStringList m_otherBundledFiles;
|
||||
bool m_bundleQt;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
||||
@@ -386,24 +386,16 @@ void AndroidPackageCreationWidget::setQtLibs(QModelIndex, QModelIndex)
|
||||
{
|
||||
AndroidManager::setQtLibs(m_step->target(), m_qtLibsModel->checkedItems());
|
||||
AndroidDeployStep * const deployStep = AndroidGlobal::buildStep<AndroidDeployStep>(m_step->target()->activeDeployConfiguration());
|
||||
if (deployStep->useLocalQtLibs()) {
|
||||
// ### Passes -1 for API level, which means it won't work with setups that require
|
||||
// library selection based on API level. Use the old approach (command line argument)
|
||||
// in these cases.
|
||||
AndroidManager::setUseLocalLibs(m_step->target(), true, -1);
|
||||
}
|
||||
if (deployStep->useLocalQtLibs())
|
||||
AndroidManager::updateDeploymentSettings(m_step->target());
|
||||
}
|
||||
|
||||
void AndroidPackageCreationWidget::setPrebundledLibs(QModelIndex, QModelIndex)
|
||||
{
|
||||
AndroidManager::setPrebundledLibs(m_step->target(), m_prebundledLibs->checkedItems());
|
||||
AndroidDeployStep * const deployStep = AndroidGlobal::buildStep<AndroidDeployStep>(m_step->target()->activeDeployConfiguration());
|
||||
if (deployStep->useLocalQtLibs()) {
|
||||
// ### Passes -1 for API level, which means it won't work with setups that require
|
||||
// library selection based on API level. Use the old approach (command line argument)
|
||||
// in these cases.
|
||||
AndroidManager::setUseLocalLibs(m_step->target(), true, -1);
|
||||
}
|
||||
if (deployStep->useLocalQtLibs())
|
||||
AndroidManager::updateDeploymentSettings(m_step->target());
|
||||
}
|
||||
|
||||
void AndroidPackageCreationWidget::prebundledLibSelected(const QModelIndex &index)
|
||||
|
||||
@@ -266,6 +266,7 @@ CMakeOpenProjectWizard::CMakeOpenProjectWizard(CMakeManager *cmakeManager, CMake
|
||||
void CMakeOpenProjectWizard::init()
|
||||
{
|
||||
setOption(QWizard::NoBackButtonOnStartPage);
|
||||
setOption(QWizard::NoCancelButton, false);
|
||||
setWindowTitle(tr("CMake Wizard"));
|
||||
}
|
||||
|
||||
|
||||
@@ -615,7 +615,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
||||
targetCoN = targetContext.globalNamespace();
|
||||
UseMinimalNames q(targetCoN);
|
||||
env.enter(&q);
|
||||
Control *control = sourceContext.control().data();
|
||||
Control *control = sourceContext.bindings()->control().data();
|
||||
|
||||
// get return type start position and declarator info from declaration
|
||||
DeclaratorAST *declarator = 0;
|
||||
@@ -661,7 +661,7 @@ Utils::ChangeSet FunctionDeclDefLink::changes(const Snapshot &snapshot, int targ
|
||||
targetCoN = targetContext.globalNamespace();
|
||||
UseMinimalNames q(targetCoN);
|
||||
env.enter(&q);
|
||||
Control *control = sourceContext.control().data();
|
||||
Control *control = sourceContext.bindings()->control().data();
|
||||
Overview overview = overviewFromCurrentProjectStyle;
|
||||
|
||||
// make a easy to access list of the target parameter declarations
|
||||
|
||||
@@ -1177,7 +1177,7 @@ void TranslateStringLiteral::match(const CppQuickFixInterface &interface,
|
||||
|
||||
QString trContext;
|
||||
|
||||
QSharedPointer<Control> control = interface->context().control();
|
||||
QSharedPointer<Control> control = interface->context().bindings()->control();
|
||||
const Name *trName = control->identifier("tr");
|
||||
|
||||
// Check whether we are in a method:
|
||||
@@ -1597,7 +1597,7 @@ public:
|
||||
UseMinimalNames q(con);
|
||||
env.enter(&q);
|
||||
|
||||
Control *control = assistInterface()->context().control().data();
|
||||
Control *control = assistInterface()->context().bindings()->control().data();
|
||||
FullySpecifiedType tn = rewriteType(result.first().type(), &env, control);
|
||||
|
||||
Overview oo = CppCodeStyleSettings::currentProjectCodeStyleOverview();
|
||||
@@ -2557,7 +2557,7 @@ public:
|
||||
env.switchScope(m_decl->enclosingScope());
|
||||
UseMinimalNames q(targetCoN);
|
||||
env.enter(&q);
|
||||
Control *control = assistInterface()->context().control().data();
|
||||
Control *control = assistInterface()->context().bindings()->control().data();
|
||||
|
||||
// rewrite the function type
|
||||
const FullySpecifiedType tn = rewriteType(m_decl->type(), &env, control);
|
||||
@@ -3017,7 +3017,7 @@ public:
|
||||
env.enter(&subs);
|
||||
|
||||
Overview printer = CppCodeStyleSettings::currentProjectCodeStyleOverview();
|
||||
Control *control = assistInterface()->context().control().data();
|
||||
Control *control = assistInterface()->context().bindings()->control().data();
|
||||
QString funcDef;
|
||||
QString funcDecl; // We generate a declaration only in the case of a member function.
|
||||
QString funcCall;
|
||||
@@ -3739,7 +3739,7 @@ QString getDefinitionSignature(const CppQuickFixAssistInterface *assist, Functio
|
||||
env.switchScope(func->enclosingScope());
|
||||
UseMinimalNames q(cppCoN);
|
||||
env.enter(&q);
|
||||
Control *control = assist->context().control().data();
|
||||
Control *control = assist->context().bindings()->control().data();
|
||||
Overview oo = CppCodeStyleSettings::currentProjectCodeStyleOverview();
|
||||
oo.showFunctionSignatures = true;
|
||||
oo.showReturnTypes = true;
|
||||
@@ -4151,7 +4151,7 @@ public:
|
||||
UseMinimalNames q(con);
|
||||
env.enter(&q);
|
||||
|
||||
Control *control = assistInterface()->context().control().data();
|
||||
Control *control = assistInterface()->context().bindings()->control().data();
|
||||
FullySpecifiedType type = rewriteType(result.first().type(), &env, control);
|
||||
|
||||
Overview oo = CppCodeStyleSettings::currentProjectCodeStyleOverview();
|
||||
@@ -4638,7 +4638,7 @@ public:
|
||||
env.switchScope(targetClass);
|
||||
UseMinimalNames q(targetCoN);
|
||||
env.enter(&q);
|
||||
Control *control = assistInterface()->context().control().data();
|
||||
Control *control = assistInterface()->context().bindings()->control().data();
|
||||
const QString fullClassName = printer.prettyName(LookupContext::minimalName(
|
||||
targetClass, targetCoN, control));
|
||||
|
||||
@@ -4708,7 +4708,7 @@ public:
|
||||
env.switchScope(decl->enclosingScope());
|
||||
UseMinimalNames q(targetCoN);
|
||||
env.enter(&q);
|
||||
Control *control = assistInterface()->context().control().data();
|
||||
Control *control = assistInterface()->context().bindings()->control().data();
|
||||
|
||||
// rewrite the function type and name + create definition
|
||||
const FullySpecifiedType type = rewriteType(decl->type(), &env, control);
|
||||
|
||||
@@ -1768,7 +1768,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
||||
}
|
||||
|
||||
if (functions.isEmpty()) {
|
||||
const Name *functionCallOp = context.control()->operatorNameId(OperatorNameId::FunctionCallOp);
|
||||
const Name *functionCallOp = context.bindings()->control()->operatorNameId(OperatorNameId::FunctionCallOp);
|
||||
|
||||
foreach (const LookupItem &result, results) {
|
||||
FullySpecifiedType ty = result.type().simplified();
|
||||
@@ -1863,7 +1863,7 @@ bool CppCompletionAssistProcessor::completeConstructorOrFunction(const QList<CPl
|
||||
targetCoN = context.globalNamespace();
|
||||
UseMinimalNames q(targetCoN);
|
||||
env.enter(&q);
|
||||
Control *control = context.control().data();
|
||||
Control *control = context.bindings()->control().data();
|
||||
|
||||
// set up signature autocompletion
|
||||
foreach (Function *f, functions) {
|
||||
|
||||
@@ -1160,14 +1160,6 @@ void BreakHandler::saveSessionData()
|
||||
}
|
||||
|
||||
void BreakHandler::loadSessionData()
|
||||
{
|
||||
beginResetModel();
|
||||
m_storage.clear();
|
||||
endResetModel();
|
||||
loadBreakpoints();
|
||||
}
|
||||
|
||||
void BreakHandler::removeSessionData()
|
||||
{
|
||||
beginResetModel();
|
||||
Iterator it = m_storage.begin(), et = m_storage.end();
|
||||
@@ -1175,6 +1167,7 @@ void BreakHandler::removeSessionData()
|
||||
it->destroyMarker();
|
||||
m_storage.clear();
|
||||
endResetModel();
|
||||
loadBreakpoints();
|
||||
}
|
||||
|
||||
void BreakHandler::breakByFunction(const QString &functionName)
|
||||
|
||||
@@ -58,7 +58,6 @@ public:
|
||||
|
||||
void loadSessionData();
|
||||
void saveSessionData();
|
||||
void removeSessionData();
|
||||
|
||||
QAbstractItemModel *model() { return this; }
|
||||
|
||||
|
||||
@@ -1786,7 +1786,10 @@ void DebuggerPluginPrivate::attachToQmlPort()
|
||||
foreach (Project *project, projects)
|
||||
sourceFiles << project->files(Project::ExcludeGeneratedFiles);
|
||||
|
||||
sp.projectSourceDirectory =
|
||||
!projects.isEmpty() ? projects.first()->projectDirectory() : QString();
|
||||
sp.projectSourceFiles = sourceFiles;
|
||||
sp.sysRoot = SysRootKitInformation::sysRoot(kit).toString();
|
||||
DebuggerRunControlFactory::createAndScheduleRun(sp);
|
||||
}
|
||||
|
||||
@@ -2458,7 +2461,6 @@ void DebuggerPluginPrivate::sessionLoaded()
|
||||
|
||||
void DebuggerPluginPrivate::aboutToUnloadSession()
|
||||
{
|
||||
m_breakHandler->removeSessionData();
|
||||
m_toolTipManager->sessionAboutToChange();
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,8 @@ QByteArray LocalGdbProcess::readAllStandardError()
|
||||
|
||||
void LocalGdbProcess::start(const QString &cmd, const QStringList &args)
|
||||
{
|
||||
m_gdbProc.start(cmd, args);
|
||||
m_gdbProc.setCommand(cmd, Utils::QtcProcess::joinArgs(args));
|
||||
m_gdbProc.start();
|
||||
}
|
||||
|
||||
bool LocalGdbProcess::waitForStarted()
|
||||
@@ -92,6 +93,18 @@ bool LocalGdbProcess::interrupt()
|
||||
return interruptProcess(pid, GdbEngineType, &m_errorString);
|
||||
}
|
||||
|
||||
#ifdef Q_OS_WIN
|
||||
void LocalGdbProcess::setUseCtrlCStub(bool enable)
|
||||
{
|
||||
m_gdbProc.setUseCtrlCStub(enable);
|
||||
}
|
||||
|
||||
void LocalGdbProcess::winInterruptByCtrlC()
|
||||
{
|
||||
m_gdbProc.interrupt();
|
||||
}
|
||||
#endif
|
||||
|
||||
QProcess::ProcessState LocalGdbProcess::state() const
|
||||
{
|
||||
return m_gdbProc.state();
|
||||
@@ -114,7 +127,7 @@ void LocalGdbProcess::setProcessEnvironment(const QProcessEnvironment &env)
|
||||
|
||||
void LocalGdbProcess::setEnvironment(const QStringList &env)
|
||||
{
|
||||
m_gdbProc.setEnvironment(env);
|
||||
m_gdbProc.setEnvironment(Utils::Environment(env));
|
||||
}
|
||||
|
||||
void LocalGdbProcess::setWorkingDirectory(const QString &dir)
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
#include "abstractgdbprocess.h"
|
||||
|
||||
#include <utils/qtcprocess.h>
|
||||
|
||||
namespace Debugger {
|
||||
namespace Internal {
|
||||
|
||||
@@ -48,6 +50,10 @@ public:
|
||||
virtual qint64 write(const QByteArray &data);
|
||||
virtual void kill();
|
||||
virtual bool interrupt();
|
||||
#ifdef Q_OS_WIN
|
||||
void setUseCtrlCStub(bool enable);
|
||||
void winInterruptByCtrlC();
|
||||
#endif
|
||||
|
||||
virtual QProcess::ProcessState state() const;
|
||||
virtual QString errorString() const;
|
||||
@@ -58,7 +64,7 @@ public:
|
||||
virtual void setWorkingDirectory(const QString &dir);
|
||||
|
||||
private:
|
||||
QProcess m_gdbProc;
|
||||
Utils::QtcProcess m_gdbProc;
|
||||
QString m_errorString;
|
||||
};
|
||||
|
||||
|
||||
@@ -60,6 +60,9 @@ GdbRemoteServerEngine::GdbRemoteServerEngine(const DebuggerStartParameters &star
|
||||
{
|
||||
m_isMulti = false;
|
||||
m_targetPid = -1;
|
||||
#ifdef Q_OS_WIN
|
||||
m_gdbProc.setUseCtrlCStub(!startParameters.remoteExecutable.isEmpty()); // This is only set for QNX
|
||||
#endif
|
||||
connect(&m_uploadProc, SIGNAL(error(QProcess::ProcessError)),
|
||||
SLOT(uploadProcError(QProcess::ProcessError)));
|
||||
connect(&m_uploadProc, SIGNAL(readyReadStandardOutput()),
|
||||
@@ -430,6 +433,10 @@ void GdbRemoteServerEngine::interruptInferior2()
|
||||
if (debuggerCore()->boolSetting(TargetAsync)) {
|
||||
postCommand("-exec-interrupt", GdbEngine::Immediate,
|
||||
CB(handleInterruptInferior));
|
||||
#ifdef Q_OS_WIN
|
||||
} else if (m_isQnxGdb) {
|
||||
m_gdbProc.winInterruptByCtrlC();
|
||||
#endif
|
||||
} else {
|
||||
bool ok = m_gdbProc.interrupt();
|
||||
if (!ok) {
|
||||
|
||||
@@ -1761,6 +1761,11 @@ void FakeVimPluginPrivate::handleExCommand(bool *handled, const ExCommand &cmd)
|
||||
if (!handler)
|
||||
return;
|
||||
|
||||
// Focus editor first so actions can be executed in correct context.
|
||||
QWidget *editor = handler->widget();
|
||||
if (editor)
|
||||
editor->setFocus();
|
||||
|
||||
*handled = true;
|
||||
if (cmd.matches(_("w"), _("write")) || cmd.cmd == _("wq")) {
|
||||
// :w[rite]
|
||||
|
||||
@@ -70,6 +70,7 @@ public:
|
||||
QString category() const;
|
||||
QIcon dragIcon() const;
|
||||
QString qml() const;
|
||||
QString qmlSource() const;
|
||||
QString requiredImport() const;
|
||||
bool forceImport() const;
|
||||
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
|
||||
#include <QSharedData>
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
|
||||
namespace QmlDesigner {
|
||||
|
||||
namespace Internal {
|
||||
@@ -51,6 +53,7 @@ public:
|
||||
QIcon dragIcon;
|
||||
QList<PropertyContainer> properties;
|
||||
QString qml;
|
||||
QString qmlSource;
|
||||
QString requiredImport;
|
||||
bool forceImport;
|
||||
};
|
||||
@@ -123,6 +126,11 @@ QString ItemLibraryEntry::qml() const
|
||||
return m_data->qml;
|
||||
}
|
||||
|
||||
QString ItemLibraryEntry::qmlSource() const
|
||||
{
|
||||
return m_data->qmlSource;
|
||||
}
|
||||
|
||||
QString ItemLibraryEntry::requiredImport() const
|
||||
{
|
||||
return m_data->requiredImport;
|
||||
@@ -180,9 +188,22 @@ void ItemLibraryEntry::setIconPath(const QString &iconPath)
|
||||
m_data->iconPath = iconPath;
|
||||
}
|
||||
|
||||
static QString getSourceForUrl(const QString &fileURl)
|
||||
{
|
||||
Utils::FileReader fileReader;
|
||||
|
||||
if (fileReader.fetch(fileURl)) {
|
||||
return fileReader.data();
|
||||
} else {
|
||||
return Utils::FileReader::fetchQrc(fileURl);
|
||||
}
|
||||
}
|
||||
|
||||
void ItemLibraryEntry::setQml(const QString &qml)
|
||||
{
|
||||
m_data->qml = qml;
|
||||
|
||||
m_data->qmlSource = getSourceForUrl(qml);
|
||||
}
|
||||
|
||||
void ItemLibraryEntry::setRequiredImport(const QString &requiredImport)
|
||||
@@ -217,6 +238,7 @@ QDataStream& operator<<(QDataStream& stream, const ItemLibraryEntry &itemLibrary
|
||||
|
||||
stream << itemLibraryEntry.m_data->properties;
|
||||
stream << itemLibraryEntry.m_data->qml;
|
||||
stream << itemLibraryEntry.m_data->qmlSource;
|
||||
|
||||
return stream;
|
||||
}
|
||||
@@ -236,6 +258,7 @@ QDataStream& operator>>(QDataStream& stream, ItemLibraryEntry &itemLibraryEntry)
|
||||
|
||||
stream >> itemLibraryEntry.m_data->properties;
|
||||
stream >> itemLibraryEntry.m_data->qml;
|
||||
stream >> itemLibraryEntry.m_data->qmlSource;
|
||||
|
||||
return stream;
|
||||
}
|
||||
@@ -255,6 +278,7 @@ QDebug operator<<(QDebug debug, const ItemLibraryEntry &itemLibraryEntry)
|
||||
|
||||
debug << itemLibraryEntry.m_data->properties;
|
||||
debug << itemLibraryEntry.m_data->qml;
|
||||
debug << itemLibraryEntry.m_data->qmlSource;
|
||||
|
||||
return debug.space();
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ void MetaInfoReader::readPropertyProperty(const QString &name, const QVariant &v
|
||||
void MetaInfoReader::readQmlSourceProperty(const QString &name, const QVariant &value)
|
||||
{
|
||||
if (name == QLatin1String("source")) {
|
||||
m_currentEntry.setQml(value.toString());
|
||||
m_currentEntry.setQml(absoluteFilePathForDocument(value.toString()));
|
||||
} else {
|
||||
addError(tr("Unknown property for QmlSource %1").arg(name), currentSourceLocation());
|
||||
setParserState(Error);
|
||||
|
||||
@@ -233,7 +233,7 @@ QmlItemNode QmlModelView::createQmlItemNode(const ItemLibraryEntry &itemLibraryE
|
||||
QPlainTextEdit textEdit;
|
||||
|
||||
|
||||
textEdit.setPlainText(Utils::FileReader::fetchQrc(itemLibraryEntry.qml()));
|
||||
textEdit.setPlainText(itemLibraryEntry.qmlSource());
|
||||
NotIndentingTextEditModifier modifier(&textEdit);
|
||||
|
||||
QScopedPointer<RewriterView> rewriterView(new RewriterView(RewriterView::Amend, 0));
|
||||
|
||||
@@ -963,8 +963,11 @@ QString QmlOutlineModel::getAnnotation(AST::ExpressionNode *expression)
|
||||
if (!expression)
|
||||
return QString();
|
||||
QString source = m_semanticInfo.document->source();
|
||||
return source.mid(expression->firstSourceLocation().begin(),
|
||||
expression->lastSourceLocation().end() - expression->firstSourceLocation().begin());
|
||||
QString str = source.mid(expression->firstSourceLocation().begin(),
|
||||
expression->lastSourceLocation().end()
|
||||
- expression->firstSourceLocation().begin());
|
||||
// only show first line
|
||||
return str.left(str.indexOf(QLatin1Char('\n')));
|
||||
}
|
||||
|
||||
QHash<QString,QString> QmlOutlineModel::getScriptBindings(AST::UiObjectInitializer *objectInitializer) {
|
||||
|
||||
@@ -140,6 +140,12 @@ void QmlProject::addedTarget(ProjectExplorer::Target *target)
|
||||
addedRunConfiguration(rc);
|
||||
}
|
||||
|
||||
void QmlProject::onActiveTargetChanged(ProjectExplorer::Target * /*target*/)
|
||||
{
|
||||
// make sure e.g. the default qml imports are adapted
|
||||
refresh(Configuration);
|
||||
}
|
||||
|
||||
void QmlProject::addedRunConfiguration(ProjectExplorer::RunConfiguration *rc)
|
||||
{
|
||||
// The enabled state of qml runconfigurations can only be decided after
|
||||
@@ -401,6 +407,9 @@ bool QmlProject::fromMap(const QVariantMap &map)
|
||||
connect(this, SIGNAL(addedTarget(ProjectExplorer::Target*)),
|
||||
this, SLOT(addedTarget(ProjectExplorer::Target*)));
|
||||
|
||||
connect(this, SIGNAL(activeTargetChanged(ProjectExplorer::Target*)),
|
||||
this, SLOT(onActiveTargetChanged(ProjectExplorer::Target*)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -98,6 +98,7 @@ public:
|
||||
private slots:
|
||||
void refreshFiles(const QSet<QString> &added, const QSet<QString> &removed);
|
||||
void addedTarget(ProjectExplorer::Target *target);
|
||||
void onActiveTargetChanged(ProjectExplorer::Target *target);
|
||||
void addedRunConfiguration(ProjectExplorer::RunConfiguration *);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -31,6 +31,11 @@
|
||||
|
||||
#include "qnxdeviceconfiguration.h"
|
||||
|
||||
#include <projectexplorer/devicesupport/sshdeviceprocesslist.h>
|
||||
|
||||
#include <QRegExp>
|
||||
#include <QStringList>
|
||||
|
||||
using namespace Qnx;
|
||||
using namespace Qnx::Internal;
|
||||
|
||||
@@ -85,6 +90,51 @@ class QnxPortsGatheringMethod : public ProjectExplorer::PortsGatheringMethod
|
||||
}
|
||||
};
|
||||
|
||||
class QnxDeviceProcessList : public ProjectExplorer::SshDeviceProcessList
|
||||
{
|
||||
public:
|
||||
QnxDeviceProcessList(const ProjectExplorer::IDevice::ConstPtr &device, QObject *parent)
|
||||
: SshDeviceProcessList(device, parent)
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
QString listProcessesCommandLine() const
|
||||
{
|
||||
return QLatin1String("pidin -F \"%a %A '/%n'\"");
|
||||
}
|
||||
|
||||
QList<ProjectExplorer::DeviceProcess> buildProcessList(const QString &listProcessesReply) const
|
||||
{
|
||||
QList<ProjectExplorer::DeviceProcess> processes;
|
||||
QStringList lines = listProcessesReply.split(QLatin1Char('\n'));
|
||||
if (lines.isEmpty())
|
||||
return processes;
|
||||
|
||||
lines.pop_front(); // drop headers
|
||||
QRegExp re(QLatin1String("\\s*(\\d+)\\s+(.*)'(.*)'"));
|
||||
|
||||
foreach (const QString& line, lines) {
|
||||
if (re.exactMatch(line)) {
|
||||
const QStringList captures = re.capturedTexts();
|
||||
if (captures.size() == 4) {
|
||||
const int pid = captures[1].toInt();
|
||||
const QString args = captures[2];
|
||||
const QString exe = captures[3];
|
||||
ProjectExplorer::DeviceProcess deviceProcess;
|
||||
deviceProcess.pid = pid;
|
||||
deviceProcess.exe = exe.trimmed();
|
||||
deviceProcess.cmdLine = args.trimmed();
|
||||
processes.append(deviceProcess);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
qSort(processes);
|
||||
return processes;
|
||||
}
|
||||
};
|
||||
|
||||
QnxDeviceConfiguration::QnxDeviceConfiguration()
|
||||
: RemoteLinux::LinuxDevice()
|
||||
{
|
||||
@@ -130,3 +180,8 @@ ProjectExplorer::PortsGatheringMethod::Ptr QnxDeviceConfiguration::portsGatherin
|
||||
{
|
||||
return ProjectExplorer::PortsGatheringMethod::Ptr(new QnxPortsGatheringMethod);
|
||||
}
|
||||
|
||||
ProjectExplorer::DeviceProcessList *QnxDeviceConfiguration::createProcessListModel(QObject *parent) const
|
||||
{
|
||||
return new QnxDeviceProcessList(sharedFromThis(), parent);
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ public:
|
||||
|
||||
ProjectExplorer::DeviceProcessSupport::Ptr processSupport() const;
|
||||
ProjectExplorer::PortsGatheringMethod::Ptr portsGatheringMethod() const;
|
||||
bool canCreateProcessModel() const { return false; } // Override LinuxDevice implementation.
|
||||
ProjectExplorer::DeviceProcessList *createProcessListModel(QObject *parent) const;
|
||||
|
||||
QString displayType() const;
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ DebuggerStartParameters createStartParameters(const QnxRunConfiguration *runConf
|
||||
params.remoteChannel = device->sshParameters().host + QLatin1String(":-1");
|
||||
params.displayName = runConfig->displayName();
|
||||
params.remoteSetupNeeded = true;
|
||||
params.closeMode = DetachAtClose;
|
||||
params.closeMode = KillAtClose;
|
||||
params.processArgs = runConfig->arguments();
|
||||
|
||||
Debugger::DebuggerRunConfigurationAspect *aspect
|
||||
|
||||
@@ -175,7 +175,7 @@ void tst_cxx11::inlineNamespaceLookup()
|
||||
snapshot.insert(doc);
|
||||
|
||||
LookupContext context(doc, snapshot);
|
||||
QSharedPointer<Control> control = context.control();
|
||||
QSharedPointer<Control> control = context.bindings()->control();
|
||||
|
||||
QList<LookupItem> results = context.lookup(control->identifier("foo"), doc->globalNamespace());
|
||||
QCOMPARE(results.size(), 1); // the symbol is visible from the global scope
|
||||
|
||||
@@ -138,6 +138,8 @@
|
||||
:Restart required_QMessageBox {text='The language change will take effect after a restart of Qt Creator.' type='QMessageBox' unnamed='1' visible='1'}
|
||||
:Revert to Saved.Proceed_QPushButton {text='Proceed' type='QPushButton' unnamed='1' visible='1' window=':Revert to Saved_QMessageBox'}
|
||||
:Revert to Saved_QMessageBox {text?='You will lose your current changes if you proceed reverting*' type='QMessageBox' unnamed='1' visible='1'}
|
||||
: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'}
|
||||
:Startup.contextHelpComboBox_QComboBox {container=':Form.Startup_QGroupBox' name='contextHelpComboBox' type='QComboBox' visible='1'}
|
||||
:Symbol Server_Utils::CheckableMessageBox {type='Utils::CheckableMessageBox' unnamed='1' visible='1' windowTitle='Symbol Server'}
|
||||
:User Interface.languageBox_QComboBox {container=':Core__Internal__GeneralSettings.User Interface_QGroupBox' name='languageBox' type='QComboBox' visible='1'}
|
||||
|
||||
@@ -47,6 +47,8 @@ def menuVisibleAtEditor(editor, menuInList):
|
||||
menuInList[0] = None
|
||||
try:
|
||||
menu = waitForObject("{type='QMenu' unnamed='1' visible='1'}", 500)
|
||||
if platform.system() == 'Darwin':
|
||||
menu.activateWindow()
|
||||
success = menu.visible and widgetContainsPoint(editor, menu.mapToGlobal(QPoint(0, 0)))
|
||||
if success:
|
||||
menuInList[0] = menu
|
||||
|
||||
@@ -17,9 +17,7 @@ def modifyRunSettingsForHookInto(projectName, kitCount, port):
|
||||
switchToBuildOrRunSettingsFor(kitCount, 0, ProjectSettings.RUN)
|
||||
result = __configureCustomExecutable__(projectName, port, mkspec, qtVersion)
|
||||
if result:
|
||||
clickButton(waitForObject("{window=':Qt Creator_Core::Internal::MainWindow' text='Details' "
|
||||
"type='Utils::DetailsButton' unnamed='1' visible='1' "
|
||||
"leftWidget={type='QLabel' text~='Us(e|ing) <b>Build Environment</b>' unnamed='1' visible='1'}}"))
|
||||
ensureChecked(":RunSettingsEnvironmentDetails_Utils::DetailsButton")
|
||||
envVarsTableView = waitForObject("{type='QTableView' visible='1' unnamed='1'}")
|
||||
model = envVarsTableView.model()
|
||||
changingVars = []
|
||||
@@ -41,16 +39,22 @@ def modifyRunSettingsForHookInto(projectName, kitCount, port):
|
||||
changingVars.append("SQUISH_LIBQTDIR=%s" % replacement)
|
||||
else:
|
||||
changingVars.append(varName)
|
||||
#test.log("Unsetting %s for run" % varName)
|
||||
batchEditRunEnvironment(kitCount, 0, changingVars, True)
|
||||
switchViewTo(ViewConstants.EDIT)
|
||||
return result
|
||||
|
||||
def batchEditRunEnvironment(kitCount, currentTarget, modifications, alreadyOnRunSettings=False):
|
||||
if not alreadyOnRunSettings:
|
||||
switchViewTo(ViewConstants.PROJECTS)
|
||||
switchToBuildOrRunSettingsFor(kitCount, currentTarget, ProjectSettings.RUN)
|
||||
ensureChecked(":RunSettingsEnvironmentDetails_Utils::DetailsButton")
|
||||
clickButton(waitForObject("{text='Batch Edit...' type='QPushButton' unnamed='1' visible='1' "
|
||||
"window=':Qt Creator_Core::Internal::MainWindow'}"))
|
||||
editor = waitForObject("{type='TextEditor::SnippetEditorWidget' unnamed='1' visible='1' "
|
||||
"window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}")
|
||||
typeLines(editor, changingVars)
|
||||
typeLines(editor, modifications)
|
||||
clickButton(waitForObject("{text='OK' type='QPushButton' unnamed='1' visible='1' "
|
||||
"window=':Edit Environment_ProjectExplorer::EnvironmentItemsDialog'}"))
|
||||
switchViewTo(ViewConstants.EDIT)
|
||||
return result
|
||||
|
||||
def modifyRunSettingsForHookIntoQtQuickUI(kitCount, workingDir, projectName, port):
|
||||
switchViewTo(ViewConstants.PROJECTS)
|
||||
|
||||
@@ -9,7 +9,7 @@ def verifyBuildAndRun():
|
||||
# check application output log
|
||||
appOutput = logApplicationOutput()
|
||||
if appOutput:
|
||||
test.verify(re.search(".*([Pp]rogram).*(unexpectedly).*([Ff]inished).*", str(appOutput)) and
|
||||
test.verify(re.search(".* exited with code \d+", str(appOutput)) and
|
||||
re.search('[Ss]tarting.*', str(appOutput)),
|
||||
"Verifying if built app started and closed successfully.")
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ def main():
|
||||
invokeMenuItem("File", "Exit")
|
||||
return
|
||||
# wait until search finished and verify search results
|
||||
waitFor("searchFinished")
|
||||
waitFor("searchFinished", 20000)
|
||||
validateSearchResult(18)
|
||||
result = re.search("QmlApplicationViewer", str(editorWidget.plainText))
|
||||
test.verify(result, "Verifying if: The list of all usages of the selected text is displayed in Search Results. "
|
||||
@@ -49,7 +49,7 @@ def main():
|
||||
searchFinished = False
|
||||
type(editorWidget, "<Ctrl+Shift+U>")
|
||||
# wait until search finished and verify search results
|
||||
waitFor("searchFinished")
|
||||
waitFor("searchFinished", 20000)
|
||||
validateSearchResult(3)
|
||||
# exit qt creator
|
||||
invokeMenuItem("File", "Save All")
|
||||
|
||||
@@ -16,9 +16,7 @@ def getQtCreatorVersionFromDialog():
|
||||
def getQtCreatorVersionFromFile():
|
||||
qtCreatorPriFileName = "../../../../qtcreator.pri"
|
||||
# open file <qtCreatorPriFileName> and read version
|
||||
file = open(qtCreatorPriFileName, "r")
|
||||
fileText = file.read()
|
||||
file.close()
|
||||
fileText = readFile(qtCreatorPriFileName)
|
||||
chk = re.search("(?<=QTCREATOR_VERSION =)\s\d+.\d+.\d+", fileText)
|
||||
try:
|
||||
ver = chk.group(0).strip()
|
||||
|
||||
@@ -2,13 +2,6 @@ source("../../shared/qtcreator.py")
|
||||
|
||||
# This tests for QTCREATORBUG-5757
|
||||
|
||||
# Results can differ from actual size on disk (different line endings on Windows)
|
||||
def charactersInFile(filename):
|
||||
f = open(filename,"r")
|
||||
content = f.read()
|
||||
f.close()
|
||||
return len(content)
|
||||
|
||||
def main():
|
||||
files = map(lambda record: os.path.join(srcPath, testData.field(record, "filename")),
|
||||
testData.dataset("files.tsv"))
|
||||
@@ -21,7 +14,7 @@ def main():
|
||||
return
|
||||
for currentFile in files:
|
||||
test.log("Opening file %s" % currentFile)
|
||||
size = charactersInFile(currentFile)
|
||||
size = len(readFile(currentFile))
|
||||
invokeMenuItem("File", "Open File or Project...")
|
||||
selectFromFileDialog(currentFile, True)
|
||||
editor = getEditorForFileSuffix(currentFile)
|
||||
|
||||