Merge remote-tracking branch 'origin/3.1'
Conflicts: src/plugins/cmakeprojectmanager/cmakeopenprojectwizard.cpp Change-Id: Icce6e8dd9b3afd9a0fe836e9babfb7a17cee9c4d
@@ -6,7 +6,7 @@ Supported Platforms
|
||||
===================
|
||||
The standalone binary packages support the following platforms:
|
||||
|
||||
Windows XP SP2 or later
|
||||
Windows XP SP3 or later
|
||||
(K)Ubuntu Linux 11.10 (32-bit and 64-bit) or later
|
||||
Mac OS X 10.7 or later
|
||||
|
||||
@@ -50,28 +50,19 @@ dependency to the exact Qt version it was compiled with. Running Qt Creator
|
||||
against updated Qt libraries (also for patch releases) might lead to link time
|
||||
failures, or even crashes.
|
||||
|
||||
If you want to disable the plugins on Linux and Mac OS X, you can pass
|
||||
"QT_PRIVATE_HEADERS=" to qmake:
|
||||
To disable the plugins, pass "QT_PRIVATE_HEADERS=" to qmake:
|
||||
|
||||
qmake "QT_PRIVATE_HEADERS=" $SOURCE_DIRECTORY/qtcreator.pro
|
||||
|
||||
The plugins are also automatically omitted if the private header files are
|
||||
not found. This might be the case when you use a Qt version from your
|
||||
distribution, or installed a self-compiled Qt to a separate directory via
|
||||
'make install'. You can fix this by either re-building your Qt with the
|
||||
"-developer-build" configure option, or by passing the include directory in
|
||||
the source directory to qmake. For example:
|
||||
|
||||
qmake "QT_PRIVATE_HEADERS=$$QT_BUILD_TREE/include" $SOURCE_DIRECTORY/qtcreator.pro
|
||||
|
||||
|
||||
Compiling Qt and Qt Creator on Windows
|
||||
--------------------------------------
|
||||
|
||||
This section provides step by step instructions for compiling the latest
|
||||
versions of Qt and Qt Creator on Windows. Alternatively, to avoid having to
|
||||
compile Qt yourself, you can use one of the versions of Qt shipped with the Qt
|
||||
SDK (release builds of Qt using MinGW and Visual C++ 2008).
|
||||
SDK (release builds of Qt using MinGW and Visual C++ 2010 or later).
|
||||
For detailed information on the supported compilers, see
|
||||
http://qt-project.org/wiki/Building_Qt_5_from_Git .
|
||||
|
||||
1. Decide which compiler to use: MinGW or Microsoft Visual Studio. If you
|
||||
plan to contribute to Qt Creator, you should compile your changes with
|
||||
@@ -86,22 +77,24 @@ SDK (release builds of Qt using MinGW and Visual C++ 2008).
|
||||
for example, c:\work. If you plan to use MinGW and Microsoft Visual
|
||||
Studio simultaneously or mix different Qt versions, we recommend
|
||||
creating a directory structure which reflects that. For example:
|
||||
C:\work\qt4.8.1-vs10, C:\work\qt4.8.4-mingw.
|
||||
C:\work\qt5.2.1-vs10, C:\work\qt5.2.1-mingw.
|
||||
|
||||
4. Download and install Perl from http://www.activestate.com/activeperl
|
||||
and check that perl.exe is added to the path.
|
||||
and check that perl.exe is added to the path. Run perl -v to verify
|
||||
that the version displayed is 5.10 or later. Note that git ships
|
||||
an outdated version 5.8 which cannot be used for Qt.
|
||||
|
||||
5. In the working directory, check out the respective branch of Qt
|
||||
(we recommend 4.8; see http://qt.gitorious.org/qt).
|
||||
(we recommend the latest released version from the release branch,
|
||||
5.2.1; see https://qt.gitorious.org/qt).
|
||||
|
||||
6. Check out Qt Creator (master branch, see
|
||||
http://qt.gitorious.org/qt-creator).
|
||||
6. Check out Qt Creator (master branch or latest version, see
|
||||
https://qt.gitorious.org/qt-creator).
|
||||
You should now have the directories qt and creator under your working
|
||||
directory.
|
||||
|
||||
7. Install a compiler:
|
||||
- For a MinGW toolchain for Qt 4, see http://www.mingw.org. For a MinGW
|
||||
toolchain for Qt 5, see http://mingwbuilds.sourceforge.net.
|
||||
- For a MinGW toolchain for Qt, see http://qt-project.org/wiki/MinGW .
|
||||
|
||||
- For Microsoft Visual C++, install the Windows SDK and the "Debugging
|
||||
Tools for Windows" from the SDK image. We strongly recommend using the
|
||||
@@ -114,7 +107,8 @@ SDK (release builds of Qt using MinGW and Visual C++ 2008).
|
||||
For the Visual C++ compilers, it is recommended to use the tool 'jom'.
|
||||
It is a replacement for nmake that utilizes all CPU cores and thus
|
||||
speeds up compilation significantly. Download it from
|
||||
http://releases.qt-project.org/jom/ and add the executable to the path.
|
||||
http://download.qt-project.org/official_releases/jom
|
||||
and add the executable to the path.
|
||||
|
||||
8. For convenience, we recommend creating shell prompts with the correct
|
||||
environment. This can be done by creating a .bat-file
|
||||
@@ -122,8 +116,7 @@ SDK (release builds of Qt using MinGW and Visual C++ 2008).
|
||||
variable settings.
|
||||
A .bat-file for MinGW looks like:
|
||||
|
||||
set QTDIR=<working_directory>\qt
|
||||
set PATH=%QTDIR%\bin;<path_to_mingw>\bin;<working_directory>\creator\bin;%PATH%
|
||||
set PATH=<path_to_qt>\[qtbase\]bin;<path_to_mingw>\bin;<working_directory>\creator\bin;%PATH%
|
||||
set QMAKESPEC=win32-g++
|
||||
|
||||
For the Visual C++ compilers, call the .bat file that sets up the
|
||||
@@ -131,8 +124,7 @@ SDK (release builds of Qt using MinGW and Visual C++ 2008).
|
||||
compiler):
|
||||
|
||||
CALL "C:\Program Files (x86)\MSVC10\VC\vcvarsall.bat" amd64
|
||||
set QTDIR=<working_directory>\qt
|
||||
set PATH=%QTDIR%\bin;<working_directory>\creator\bin;%PATH%
|
||||
set PATH=<path_to_qt>\[qtbase\]bin;<working_directory>\creator\bin;%PATH%
|
||||
set QMAKESPEC=win32-msvc2010
|
||||
|
||||
You can create desktop links to the bat files using the working
|
||||
@@ -149,17 +141,19 @@ SDK (release builds of Qt using MinGW and Visual C++ 2008).
|
||||
You have to remove it from the path.
|
||||
|
||||
10. You are now ready to configure and build Qt and Qt Creator.
|
||||
Please see http://qt-project.org/wiki/Building_Qt_5_from_Git for
|
||||
recommended configure-options for Qt 5.
|
||||
To use MinGW, open the the shell prompt and enter:
|
||||
|
||||
cd qt
|
||||
configure -debug && mingw32-make -s
|
||||
cd <path_to_qt>
|
||||
configure <configure_options> && mingw32-make -s
|
||||
cd ..\creator
|
||||
qmake && mingw32-make -s
|
||||
|
||||
To use the Visual C++ compilers, enter:
|
||||
|
||||
cd qt
|
||||
configure -debug && jom
|
||||
cd <path_to_qt>
|
||||
configure <configure_options> && jom
|
||||
cd ..\creator
|
||||
qmake && jom
|
||||
|
||||
@@ -175,6 +169,28 @@ SDK (release builds of Qt using MinGW and Visual C++ 2008).
|
||||
a 64 bit compiler (rebuild src\libs\qtcreatorcdbext using a 64 bit
|
||||
compiler).
|
||||
|
||||
If you are building 32 bit and running on a 64 bit
|
||||
Windows, you can obtain the 64 bit versions of the extension library
|
||||
and the binary win64interrupt.exe, which is required for
|
||||
debugging from the repository
|
||||
https://qt.gitorious.org/qt-creator/binary-artifacts/source/ .
|
||||
|
||||
13. Qt Creator can be registered as a post-mortem debugger. This
|
||||
can be done in the options page or by running the tool qtcdebugger
|
||||
with administrative privileges passing the command line options
|
||||
-register/unregister, respectively. Alternatively,
|
||||
the required registry entries
|
||||
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug and
|
||||
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug
|
||||
can be modified using the registry editor regedt32 to contain
|
||||
<path>\qt-creator\bin\qtcdebugger %ld %ld
|
||||
|
||||
When using a self-built version of Qt Creator as post-mortem debugger, it needs to be
|
||||
able to find all dependent Qt-libraries and plugins when being launched by the
|
||||
system. The easiest way to provide them for Qt 5 is to run the tool windeployqt:
|
||||
|
||||
windeployqt -svg -xml -designercomponents -script -concurrent -network -quick -test -sql -printsupport -qthelp -qmldir share\qtcreator -qmldir src\plugins\qmlprofiler bin\qtcreator.exe
|
||||
|
||||
Note that unlike on Unix, you cannot overwrite executables that are running.
|
||||
Thus, if you want to work on Qt Creator using Qt Creator, you need a
|
||||
separate build of it. We recommend using a separate, release-built version
|
||||
|
||||
@@ -551,7 +551,7 @@
|
||||
\section2 Namespaces
|
||||
|
||||
\list
|
||||
\li Put the left curly brace on the same line as the \namespace keyword.
|
||||
\li Put the left curly brace on the same line as the \c namespace keyword.
|
||||
\li Do not indent declarations or definitions inside.
|
||||
\li Optional, but recommended if the namespaces spans more than a few lines:
|
||||
Add a comment after the right curly brace repeating the namespace.
|
||||
|
||||
@@ -30,7 +30,6 @@ QHP_FILE = $$OUT_PWD/doc/html/qtcreator.qhp
|
||||
QCH_FILE = $$IDE_DOC_PATH/qtcreator.qch
|
||||
|
||||
HELP_DEP_FILES = $$PWD/src/qtcreator.qdoc \
|
||||
$$PWD/addressbook-sdk.qdoc \
|
||||
$$PWD/config/compat.qdocconf \
|
||||
$$PWD/config/macros.qdocconf \
|
||||
$$PWD/config/qt-cpp-ignore.qdocconf \
|
||||
|
||||
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 72 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 23 KiB |
|
Before Width: | Height: | Size: 7.9 KiB |
|
Before Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 10 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 6.2 KiB |
|
Before Width: | Height: | Size: 7.7 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 97 KiB |
|
Before Width: | Height: | Size: 9.7 KiB |
|
Before Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
After Width: | Height: | Size: 6.4 KiB |
|
After Width: | Height: | Size: 21 KiB |
|
After Width: | Height: | Size: 14 KiB |
|
After Width: | Height: | Size: 39 KiB |
|
After Width: | Height: | Size: 20 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 76 KiB |
@@ -107,6 +107,11 @@
|
||||
\li Select \gui Tools > \gui Options > \gui Android to add paths to the
|
||||
Android NDK and SDK.
|
||||
|
||||
You can use the
|
||||
\inlineimage qtcreator-options-android-download-button.png
|
||||
(\gui Download) buttons to go to the sites where you can download
|
||||
the Android NDK and SDK.
|
||||
|
||||
\image qtcreator-options-android1.png "Android options"
|
||||
|
||||
\li Select the \gui {Automatically create kits for Android tool chains}
|
||||
|
||||
@@ -96,13 +96,15 @@
|
||||
\li Select the \gui {Use self-defined style} option, and then
|
||||
\gui Add to define your own style.
|
||||
|
||||
\li Define code formatting in the \gui {Edit Configuration}
|
||||
Define code formatting in the \gui {Edit Configuration}
|
||||
dialog. It provides syntax highlighting, auto-completion,
|
||||
and context-sensitive help. For these features, you must
|
||||
have the tool installed.
|
||||
|
||||
\image beautifier_editor.png
|
||||
|
||||
\endlist
|
||||
|
||||
\li Select \gui Tools > \gui Beautifier > \gui {Artistic Style},
|
||||
\gui ClangFormat, or \gui Uncrustify > \gui {Format Current File}
|
||||
to format the currently open file.
|
||||
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
\list 1
|
||||
|
||||
\li Select \gui Windows > \gui Organizer.
|
||||
\li Select \gui Window > \gui Organizer.
|
||||
|
||||
\li Select the \gui + button to add the connected device.
|
||||
|
||||
@@ -115,6 +115,11 @@
|
||||
|
||||
\endlist
|
||||
|
||||
\note If you cannot deploy applications, because a provisioning profile is
|
||||
missing, try refreshing the list of provisioning profiles in Xcode. Select
|
||||
\gui Xcode > \gui Preferences > \gui Accounts > \gui {View Details}, and
|
||||
then select the \gui Refresh button.
|
||||
|
||||
\section1 Viewing Device Connection Status
|
||||
|
||||
When you connect an iOS device to a Mac computer with USB, \QC
|
||||
|
||||
@@ -52,7 +52,7 @@
|
||||
When you deploy the application to a generic Linux-based device, \QC
|
||||
copies the application files to the connected device. You
|
||||
can test and debug the application on the device.
|
||||
\li \l{Deploying Applications to QNX Devices}
|
||||
\li \l{Deploying Applications to QNX Neutrino Devices}
|
||||
|
||||
When you deploy the application to a BlackBerry, \QC generates a
|
||||
BAR package in the build directory and deploys it to the connected
|
||||
|
||||
@@ -39,8 +39,12 @@
|
||||
\li Select a BlackBerry 10 \l{glossary-buildandrun-kit}{kit} for either device or simulator. For more information about adding kits, see \l{Connecting BlackBerry 10 Devices}.
|
||||
\li When \QC prompts you to generate a bar descriptor file, answer \gui Yes to generate the file and enable the packaging process.
|
||||
\li You can use the BAR descriptor editor to customize the appearance and behavior of the application.
|
||||
\li You can specify which Qt libraries your application should link to in the \gui {Create Packages} deployment step if you create a package in development mode.
|
||||
\endlist
|
||||
|
||||
The BAR application descriptor file in your project will serve as a template to generate the actual BAR application descriptor file in the build directory
|
||||
that is used for packaging. The final BAR application descriptor file depends on the options you specify in the \gui {Create Packages} deployment step.
|
||||
|
||||
If you have an existing Cascades project created by QNX Momentics IDE, you can import it to \QC:
|
||||
|
||||
\list 1
|
||||
|
||||
@@ -30,40 +30,10 @@
|
||||
\page creator-deployment-qnx.html
|
||||
\nextpage creator-connecting-mobile.html
|
||||
|
||||
\title Deploying Applications to QNX Devices
|
||||
\title Deploying Applications to QNX Neutrino Devices
|
||||
|
||||
You can deploy applications to BlackBerry and QNX Neutrino devices.
|
||||
|
||||
\section1 Deploying to BlackBerry Devices
|
||||
|
||||
For BlackBerry devices, \QC generates a BAR package in the build
|
||||
directory and installs it on the connected device. The contents of the BAR
|
||||
package are specified in the \gui{Application Descriptor File}.
|
||||
|
||||
\image qtcreator-playbook-deployment.png "Deploy to device"
|
||||
|
||||
The name of the generated BAR package is shown in the \gui{Package}
|
||||
setting. If the package already exists, it will be overwritten without
|
||||
prior notification.
|
||||
|
||||
\section2 Application Descriptor File
|
||||
|
||||
The application descriptor file needs to be created manually,
|
||||
or you can use the \gui{Application Descriptor} wizard to have a generic
|
||||
template generated. The wizard is available in \gui {File > New File or
|
||||
Project > BlackBerry > Application descriptor}. This wizard will also
|
||||
include a splashscreen.png and an icon.png file which are included in the
|
||||
application descriptor file.
|
||||
|
||||
To tailor your BAR packages, you will have to manually edit the application
|
||||
descriptor file. For a full reference, see
|
||||
\l{http://bdsc.webapps.blackberry.com/native/documentation/com.qnx.doc.native_sdk.devguide/com.qnx.doc.native_sdk.devguide/topic/r_blackberry_tablet_dtd_intro.html}
|
||||
{Document Type Definition (DTD) for the application descriptor file}.
|
||||
|
||||
\section1 Deploying to QNX Neutrino Devices
|
||||
|
||||
Deploying applications to a QNX Neutrino device is very similar to
|
||||
\l{Deploying Applications to Embedded Linux Devices}.
|
||||
You can deploy applications to QNX Neutrino devices in the way that is described
|
||||
in \l{Deploying Applications to Embedded Linux Devices}.
|
||||
|
||||
\image qtcreator-qnx-deployment.png "Deploy to device"
|
||||
|
||||
|
||||
@@ -42,7 +42,9 @@
|
||||
|
||||
\section1 Setting Up BlackBerry 10 Environment in Qt Creator
|
||||
|
||||
To set up your BlackBerry 10 environment in \QC:
|
||||
To check your BlackBerry 10 configuration, including the API level, the Signing Keys and the Device registration, select \gui Tools > \gui Options > \gui BlackBerry > \gui Setup.
|
||||
|
||||
\image qtcreator-blackberry-setupage.png "BlackBerry setup page"
|
||||
|
||||
\list 1
|
||||
|
||||
@@ -50,11 +52,12 @@
|
||||
|
||||
\list 1
|
||||
\li Select \gui Tools > \gui Options > \gui BlackBerry >
|
||||
\gui {API Level} to list all registered API Levels automatically
|
||||
\gui {API Levels and Runtimes} to list all registered API Levels automatically
|
||||
detected by \QC.
|
||||
\image qtcreator-blackberry-apilevels.png "BlackBerry API leves and Runtimes page"
|
||||
\li The API Levels printed with a bold font are active. Use \gui Activate and \gui Deactivate to change it. When an API Level is active, \QC registers kits, Qt versions, tool chains, and debuggers to enable BlackBerry 10 development against the API Level.
|
||||
\li Use \gui Add to install a new API Level or to register an existing one.
|
||||
\li It is recommended to install the latest API Level too even though you are not going to use it. This will enable all \QC features including device auto-detection and the new BlackBerry Signing Keys process.
|
||||
\li It is recommended to keep the newest version as the default API level. \QC will use the available BlackBerry tools from the default API level to implement several of the plugin functions including device management, deployment process and the BlackBerry Signing Keys support. Some of those functions require 10.2 version or newer.
|
||||
\endlist
|
||||
|
||||
\li Set up your Signing Keys:
|
||||
@@ -63,14 +66,25 @@
|
||||
\li Select \gui Tools > \gui Options > \gui BlackBerry > \gui Keys.
|
||||
\li Register a BlackBerry Signing Authority - if you do not have any, the page will guide you to an online web form to request one.
|
||||
\li Select \gui {Create Certificate} to create a Developer Certificate.
|
||||
\li To package your application in development mode, select \gui Request to request a debug token or \gui Import to import a valid token.
|
||||
\image qtcreator-blackberry-keys.png "BlackBerry Keys page"
|
||||
You can also access the debug token list in \gui Tools \gui Tools > \gui Options > \gui Devices when you register a BlackBerry device. To use the same debug token for different devices, select \gui{Edit} to add, remove or update the debug token's device PINs.
|
||||
\endlist
|
||||
|
||||
|
||||
\li Register your device:
|
||||
|
||||
\list 1
|
||||
\li On the device, select \gui Settings > \gui {Security and Privacy} > \gui {Development Mode} to switch the BlackBerry 10 device to development mode.
|
||||
\li Select \gui Tools > \gui Options > \gui Devices > \gui Add > \gui {Blackberry Device} to add a BlackBerry Device. You can add either the physical device or the simulator.
|
||||
\li Select \gui Tools > \gui Options > \gui Devices > \gui Add > \gui {Blackberry Device} to add a BlackBerry Device. \QC should auto detect your BlackBerry device if the default API level is set to 10.2 or newer.
|
||||
\li In the \gui {Device password} field, enter the device password. \QC will query information from the device.
|
||||
\image qtcreator-blackberry-add-device.png "BlackBerry Device Wizard"
|
||||
\li Select \gui Import to import a valid debug token for the device or \gui Request to request a new token.
|
||||
\image qtcreator-blackberry-device-debugToken.png "BlackBerry Device debug token"
|
||||
\li If your device is successfully added, it should be listed in \gui Tools > \gui Options > \gui {Devices}.
|
||||
\image qtcreator-blackberry-device.png "BlackBerry Device Configuration page"
|
||||
\li Select \gui Upload to upload your debug token to the device.
|
||||
\li Select \gui {Connect to device} to connect to the device. You should close any other pending connections from a shell or other IDE to successfully connect your device in \QC.
|
||||
\li Select \gui Tools > \gui Options > \gui {Build & Run} > \gui Kits to add your device to compatible BlackBerry 10 kits.
|
||||
\endlist
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
\section2 Registering Newly Obtained Keys
|
||||
|
||||
After a few hours, you should receive an email with bbidtoken.csk file. Once you stored it at the proper location as described in the email, you can check that signing keys are registered in \QC by visiting \gui Tools > \gui Options > \gui BlackBerry > \gui Keys.
|
||||
After you register in the BlackBerry website, you should get a bbidtoken.csk file. Once you store it at the proper location as described in the email, you can check that signing keys are registered in \QC by selecting \gui Tools > \gui Options > \gui BlackBerry > \gui Keys.
|
||||
|
||||
\image qtcreator-blackberry-registered-keys.png "Registered keys"
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
\li Configure the device and specify a connection to it. For more
|
||||
information, see \l{Connecting QNX Devices}.
|
||||
|
||||
\li If you are running on a BlackBerry device, create an Application
|
||||
Descriptor File if it does not already exist. For more information, see \l{Deploying Applications to QNX Devices}.
|
||||
\li If you are running on a BlackBerry 10 device, create an Application
|
||||
Descriptor File if it does not already exist. For more information, see \l{Deploying Applications to BlackBerry 10 Devices}.
|
||||
|
||||
\li Make sure that your kit has your QNX or BlackBerry 10 device set.
|
||||
|
||||
|
||||
@@ -7,10 +7,12 @@
|
||||
|
||||
\image qtcreator-qnx-run-settings.png "Run settings for QNX devices"
|
||||
|
||||
When you run the application on the BlackBerry device, \QC first creates a BAR package
|
||||
using the settings in the Application Descriptor File. The default is to create the
|
||||
BAR package in the build directory. The BAR package is then deployed to the
|
||||
selected device. For more information, see \l{Deploying Applications to QNX Devices}.
|
||||
|
||||
Specifying run settings for QNX Neutrino devices is very similar to
|
||||
\l{Specifying Run Settings for Linux-Based Devices}.
|
||||
|
||||
\section2 Specifying Run Settings for Blackberry 10 Devices
|
||||
|
||||
When you run the application on the BlackBerry 10 device, \QC first creates a BAR package
|
||||
using the settings in the Application Descriptor File. The default is to create the
|
||||
BAR package in the build directory. The BAR package is then deployed to the
|
||||
selected device. For more information, see \l{Deploying Applications to BlackBerry 10 Devices}.
|
||||
|
||||
@@ -217,7 +217,7 @@
|
||||
\li \l{Deploying Applications to Android Devices}
|
||||
\li \l{Deploying Applications to BlackBerry 10 Devices}
|
||||
\li \l{Deploying Applications to Embedded Linux Devices}
|
||||
\li \l{Deploying Applications to QNX Devices}
|
||||
\li \l{Deploying Applications to QNX Neutrino Devices}
|
||||
\endlist
|
||||
\li \l{Connecting Mobile Devices}
|
||||
\list
|
||||
|
||||
@@ -17,7 +17,7 @@ Module {
|
||||
|
||||
prepare: {
|
||||
var cmd = new JavaScriptCommand();
|
||||
cmd.description = "prepare " + FileInfo.fileName(output.fileName);
|
||||
cmd.description = "prepare " + FileInfo.fileName(output.filePath);
|
||||
cmd.highlight = "codegen";
|
||||
cmd.pluginspecreplacements = product.pluginspecreplacements;
|
||||
cmd.plugin_depends = [];
|
||||
@@ -36,7 +36,7 @@ Module {
|
||||
cmd.sourceCode = function() {
|
||||
var i;
|
||||
var vars = pluginspecreplacements || {};
|
||||
var inf = new TextFile(input.fileName);
|
||||
var inf = new TextFile(input.filePath);
|
||||
var all = inf.readAll();
|
||||
// replace quoted quotes
|
||||
all = all.replace(/\\\"/g, '"');
|
||||
@@ -58,7 +58,7 @@ Module {
|
||||
for (i in vars) {
|
||||
all = all.replace(new RegExp('\\\$\\\$' + i + '(?!\w)', 'g'), vars[i]);
|
||||
}
|
||||
var file = new TextFile(output.fileName, TextFile.WriteOnly);
|
||||
var file = new TextFile(output.filePath, TextFile.WriteOnly);
|
||||
file.truncate();
|
||||
file.write(all);
|
||||
file.close();
|
||||
@@ -85,12 +85,12 @@ Module {
|
||||
var args = [
|
||||
"-no-format",
|
||||
"-output",
|
||||
output.fileName,
|
||||
output.filePath,
|
||||
xslFile,
|
||||
input.fileName
|
||||
input.filePath
|
||||
];
|
||||
var cmd = new Command(xmlPatternsPath, args);
|
||||
cmd.description = "generating " + FileInfo.fileName(output.fileName);
|
||||
cmd.description = "generating " + FileInfo.fileName(output.filePath);
|
||||
cmd.highlight = "codegen";
|
||||
return cmd;
|
||||
}
|
||||
|
||||
@@ -171,6 +171,7 @@ INCLUDEPATH += \
|
||||
$$IDE_SOURCE_TREE/tools
|
||||
|
||||
QTC_PLUGIN_DIRS = $$(QTC_PLUGIN_DIRS)
|
||||
QTC_PLUGIN_DIRS = $$split(QTC_PLUGIN_DIRS, $$QMAKE_DIRLIST_SEP)
|
||||
QTC_PLUGIN_DIRS += $$IDE_SOURCE_TREE/src/plugins
|
||||
for(dir, QTC_PLUGIN_DIRS) {
|
||||
INCLUDEPATH += $$dir
|
||||
|
||||
@@ -281,7 +281,7 @@ def main():
|
||||
QT_INSTALL_QML = readQmakeVar(qmake_bin, 'QT_INSTALL_QML')
|
||||
QT_INSTALL_TRANSLATIONS = readQmakeVar(qmake_bin, 'QT_INSTALL_TRANSLATIONS')
|
||||
|
||||
plugins = ['accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platforminputcontexts', 'platforms', 'printsupport', 'sqldrivers']
|
||||
plugins = ['accessible', 'codecs', 'designer', 'iconengines', 'imageformats', 'platformthemes', 'platforminputcontexts', 'platforms', 'printsupport', 'sqldrivers']
|
||||
imports = ['Qt', 'QtWebKit']
|
||||
|
||||
if sys.platform.startswith('win'):
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
=head1 NAME
|
||||
|
||||
qdoc2tasks.pl - Convert qdoc warnings into Qt Creator task files.
|
||||
|
||||
=head1 SYNOPSIS
|
||||
|
||||
qdoc2tasks.pl < logfile > taskfile
|
||||
|
||||
=cut
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
while (my $line = <STDIN>) {
|
||||
chomp($line);
|
||||
# --- extract file name based matching:
|
||||
# D:/.../qaxbase.cpp:3231: warning: Cannot tie this documentation to anything
|
||||
if ($line =~ /^(..[^:]*):(\d+): warning: (.*)$/) {
|
||||
my $fileName = $1;
|
||||
my $lineNumber = $2;
|
||||
my $text = $3;
|
||||
print $fileName, "\t", $lineNumber, "\twarn\t", $text,"\n";
|
||||
}
|
||||
}
|
||||
@@ -925,11 +925,22 @@ class DumperBase:
|
||||
pass
|
||||
|
||||
|
||||
def extractStaticMetaObjectHelper(self, typeName):
|
||||
def extractStaticMetaObjectHelper(self, typeobj):
|
||||
"""
|
||||
Checks whether type has a Q_OBJECT macro.
|
||||
Returns the staticMetaObject, or 0.
|
||||
"""
|
||||
|
||||
if self.isSimpleType(typeobj):
|
||||
return 0
|
||||
|
||||
typeName = str(typeobj)
|
||||
isQObjectProper = typeName == self.qtNamespace() + "QObject"
|
||||
|
||||
if not isQObjectProper:
|
||||
if self.directBaseClass(typeobj, 0) is None:
|
||||
return 0
|
||||
|
||||
# No templates for now.
|
||||
if typeName.find('<') >= 0:
|
||||
return 0
|
||||
@@ -940,8 +951,9 @@ class DumperBase:
|
||||
# We need to distinguish Q_OBJECT from Q_GADGET:
|
||||
# a Q_OBJECT SMO has a non-null superdata (unless it's QObject itself),
|
||||
# a Q_GADGET SMO has a null superdata (hopefully)
|
||||
if result and typeName != self.qtNamespace() + "QObject":
|
||||
if not self.extractPointer(result):
|
||||
if result and not isQObjectProper:
|
||||
superdata = self.extractPointer(result)
|
||||
if toInteger(superdata) == 0:
|
||||
# This looks like a Q_GADGET
|
||||
result = 0
|
||||
|
||||
@@ -951,12 +963,15 @@ class DumperBase:
|
||||
"""
|
||||
Checks recursively whether a type derives from QObject.
|
||||
"""
|
||||
if not self.useFancy:
|
||||
return 0
|
||||
|
||||
typeName = str(typeobj)
|
||||
result = self.knownStaticMetaObjects.get(typeName, None)
|
||||
if result is not None: # Is 0 or the static metaobject.
|
||||
return result
|
||||
|
||||
result = self.extractStaticMetaObjectHelper(typeName)
|
||||
result = self.extractStaticMetaObjectHelper(typeobj)
|
||||
if not result:
|
||||
base = self.directBaseClass(typeobj, 0)
|
||||
if base:
|
||||
@@ -1002,25 +1017,24 @@ class DumperBase:
|
||||
return result
|
||||
|
||||
def generateQListChildren(self, value):
|
||||
dptr = self.childAt(value, 0)["d"]
|
||||
private = dptr.dereference()
|
||||
begin = int(private["begin"])
|
||||
end = int(private["end"])
|
||||
array = private["array"]
|
||||
base = self.extractPointer(value)
|
||||
begin = self.extractInt(base + 8)
|
||||
end = self.extractInt(base + 12)
|
||||
array = base + 16
|
||||
if self.qtVersion() < 0x50000:
|
||||
array += self.ptrSize()
|
||||
size = end - begin
|
||||
innerType = self.templateArgument(value.type, 0)
|
||||
innerSize = innerType.sizeof
|
||||
stepSize = dptr.type.sizeof
|
||||
addr = self.addressOf(array) + begin * stepSize
|
||||
stepSize = self.ptrSize()
|
||||
addr = array + begin * stepSize
|
||||
isInternal = innerSize <= stepSize and self.isMovableType(innerType)
|
||||
if isInternal:
|
||||
for i in range(size):
|
||||
if isInternal:
|
||||
yield self.createValue(addr + i * stepSize, innerType)
|
||||
else:
|
||||
p = self.createPointerValue(addr, innerType.pointer())
|
||||
for i in range(size):
|
||||
yield p.dereference().dereference()
|
||||
p += 1
|
||||
p = self.extractPointer(addr + i * stepSize)
|
||||
yield self.createValue(p, innerType)
|
||||
|
||||
|
||||
# This is called is when a QObject derived class is expanded
|
||||
@@ -1029,8 +1043,10 @@ class DumperBase:
|
||||
ptrSize = self.ptrSize()
|
||||
# dd = value["d_ptr"]["d"] is just behind the vtable.
|
||||
dd = self.extractPointer(qobject, offset=ptrSize)
|
||||
isQt5 = self.qtVersion() >= 0x50000
|
||||
|
||||
extraData = self.extractPointer(dd + 5 * ptrSize + 2 * intSize)
|
||||
extraDataOffset = 5 * ptrSize + 8 if isQt5 else 6 * ptrSize + 8
|
||||
extraData = self.extractPointer(dd + extraDataOffset)
|
||||
#with SubItem(self, "[extradata]"):
|
||||
# self.putValue("0x%x" % toInteger(extraData))
|
||||
|
||||
@@ -1043,7 +1059,7 @@ class DumperBase:
|
||||
# Static properties.
|
||||
for i in range(propertyCount):
|
||||
name = propertyNames[i]
|
||||
self.putCallItem(name, qobject, "property", '"' + name + '"')
|
||||
self.putCallItem(str(name), qobject, "property", '"' + name + '"')
|
||||
|
||||
# Dynamic properties.
|
||||
if extraData:
|
||||
|
||||
@@ -378,6 +378,11 @@ class Dumper(DumperBase):
|
||||
self.useDynamicType = True
|
||||
self.expandedINames = {}
|
||||
|
||||
# The guess does not need to be updated during a run()
|
||||
# as the result is fixed during that time (ignoring "active"
|
||||
# dumpers causing loading of shared objects etc).
|
||||
self.currentQtNamespaceGuess = None
|
||||
|
||||
watchers = ""
|
||||
resultVarName = ""
|
||||
options = []
|
||||
@@ -1534,6 +1539,9 @@ class Dumper(DumperBase):
|
||||
self.importPlainDumper(printer)
|
||||
|
||||
def qtNamespace(self):
|
||||
if not self.currentQtNamespaceGuess is None:
|
||||
return self.currentQtNamespaceGuess
|
||||
|
||||
# This only works when called from a valid frame.
|
||||
try:
|
||||
cand = "QArrayData::shared_null"
|
||||
@@ -1559,6 +1567,7 @@ class Dumper(DumperBase):
|
||||
except:
|
||||
pass
|
||||
|
||||
self.currentQtNamespaceGuess = ""
|
||||
return ""
|
||||
|
||||
def bbedit(self, args):
|
||||
@@ -1750,10 +1759,12 @@ theDumper = Dumper()
|
||||
#######################################################################
|
||||
|
||||
def p1(args):
|
||||
import tempfile
|
||||
import cProfile
|
||||
cProfile.run('bb("%s")' % args, "/tmp/bbprof")
|
||||
tempDir = tempfile.gettempdir() + "/bbprof"
|
||||
cProfile.run('bb("%s")' % args, tempDir)
|
||||
import pstats
|
||||
pstats.Stats('/tmp/bbprof').sort_stats('time').print_stats()
|
||||
pstats.Stats(tempDir).sort_stats('time').print_stats()
|
||||
return ""
|
||||
|
||||
registerCommand("p1", p1)
|
||||
|
||||
@@ -227,6 +227,7 @@ class Dumper(DumperBase):
|
||||
|
||||
lldb.theDumper = self
|
||||
|
||||
self.outputLock = threading.Lock()
|
||||
self.debugger = lldb.SBDebugger.Create()
|
||||
#self.debugger.SetLoggingCallback(loggingCallback)
|
||||
#Same as: self.debugger.HandleCommand("log enable lldb dyld step")
|
||||
@@ -431,19 +432,27 @@ class Dumper(DumperBase):
|
||||
def qtVersionAndNamespace(self):
|
||||
for func in self.target.FindFunctions('qVersion'):
|
||||
name = func.GetSymbol().GetName()
|
||||
if name.endswith('()'):
|
||||
name = name[:-2]
|
||||
if name.count(':') > 2:
|
||||
continue
|
||||
|
||||
version = str(self.parseAndEvaluate('((const char*())%s)()' % name))
|
||||
version.replace("'", '"') # Both seem possible
|
||||
version = version[version.find('"')+1:version.rfind('"')]
|
||||
|
||||
if version.count('.') != 2:
|
||||
continue
|
||||
|
||||
qtNamespace = name[:name.find('qVersion')]
|
||||
self.qtNamespace = lambda: qtNamespace
|
||||
|
||||
res = ""
|
||||
try:
|
||||
res = self.parseAndEvaluate(name + '()')
|
||||
except:
|
||||
res = self.parseAndEvaluate('((const char*())%s)()' % name)
|
||||
version = str(res)
|
||||
|
||||
if version.count('.') != 2:
|
||||
continue
|
||||
|
||||
version.replace("'", '"') # Both seem possible
|
||||
version = version[version.find('"')+1:version.rfind('"')]
|
||||
|
||||
(major, minor, patch) = version.split('.')
|
||||
qtVersion = 0x10000 * int(major) + 0x100 * int(minor) + int(patch)
|
||||
self.qtVersion = lambda: qtVersion
|
||||
@@ -666,24 +675,24 @@ class Dumper(DumperBase):
|
||||
attachInfo = lldb.SBAttachInfo(self.attachPid_)
|
||||
self.process = self.target.Attach(attachInfo, error)
|
||||
if not error.Success():
|
||||
self.report('state="inferiorrunfailed"')
|
||||
self.reportState("inferiorrunfailed")
|
||||
return
|
||||
self.report('pid="%s"' % self.process.GetProcessID())
|
||||
# even if it stops it seems that lldb assumes it is running and later detects that
|
||||
# it did stop after all, so it is be better to mirror that and wait for the spontaneous
|
||||
# stop
|
||||
self.report('state="enginerunandinferiorrunok"')
|
||||
# Even if it stops it seems that LLDB assumes it is running
|
||||
# and later detects that it did stop after all, so it is be
|
||||
# better to mirror that and wait for the spontaneous stop.
|
||||
self.reportState("enginerunandinferiorrunok")
|
||||
elif len(self.remoteChannel_) > 0:
|
||||
self.process = self.target.ConnectRemote(
|
||||
self.debugger.GetListener(),
|
||||
self.remoteChannel_, None, error)
|
||||
if not error.Success():
|
||||
self.report('state="inferiorrunfailed"')
|
||||
self.reportState("inferiorrunfailed")
|
||||
return
|
||||
# even if it stops it seems that lldb assumes it is running and later detects that
|
||||
# it did stop after all, so it is be better to mirror that and wait for the spontaneous
|
||||
# stop
|
||||
self.report('state="enginerunandinferiorrunok"')
|
||||
# Even if it stops it seems that LLDB assumes it is running
|
||||
# and later detects that it did stop after all, so it is be
|
||||
# better to mirror that and wait for the spontaneous stop.
|
||||
self.reportState("enginerunandinferiorrunok")
|
||||
else:
|
||||
launchInfo = lldb.SBLaunchInfo(self.processArgs_)
|
||||
launchInfo.SetWorkingDirectory(os.getcwd())
|
||||
@@ -694,10 +703,10 @@ class Dumper(DumperBase):
|
||||
self.process = self.target.Launch(launchInfo, error)
|
||||
if not error.Success():
|
||||
self.reportError(error)
|
||||
self.report('state="enginerunfailed"')
|
||||
self.reportState("enginerunfailed")
|
||||
return
|
||||
self.report('pid="%s"' % self.process.GetProcessID())
|
||||
self.report('state="enginerunandinferiorrunok"')
|
||||
self.reportState("enginerunandinferiorrunok")
|
||||
|
||||
event = lldb.SBEvent()
|
||||
while True:
|
||||
@@ -731,7 +740,8 @@ class Dumper(DumperBase):
|
||||
frame = thread.GetSelectedFrame()
|
||||
file = fileName(frame.line_entry.file)
|
||||
line = frame.line_entry.line
|
||||
self.report('location={file="%s",line="%s",addr="%s"}' % (file, line, frame.pc))
|
||||
self.report('location={file="%s",line="%s",addr="%s"}'
|
||||
% (file, line, frame.pc))
|
||||
|
||||
def firstStoppedThread(self):
|
||||
for i in xrange(0, self.process.GetNumThreads()):
|
||||
@@ -1056,7 +1066,12 @@ class Dumper(DumperBase):
|
||||
with SubItem(self, child):
|
||||
self.putItem(child)
|
||||
|
||||
def reportVariables(self, _ = None):
|
||||
def reportVariables(self, args = None):
|
||||
with self.outputLock:
|
||||
self.reportVariablesHelper(args)
|
||||
sys.stdout.write("@\n")
|
||||
|
||||
def reportVariablesHelper(self, _ = None):
|
||||
frame = self.currentFrame()
|
||||
if frame is None:
|
||||
return
|
||||
@@ -1138,7 +1153,6 @@ class Dumper(DumperBase):
|
||||
self.putItem(value)
|
||||
|
||||
self.put(']')
|
||||
self.report('')
|
||||
|
||||
def reportData(self, _ = None):
|
||||
if self.process is None:
|
||||
@@ -1167,6 +1181,7 @@ class Dumper(DumperBase):
|
||||
self.report(result)
|
||||
|
||||
def report(self, stuff):
|
||||
with self.outputLock:
|
||||
sys.stdout.write(stuff + "@\n")
|
||||
|
||||
def reportStatus(self, msg):
|
||||
@@ -1196,7 +1211,7 @@ class Dumper(DumperBase):
|
||||
self.reportError(error)
|
||||
|
||||
def quitDebugger(self, _ = None):
|
||||
self.report('state="inferiorshutdownrequested"')
|
||||
self.reportState("inferiorshutdownrequested")
|
||||
self.process.Kill()
|
||||
|
||||
def handleEvent(self, event):
|
||||
@@ -1213,22 +1228,22 @@ class Dumper(DumperBase):
|
||||
self.eventState = state
|
||||
if state == lldb.eStateExited:
|
||||
if self.isShuttingDown_:
|
||||
self.report('state="inferiorshutdownok"')
|
||||
self.reportState("inferiorshutdownok")
|
||||
else:
|
||||
self.report('state="inferiorexited"')
|
||||
self.reportState("inferiorexited")
|
||||
self.report('exited={status="%s",desc="%s"}'
|
||||
% (self.process.GetExitStatus(), self.process.GetExitDescription()))
|
||||
elif state == lldb.eStateStopped:
|
||||
if self.isInterrupting_:
|
||||
self.isInterrupting_ = False
|
||||
self.report('state="inferiorstopok"')
|
||||
self.reportState("inferiorstopok")
|
||||
elif self.ignoreStops > 0:
|
||||
self.ignoreStops -= 1
|
||||
self.process.Continue()
|
||||
else:
|
||||
self.report('state="stopped"')
|
||||
self.reportState("stopped")
|
||||
else:
|
||||
self.report('state="%s"' % stateNames[state])
|
||||
self.reportState(stateNames[state])
|
||||
if type == lldb.SBProcess.eBroadcastBitStateChanged:
|
||||
state = self.process.GetState()
|
||||
if state == lldb.eStateStopped:
|
||||
@@ -1254,6 +1269,9 @@ class Dumper(DumperBase):
|
||||
elif type == lldb.SBProcess.eBroadcastBitProfileData:
|
||||
pass
|
||||
|
||||
def reportState(self, state):
|
||||
self.report('state="%s"' % state)
|
||||
|
||||
def describeBreakpoint(self, bp):
|
||||
isWatch = isinstance(bp, lldb.SBWatchpoint)
|
||||
if isWatch:
|
||||
@@ -1451,7 +1469,7 @@ class Dumper(DumperBase):
|
||||
self.process.Kill()
|
||||
|
||||
def quit(self, _ = None):
|
||||
self.report('state="engineshutdownok"')
|
||||
self.reportState("engineshutdownok")
|
||||
self.process.Kill()
|
||||
|
||||
def executeStepI(self, _ = None):
|
||||
@@ -1470,8 +1488,8 @@ class Dumper(DumperBase):
|
||||
line = int(args['line'])
|
||||
error = self.currentThread().StepOverUntil(frame, lldb.SBFileSpec(file), line)
|
||||
if error.GetType():
|
||||
self.report('state="running"')
|
||||
self.report('state="stopped"')
|
||||
self.reportState("running")
|
||||
self.reportState("stopped")
|
||||
self.reportError(error)
|
||||
self.reportLocation()
|
||||
else:
|
||||
@@ -1479,7 +1497,7 @@ class Dumper(DumperBase):
|
||||
|
||||
def executeJumpToLocation(self, args):
|
||||
frame = self.currentFrame()
|
||||
self.report('state="stopped"')
|
||||
self.reportState("stopped")
|
||||
if not frame:
|
||||
self.reportStatus("No frame available.")
|
||||
self.reportLocation()
|
||||
@@ -1670,7 +1688,7 @@ def doit():
|
||||
|
||||
db = Dumper()
|
||||
db.report('lldbversion="%s"' % lldb.SBDebugger.GetVersionString())
|
||||
db.report('state="enginesetupok"')
|
||||
db.reportState("enginesetupok")
|
||||
|
||||
line = sys.stdin.readline()
|
||||
while line:
|
||||
|
||||
@@ -734,15 +734,16 @@ def qform__QList():
|
||||
return "Assume Direct Storage,Assume Indirect Storage"
|
||||
|
||||
def qdump__QList(d, value):
|
||||
dptr = d.childAt(value, 0)["d"]
|
||||
private = dptr.dereference()
|
||||
begin = int(private["begin"])
|
||||
end = int(private["end"])
|
||||
array = private["array"]
|
||||
base = d.extractPointer(value)
|
||||
begin = d.extractInt(base + 8)
|
||||
end = d.extractInt(base + 12)
|
||||
array = base + 16
|
||||
if d.qtVersion() < 0x50000:
|
||||
array += d.ptrSize()
|
||||
d.check(begin >= 0 and end >= 0 and end <= 1000 * 1000 * 1000)
|
||||
size = end - begin
|
||||
d.check(size >= 0)
|
||||
d.checkRef(private["ref"])
|
||||
#d.checkRef(private["ref"])
|
||||
|
||||
innerType = d.templateArgument(value.type, 0)
|
||||
|
||||
@@ -750,8 +751,8 @@ def qdump__QList(d, value):
|
||||
d.putNumChild(size)
|
||||
if d.isExpanded():
|
||||
innerSize = innerType.sizeof
|
||||
stepSize = dptr.type.sizeof
|
||||
addr = d.addressOf(array) + begin * stepSize
|
||||
stepSize = d.ptrSize()
|
||||
addr = array + begin * stepSize
|
||||
# The exact condition here is:
|
||||
# QTypeInfo<T>::isLarge || QTypeInfo<T>::isStatic
|
||||
# but this data is available neither in the compiled binary nor
|
||||
@@ -774,12 +775,12 @@ def qdump__QList(d, value):
|
||||
p = d.createValue(addr + i * stepSize, innerType)
|
||||
d.putSubItem(i, p)
|
||||
else:
|
||||
p = d.createPointerValue(addr, innerType.pointer())
|
||||
# about 0.5s / 1000 items
|
||||
with Children(d, size, maxNumChild=2000, childType=innerType):
|
||||
for i in d.childRange():
|
||||
d.putSubItem(i, p.dereference().dereference())
|
||||
p += 1
|
||||
p = d.extractPointer(addr + i * stepSize)
|
||||
x = d.createValue(p, innerType)
|
||||
d.putSubItem(i, x)
|
||||
|
||||
def qform__QImage():
|
||||
return "Normal,Displayed"
|
||||
@@ -1009,7 +1010,7 @@ def qform__QMap():
|
||||
return mapForms()
|
||||
|
||||
def qdump__QMap(d, value):
|
||||
if d.fieldAt(value["d"].dereference().type, 0).name == "backward":
|
||||
if d.qtVersion() < 0x50000:
|
||||
qdumpHelper__Qt4_QMap(d, value)
|
||||
else:
|
||||
qdumpHelper__Qt5_QMap(d, value)
|
||||
@@ -2075,15 +2076,24 @@ def qdump__QVariant(d, value):
|
||||
if variantType >= 31 and variantType <= 38 and d.qtVersion() >= 0x050000:
|
||||
blob = d.toBlob(value)
|
||||
qdumpHelper_QVariants_D[variantType - 31](d, blob)
|
||||
d.putNumChild(0)
|
||||
return None
|
||||
|
||||
# Extended Core type (Qt 4)
|
||||
if variantType >= 128 and variantType <= 135 and d.qtVersion() < 0x050000:
|
||||
if variantType == 128 or variantType == 135: # No indirection for float.
|
||||
if variantType == 128:
|
||||
p = d.extractPointer(value)
|
||||
d.putBetterType("%sQVariant (void *)" % d.qtNamespace())
|
||||
d.putValue("0x%x" % p)
|
||||
else:
|
||||
if variantType == 135:
|
||||
blob = d.toBlob(value)
|
||||
else:
|
||||
blob = d.extractBlob(d.extractPointer(value["d"]["data"]["ptr"]), 8)
|
||||
p = d.extractPointer(value)
|
||||
p = d.extractPointer(p)
|
||||
blob = d.extractBlob(p, 8)
|
||||
qdumpHelper_QVariants_D[variantType - 128](d, blob)
|
||||
d.putNumChild(0)
|
||||
return None
|
||||
|
||||
if variantType <= 86:
|
||||
@@ -2224,8 +2234,8 @@ def qdump__QWeakPointer(d, value):
|
||||
d.putIntItem("strongref", strongref)
|
||||
|
||||
|
||||
def qdump__QxXmlAttributes(d, value):
|
||||
pass
|
||||
def qdump__QXmlAttributes(d, value):
|
||||
qdump__QList(d, value["attList"])
|
||||
|
||||
|
||||
#######################################################################
|
||||
|
||||
@@ -372,6 +372,9 @@ void GraphicalNodeInstance::setPropertyBinding(const PropertyName &name, const Q
|
||||
if (name == "state")
|
||||
return; // states are only set by us
|
||||
|
||||
if (name.startsWith("anchors.") && isRootNodeInstance())
|
||||
return;
|
||||
|
||||
ObjectNodeInstance::setPropertyBinding(name, expression);
|
||||
|
||||
quickItem()->update();
|
||||
|
||||
@@ -1056,6 +1056,16 @@ static bool isWindowMetaObject(const QMetaObject *metaObject)
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool isCrashingType(QQmlType *type)
|
||||
{
|
||||
if (type) {
|
||||
if (type->qmlTypeName() == QStringLiteral("QtMultimedia/MediaPlayer"))
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static QObject *createDummyWindow(QQmlContext *context, const QUrl &sourceUrl)
|
||||
{
|
||||
QQmlComponent component(context->engine());
|
||||
@@ -1086,7 +1096,9 @@ QObject *ObjectNodeInstance::createPrimitive(const QString &typeName, int majorN
|
||||
QObject *object = 0;
|
||||
QQmlType *type = getQmlType(typeName, majorNumber, minorNumber);
|
||||
|
||||
if (type) {
|
||||
if (isCrashingType(type)) {
|
||||
object = new QObject;
|
||||
} else if (type) {
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0)) // TODO remove hack later if we only support >= 5.2
|
||||
if ( type->isComposite()) {
|
||||
object = createComponent(type->sourceUrl(), context);
|
||||
|
||||
@@ -39,14 +39,20 @@ Controls.ComboBox {
|
||||
property color textColor: colorLogic.textColor
|
||||
property string scope: "Qt"
|
||||
|
||||
property bool useInteger: false
|
||||
|
||||
ColorLogic {
|
||||
id: colorLogic
|
||||
backendValue: comboBox.backendValue
|
||||
onValueFromBackendChanged: {
|
||||
if (!comboBox.useInt) {
|
||||
var enumString = comboBox.backendValue.enumeration;
|
||||
if (enumString === "")
|
||||
enumString = comboBox.backendValue.value
|
||||
comboBox.currentIndex = comboBox.find(enumString);
|
||||
} else {
|
||||
comboBox.currentIndex = backendValue.value
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,7 +60,12 @@ Controls.ComboBox {
|
||||
if (backendValue === undefined)
|
||||
return;
|
||||
|
||||
backendValue.setEnumeration(comboBox.scope, comboBox.currentText)
|
||||
if (!comboBox.useInt) {
|
||||
backendValue.setEnumeration(comboBox.scope, comboBox.currentText);
|
||||
} else {
|
||||
print("useint" + comboBox.currentIndex)
|
||||
backendValue.value = comboBox.currentIndex;
|
||||
}
|
||||
}
|
||||
|
||||
onFocusChanged: {
|
||||
|
||||
@@ -0,0 +1,112 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
|
||||
** Contact: http://www.qt-project.org/legal
|
||||
**
|
||||
** This file is part of the Qt Quick Controls module 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.0
|
||||
import HelperWidgets 2.0
|
||||
import QtQuick.Layouts 1.0
|
||||
import QtQuick.Controls 1.0 as Controls
|
||||
|
||||
RowLayout {
|
||||
id: anchorRow
|
||||
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
opacity: enabled ? 1 : 0.5
|
||||
property alias iconSource: icon.source
|
||||
|
||||
property variant anchorMargin
|
||||
|
||||
property alias targetName: targetComboBox.targetName
|
||||
property alias currentText: targetComboBox.currentText
|
||||
|
||||
signal targetChanged
|
||||
|
||||
IconLabel {
|
||||
id: icon
|
||||
Layout.alignment: Qt.AlignTop
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
Layout.fillWidth: true
|
||||
rows: 2
|
||||
columns: 2
|
||||
|
||||
Controls.Label {
|
||||
text: qsTr("Target")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: Math.min(60, preferredWidth + 10)
|
||||
}
|
||||
|
||||
TargetComboBox {
|
||||
id: targetComboBox
|
||||
onCurrentTextChanged: {
|
||||
anchorRow.targetChanged();
|
||||
}
|
||||
}
|
||||
|
||||
Controls.Label {
|
||||
text: "Margin"
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: Math.min(60, preferredWidth + 10)
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
SpinBox {
|
||||
maximumValue: 0xffff
|
||||
minimumValue: -0xffff
|
||||
backendValue: anchorMargin
|
||||
}
|
||||
|
||||
// ButtonRow {
|
||||
// exclusive: true
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-top.png"
|
||||
|
||||
// }
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-bottom.png"
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -57,356 +57,65 @@ Section {
|
||||
AnchorButtons {
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
AnchorRow {
|
||||
enabled: anchorBackend.topAnchored;
|
||||
opacity: enabled ? 1 : 0.5
|
||||
|
||||
IconLabel {
|
||||
source: "../HelperWidgets/images/anchor-top.png"
|
||||
Layout.alignment: Qt.AlignTop
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
Layout.fillWidth: true
|
||||
rows: 2
|
||||
columns: 2
|
||||
|
||||
Text {
|
||||
text: qsTr("Target")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
TargetComboBox {
|
||||
iconSource: "../HelperWidgets/images/anchor-top.png"
|
||||
anchorMargin: backendValues.anchors_topMargin
|
||||
targetName: anchorBackend.topTarget
|
||||
onCurrentTextChanged: {
|
||||
onTargetChanged: {
|
||||
anchorBackend.topTarget = currentText
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: "Margin"
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
SpinBox {
|
||||
maximumValue: 0xffff
|
||||
minimumValue: -0xffff
|
||||
backendValue: backendValues.anchors_topMargin
|
||||
}
|
||||
|
||||
// ButtonRow {
|
||||
// exclusive: true
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-top.png"
|
||||
|
||||
// }
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-bottom.png"
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
AnchorRow {
|
||||
enabled: anchorBackend.bottomAnchored;
|
||||
opacity: enabled ? 1 : 0.5
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
IconLabel {
|
||||
source: "../HelperWidgets/images/anchor-bottom.png"
|
||||
Layout.alignment: Qt.AlignTop
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
Layout.fillWidth: true
|
||||
rows: 2
|
||||
columns: 2
|
||||
|
||||
Text {
|
||||
text: qsTr("Target")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
TargetComboBox {
|
||||
iconSource: "../HelperWidgets/images/anchor-bottom.png"
|
||||
anchorMargin: backendValues.anchors_bottomMargin
|
||||
targetName: anchorBackend.bottomTarget
|
||||
onCurrentTextChanged: {
|
||||
onTargetChanged: {
|
||||
anchorBackend.bottomTarget = currentText
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Margin")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
SpinBox {
|
||||
maximumValue: 0xffff
|
||||
minimumValue: -0xffff
|
||||
backendValue: backendValues.anchors_bottomMargin
|
||||
|
||||
}
|
||||
|
||||
// ButtonRow {
|
||||
// exclusive: true
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-top.png"
|
||||
// }
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-bottom.png"
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
AnchorRow {
|
||||
enabled: anchorBackend.leftAnchored;
|
||||
opacity: enabled ? 1 : 0.5
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
|
||||
IconLabel {
|
||||
source: "../HelperWidgets/images/anchor-left.png"
|
||||
Layout.alignment: Qt.AlignTop
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
Layout.fillWidth: true
|
||||
rows: 2
|
||||
columns: 2
|
||||
|
||||
Text {
|
||||
text: qsTr("Target")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
TargetComboBox {
|
||||
iconSource: "../HelperWidgets/images/anchor-left.png"
|
||||
anchorMargin: backendValues.anchors_leftMargin
|
||||
targetName: anchorBackend.leftTarget
|
||||
onCurrentTextChanged: {
|
||||
onTargetChanged: {
|
||||
anchorBackend.leftTarget = currentText
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Margin")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
SpinBox {
|
||||
maximumValue: 0xffff
|
||||
minimumValue: -0xffff
|
||||
backendValue: backendValues.anchors_leftMargin
|
||||
}
|
||||
|
||||
// ButtonRow {
|
||||
// exclusive: true
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-left.png"
|
||||
// }
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-right.png"
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
AnchorRow {
|
||||
enabled: anchorBackend.rightAnchored;
|
||||
opacity: enabled ? 1 : 0.5
|
||||
|
||||
IconLabel {
|
||||
source: "../HelperWidgets/images/anchor-right.png"
|
||||
Layout.alignment: Qt.AlignTop
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
Layout.fillWidth: true
|
||||
rows: 2
|
||||
columns: 2
|
||||
|
||||
Text {
|
||||
text: qsTr("Target")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
TargetComboBox {
|
||||
iconSource: "../HelperWidgets/images/anchor-right.png"
|
||||
anchorMargin: backendValues.anchors_rightMargin
|
||||
targetName: anchorBackend.rightTarget
|
||||
onCurrentTextChanged: {
|
||||
onTargetChanged: {
|
||||
anchorBackend.rightTarget = currentText
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Margin")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
SpinBox {
|
||||
maximumValue: 0xffff
|
||||
minimumValue: -0xffff
|
||||
backendValue: backendValues.anchors_rightMargin
|
||||
}
|
||||
|
||||
// ButtonRow {
|
||||
// exclusive: true
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-left.png"
|
||||
// }
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-right.png"
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
AnchorRow {
|
||||
enabled: anchorBackend.horizontalCentered;
|
||||
opacity: enabled ? 1 : 0.5
|
||||
|
||||
IconLabel {
|
||||
source: "../HelperWidgets/images/anchor-horizontal.png"
|
||||
Layout.alignment: Qt.AlignTop
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
Layout.fillWidth: true
|
||||
rows: 2
|
||||
columns: 2
|
||||
|
||||
Text {
|
||||
text: qsTr("Target")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
TargetComboBox {
|
||||
iconSource: "../HelperWidgets/images/anchor-horizontal.png"
|
||||
anchorMargin: backendValues.anchors_horizontalCenterOffset
|
||||
targetName: anchorBackend.horizontalTarget
|
||||
onCurrentTextChanged: {
|
||||
onTargetChanged: {
|
||||
anchorBackend.horizontalTarget = currentText
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Margin")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
SpinBox {
|
||||
maximumValue: 0xffff
|
||||
minimumValue: -0xffff
|
||||
backendValue: backendValues.anchors_horizontalCenterOffset
|
||||
}
|
||||
|
||||
// ButtonRow {
|
||||
// exclusive: true
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-left.png"
|
||||
// }
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-right.png"
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
RowLayout {
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
AnchorRow {
|
||||
enabled: anchorBackend.verticalCentered;
|
||||
opacity: enabled ? 1 : 0.5
|
||||
|
||||
IconLabel {
|
||||
source: "../HelperWidgets/images/anchor-vertical.png"
|
||||
Layout.alignment: Qt.AlignTop
|
||||
}
|
||||
|
||||
GridLayout {
|
||||
Layout.fillWidth: true
|
||||
rows: 2
|
||||
columns: 2
|
||||
|
||||
Text {
|
||||
text: qsTr("Target")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
TargetComboBox {
|
||||
iconSource: "../HelperWidgets/images/anchor-vertical.png"
|
||||
anchorMargin: backendValues.anchors_verticalCenterOffset
|
||||
targetName: anchorBackend.verticalTarget
|
||||
onCurrentTextChanged: {
|
||||
onTargetChanged: {
|
||||
anchorBackend.verticalTarget = currentText
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
text: qsTr("Margin")
|
||||
color: "#eee"
|
||||
elide: Text.ElideRight
|
||||
Layout.minimumWidth: 40
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
SpinBox {
|
||||
maximumValue: 0xffff
|
||||
minimumValue: -0xffff
|
||||
backendValue: backendValues.anchors_verticalCenterOffset
|
||||
}
|
||||
|
||||
// ButtonRow {
|
||||
// exclusive: true
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-top.png"
|
||||
// }
|
||||
|
||||
// ButtonRowButton {
|
||||
// iconSource: "../HelperWidgets/images/anchor-bottom.png"
|
||||
// }
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,6 @@ Column {
|
||||
}
|
||||
|
||||
TextInputSection {
|
||||
|
||||
showEchoMode: false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,9 @@ Section {
|
||||
anchors.right: parent.right
|
||||
caption: qsTr("Text Input")
|
||||
|
||||
property bool showEchoMode: false
|
||||
id: textInputSection
|
||||
|
||||
SectionLayout {
|
||||
rows: 4
|
||||
columns: 2
|
||||
@@ -52,12 +55,12 @@ Section {
|
||||
}
|
||||
|
||||
Label {
|
||||
visible: showVerticalAlignment
|
||||
visible: textInputSection.showEchoMode
|
||||
text: qsTr("Echo mode")
|
||||
}
|
||||
|
||||
ComboBox {
|
||||
visible: showVerticalAlignment
|
||||
visible: textInputSection.showEchoMode
|
||||
Layout.fillWidth: true
|
||||
backendValue: backendValues.echoMode
|
||||
scope: "TextInput"
|
||||
|
||||
@@ -70,6 +70,7 @@ Column {
|
||||
}
|
||||
|
||||
TextInputSection {
|
||||
showEchoMode: true
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,3 @@
|
||||
# Add more folders to ship with the application, here
|
||||
# DEPLOYMENTFOLDERS #
|
||||
folder_01.source = qml
|
||||
folder_01.target =
|
||||
DEPLOYMENTFOLDERS = folder_01
|
||||
# DEPLOYMENTFOLDERS_END #
|
||||
|
||||
# Additional import path used to resolve QML modules in Creator's code model
|
||||
# QML_IMPORT_PATH #
|
||||
QML_IMPORT_PATH =
|
||||
@@ -12,11 +5,13 @@ QML_IMPORT_PATH =
|
||||
# The .cpp file which was generated for your project. Feel free to hack it.
|
||||
SOURCES += main.cpp
|
||||
|
||||
RESOURCES += qml.qrc
|
||||
|
||||
# Installation path
|
||||
# target.path =
|
||||
|
||||
# Please do not modify the following two lines. Required for deployment.
|
||||
include(../../shared/qtquickapplicationviewer/qtquick1applicationviewer/qtquick1applicationviewer.pri)
|
||||
# REMOVE_NEXT_LINE (wizard will remove the include and append deployment.pri to qtquick1applicationviewer.pri, instead) #
|
||||
include(../../shared/deployment.pri)
|
||||
qtcAddDeployment()
|
||||
|
||||
# Default rules for deployment.
|
||||
include(../../shared/qrcdeployment.pri)
|
||||
|
||||
@@ -8,7 +8,7 @@ int main(int argc, char *argv[])
|
||||
QtQuick1ApplicationViewer viewer;
|
||||
viewer.addImportPath(QLatin1String("modules")); // ADDIMPORTPATH
|
||||
viewer.setOrientation(QtQuick1ApplicationViewer::ScreenOrientationAuto); // ORIENTATION
|
||||
viewer.setMainQmlFile(QLatin1String("qml/main.qml")); // MAINQML
|
||||
viewer.setMainQmlFile(QLatin1String("qrc:///qml/main.qml")); // MAINQML
|
||||
viewer.showExpanded();
|
||||
|
||||
return app.exec();
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<RCC>
|
||||
<qresource prefix="/">
|
||||
<file>qml/main.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
@@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<template openeditor="main.qml" priority="E"
|
||||
featuresRequired="QtSupport.Wizards.FeatureQtQuick.1.1"
|
||||
qrcdeployment="qrcdeployment.pri"
|
||||
viewerdir="qtquick1applicationviewer"
|
||||
viewerclassname="QtQuick1ApplicationViewer"
|
||||
stubversionminor="24">
|
||||
|
||||
|
Before Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 4.8 KiB |
@@ -9,53 +9,13 @@
|
||||
|
||||
#include "qtquick1applicationviewer.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFileInfo>
|
||||
#include <QApplication>
|
||||
#include <QDeclarativeComponent>
|
||||
#include <QDeclarativeEngine>
|
||||
#include <QDeclarativeContext>
|
||||
|
||||
#include <qplatformdefs.h> // MEEGO_EDITION_HARMATTAN
|
||||
|
||||
class QtQuick1ApplicationViewerPrivate
|
||||
{
|
||||
QString mainQmlFile;
|
||||
friend class QtQuick1ApplicationViewer;
|
||||
static QString adjustPath(const QString &path);
|
||||
};
|
||||
|
||||
QString QtQuick1ApplicationViewerPrivate::adjustPath(const QString &path)
|
||||
{
|
||||
#if defined(Q_OS_IOS)
|
||||
if (!QDir::isAbsolutePath(path))
|
||||
return QString::fromLatin1("%1/%2")
|
||||
.arg(QCoreApplication::applicationDirPath(), path);
|
||||
#elif defined(Q_OS_MAC)
|
||||
if (!QDir::isAbsolutePath(path))
|
||||
return QString::fromLatin1("%1/../Resources/%2")
|
||||
.arg(QCoreApplication::applicationDirPath(), path);
|
||||
#elif defined(Q_OS_BLACKBERRY)
|
||||
if (!QDir::isAbsolutePath(path))
|
||||
return QString::fromLatin1("app/native/%1").arg(path);
|
||||
#elif !defined(Q_OS_ANDROID)
|
||||
QString pathInInstallDir =
|
||||
QString::fromLatin1("%1/../%2").arg(
|
||||
QCoreApplication::applicationDirPath(), path);
|
||||
if (QFileInfo(pathInInstallDir).exists())
|
||||
return pathInInstallDir;
|
||||
pathInInstallDir =
|
||||
QString::fromLatin1("%1/%2").arg(
|
||||
QCoreApplication::applicationDirPath(), path);
|
||||
if (QFileInfo(pathInInstallDir).exists())
|
||||
return pathInInstallDir;
|
||||
#endif
|
||||
return path;
|
||||
}
|
||||
|
||||
QtQuick1ApplicationViewer::QtQuick1ApplicationViewer(QWidget *parent)
|
||||
: QDeclarativeView(parent)
|
||||
, d(new QtQuick1ApplicationViewerPrivate())
|
||||
{
|
||||
connect(engine(), SIGNAL(quit()), SLOT(close()));
|
||||
setResizeMode(QDeclarativeView::SizeRootObjectToView);
|
||||
@@ -63,7 +23,6 @@ QtQuick1ApplicationViewer::QtQuick1ApplicationViewer(QWidget *parent)
|
||||
|
||||
QtQuick1ApplicationViewer::~QtQuick1ApplicationViewer()
|
||||
{
|
||||
delete d;
|
||||
}
|
||||
|
||||
QtQuick1ApplicationViewer *QtQuick1ApplicationViewer::create()
|
||||
@@ -73,17 +32,12 @@ QtQuick1ApplicationViewer *QtQuick1ApplicationViewer::create()
|
||||
|
||||
void QtQuick1ApplicationViewer::setMainQmlFile(const QString &file)
|
||||
{
|
||||
d->mainQmlFile = QtQuick1ApplicationViewerPrivate::adjustPath(file);
|
||||
#ifdef Q_OS_ANDROID
|
||||
setSource(QUrl(QLatin1String("assets:/")+d->mainQmlFile));
|
||||
#else
|
||||
setSource(QUrl::fromLocalFile(d->mainQmlFile));
|
||||
#endif
|
||||
setSource(file);
|
||||
}
|
||||
|
||||
void QtQuick1ApplicationViewer::addImportPath(const QString &path)
|
||||
{
|
||||
engine()->addImportPath(QtQuick1ApplicationViewerPrivate::adjustPath(path));
|
||||
engine()->addImportPath(path);
|
||||
}
|
||||
|
||||
void QtQuick1ApplicationViewer::setOrientation(ScreenOrientation orientation)
|
||||
|
||||
@@ -35,9 +35,6 @@ public:
|
||||
void setOrientation(ScreenOrientation orientation);
|
||||
|
||||
void showExpanded();
|
||||
|
||||
private:
|
||||
class QtQuick1ApplicationViewerPrivate *d;
|
||||
};
|
||||
|
||||
#endif // QTQUICK1APPLICATIONVIEWER_H
|
||||
|
||||
@@ -13,11 +13,9 @@
|
||||
</initialWindow>
|
||||
<publisher>PUBLISHER</publisher>
|
||||
<copyright>COPYRIGHT</copyright>
|
||||
<env var="QML_IMPORT_PATH" value="app/native/imports:/usr/lib/qt4/imports"/>
|
||||
<env var="QT_PLUGIN_PATH" value="app/native/plugins:/usr/lib/qt4/plugins"/>
|
||||
<env var="LD_LIBRARY_PATH" value="app/native/lib:/usr/lib/qt4/lib/"/>
|
||||
<arg>-style</arg>
|
||||
<arg>qnxlight</arg>
|
||||
<!-- available styles are bb10dark and bb10bright -->
|
||||
<arg>bb10dark</arg>
|
||||
|
||||
<action system="true">run_native</action>
|
||||
|
||||
|
||||
@@ -17,8 +17,6 @@
|
||||
<image>icon.png</image>
|
||||
</icon>
|
||||
|
||||
<env value="app/native/lib:/usr/lib/qt4/lib/" var="LD_LIBRARY_PATH"/>
|
||||
|
||||
<action system="true">run_native</action>
|
||||
|
||||
<!-- Application assets -->
|
||||
|
||||
@@ -14,12 +14,9 @@
|
||||
<aspectRatio>landscape</aspectRatio>
|
||||
</initialWindow>
|
||||
|
||||
<env var="QML2_IMPORT_PATH" value="app/native/imports"/>
|
||||
<env var="QT_PLUGIN_PATH" value="app/native/plugins"/>
|
||||
<env var="LD_LIBRARY_PATH" value="app/native/lib"/>
|
||||
|
||||
<arg>-platform</arg>
|
||||
<arg>qnx</arg>
|
||||
<env var="QML2_IMPORT_PATH" value="app/native/runtime/qt/qml:/accounts/devuser/qt/qml:$QML2_IMPORT_PATH"/>
|
||||
<env var="QT_PLUGIN_PATH" value="app/native/runtime/qt/plugins:/accounts/devuser/qt/plugins:$QT_PLUGIN_PATH"/>
|
||||
<env var="LD_LIBRARY_PATH" value="app/native/runtime/qt/lib:/accounts/devuser/qt/lib:$LD_LIBRARY_PATH"/>
|
||||
|
||||
<action system="true">run_native</action>
|
||||
|
||||
|
||||
@@ -52,9 +52,10 @@ GridView {
|
||||
property string sourcePrefix: isHelpImage ? "image://helpimage/" : ""
|
||||
|
||||
property string mockupSource: model.imageSource
|
||||
property string helpSource: model.imageUrl !== "" ? sourcePrefix + encodeURI(model.imageUrl) : ""
|
||||
property string helpSource: (model.imageUrl !== "" && model.imageUrl !== undefined) ? sourcePrefix + encodeURI(model.imageUrl) : ""
|
||||
|
||||
imageSource: isVideo ? "" : (model.imageSource === undefined ? delegate.helpSource : delegate.mockupSource)
|
||||
|
||||
imageSource: isVideo ? "" : (model.imageSource === undefined ? helpSource : mockupSource)
|
||||
videoSource: isVideo ? (model.imageSource === undefined ? model.imageUrl : mockupSource) : ""
|
||||
|
||||
caption: model.name;
|
||||
|
||||
@@ -101,6 +101,7 @@ Item {
|
||||
height: expanded ? innerColumn.height + margin * 2 : 0
|
||||
width: delegate.ListView.view.width - 8 - margin * 2
|
||||
opacity: delegate.expanded ? 1 : 0
|
||||
visible: delegate.expanded
|
||||
|
||||
Behavior on height {
|
||||
ParallelAnimation {
|
||||
|
||||
|
Before Width: | Height: | Size: 5.1 KiB |
|
Before Width: | Height: | Size: 7.1 KiB |
|
Before Width: | Height: | Size: 8.9 KiB |
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 5.7 KiB |
@@ -18,7 +18,7 @@ Product {
|
||||
cmd.highlight = "codegen";
|
||||
cmd.onWindows = (product.moduleProperty("qbs", "targetOS").contains("windows"));
|
||||
cmd.sourceCode = function() {
|
||||
var file = new TextFile(input.fileName);
|
||||
var file = new TextFile(input.filePath);
|
||||
var content = file.readAll();
|
||||
// replace quoted quotes
|
||||
content = content.replace(/\\\"/g, '"');
|
||||
@@ -30,7 +30,7 @@ Product {
|
||||
content = content.replace(/(\n#define IDE_VERSION_MAJOR) .+\n/, "$1 " + project.ide_version_major + "\n")
|
||||
content = content.replace(/(\n#define IDE_VERSION_MINOR) .+\n/, "$1 " + project.ide_version_minor + "\n")
|
||||
content = content.replace(/(\n#define IDE_VERSION_RELEASE) .+\n/, "$1 " + project.ide_version_release + "\n")
|
||||
file = new TextFile(output.fileName, TextFile.WriteOnly);
|
||||
file = new TextFile(output.filePath, TextFile.WriteOnly);
|
||||
file.truncate();
|
||||
file.write(content);
|
||||
file.close();
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
#include "Token.h"
|
||||
#include "TranslationUnit.h"
|
||||
#include "Type.h"
|
||||
#include "TypeMatcher.h"
|
||||
#include "Matcher.h"
|
||||
#include "TypeVisitor.h"
|
||||
#include "Templates.h"
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ class QualifiedNameId;
|
||||
class SelectorNameId;
|
||||
|
||||
// types
|
||||
class TypeMatcher;
|
||||
class Matcher;
|
||||
class FullySpecifiedType;
|
||||
class TypeVisitor;
|
||||
class Type;
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "CoreTypes.h"
|
||||
#include "Symbols.h"
|
||||
#include "Names.h"
|
||||
#include "TypeMatcher.h"
|
||||
#include <map>
|
||||
#include <set>
|
||||
#include <algorithm>
|
||||
@@ -479,8 +478,6 @@ public:
|
||||
TranslationUnit *translationUnit;
|
||||
DiagnosticClient *diagnosticClient;
|
||||
|
||||
TypeMatcher matcher;
|
||||
|
||||
LiteralTable<Identifier> identifiers;
|
||||
LiteralTable<StringLiteral> stringLiterals;
|
||||
LiteralTable<NumericLiteral> numericLiterals;
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
|
||||
#include "CoreTypes.h"
|
||||
#include "TypeVisitor.h"
|
||||
#include "TypeMatcher.h"
|
||||
#include "Matcher.h"
|
||||
#include "Names.h"
|
||||
#include <algorithm>
|
||||
|
||||
@@ -37,7 +37,7 @@ bool UndefinedType::isEqualTo(const Type *other) const
|
||||
void UndefinedType::accept0(TypeVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool UndefinedType::matchType0(const Type *otherType, TypeMatcher *matcher) const
|
||||
bool UndefinedType::match0(const Type *otherType, Matcher *matcher) const
|
||||
{
|
||||
if (const UndefinedType *otherUndefinedTy = otherType->asUndefinedType())
|
||||
return matcher->match(this, otherUndefinedTy);
|
||||
@@ -54,7 +54,7 @@ bool VoidType::isEqualTo(const Type *other) const
|
||||
void VoidType::accept0(TypeVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool VoidType::matchType0(const Type *otherType, TypeMatcher *matcher) const
|
||||
bool VoidType::match0(const Type *otherType, Matcher *matcher) const
|
||||
{
|
||||
if (const VoidType *otherVoidTy = otherType->asVoidType())
|
||||
return matcher->match(this, otherVoidTy);
|
||||
@@ -89,7 +89,7 @@ bool PointerToMemberType::isEqualTo(const Type *other) const
|
||||
void PointerToMemberType::accept0(TypeVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool PointerToMemberType::matchType0(const Type *otherType, TypeMatcher *matcher) const
|
||||
bool PointerToMemberType::match0(const Type *otherType, Matcher *matcher) const
|
||||
{
|
||||
if (const PointerToMemberType *otherTy = otherType->asPointerToMemberType())
|
||||
return matcher->match(this, otherTy);
|
||||
@@ -115,7 +115,7 @@ bool PointerType::isEqualTo(const Type *other) const
|
||||
void PointerType::accept0(TypeVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool PointerType::matchType0(const Type *otherType, TypeMatcher *matcher) const
|
||||
bool PointerType::match0(const Type *otherType, Matcher *matcher) const
|
||||
{
|
||||
if (const PointerType *otherTy = otherType->asPointerType())
|
||||
return matcher->match(this, otherTy);
|
||||
@@ -146,7 +146,7 @@ bool ReferenceType::isEqualTo(const Type *other) const
|
||||
void ReferenceType::accept0(TypeVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool ReferenceType::matchType0(const Type *otherType, TypeMatcher *matcher) const
|
||||
bool ReferenceType::match0(const Type *otherType, Matcher *matcher) const
|
||||
{
|
||||
if (const ReferenceType *otherTy = otherType->asReferenceType())
|
||||
return matcher->match(this, otherTy);
|
||||
@@ -178,7 +178,7 @@ bool IntegerType::isEqualTo(const Type *other) const
|
||||
void IntegerType::accept0(TypeVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool IntegerType::matchType0(const Type *otherType, TypeMatcher *matcher) const
|
||||
bool IntegerType::match0(const Type *otherType, Matcher *matcher) const
|
||||
{
|
||||
if (const IntegerType *otherTy = otherType->asIntegerType())
|
||||
return matcher->match(this, otherTy);
|
||||
@@ -199,7 +199,7 @@ FloatType::~FloatType()
|
||||
void FloatType::accept0(TypeVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool FloatType::matchType0(const Type *otherType, TypeMatcher *matcher) const
|
||||
bool FloatType::match0(const Type *otherType, Matcher *matcher) const
|
||||
{
|
||||
if (const FloatType *otherTy = otherType->asFloatType())
|
||||
return matcher->match(this, otherTy);
|
||||
@@ -238,7 +238,7 @@ bool ArrayType::isEqualTo(const Type *other) const
|
||||
void ArrayType::accept0(TypeVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool ArrayType::matchType0(const Type *otherType, TypeMatcher *matcher) const
|
||||
bool ArrayType::match0(const Type *otherType, Matcher *matcher) const
|
||||
{
|
||||
if (const ArrayType *otherTy = otherType->asArrayType())
|
||||
return matcher->match(this, otherTy);
|
||||
@@ -282,7 +282,7 @@ bool NamedType::isEqualTo(const Type *other) const
|
||||
void NamedType::accept0(TypeVisitor *visitor)
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool NamedType::matchType0(const Type *otherType, TypeMatcher *matcher) const
|
||||
bool NamedType::match0(const Type *otherType, Matcher *matcher) const
|
||||
{
|
||||
if (const NamedType *otherTy = otherType->asNamedType())
|
||||
return matcher->match(this, otherTy);
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(TypeVisitor *visitor);
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
virtual bool match0(const Type *otherType, Matcher *matcher) const;
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT VoidType: public Type
|
||||
@@ -62,7 +62,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(TypeVisitor *visitor);
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
virtual bool match0(const Type *otherType, Matcher *matcher) const;
|
||||
};
|
||||
|
||||
class CPLUSPLUS_EXPORT IntegerType: public Type
|
||||
@@ -96,7 +96,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(TypeVisitor *visitor);
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
virtual bool match0(const Type *otherType, Matcher *matcher) const;
|
||||
|
||||
private:
|
||||
int _kind;
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(TypeVisitor *visitor);
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
virtual bool match0(const Type *otherType, Matcher *matcher) const;
|
||||
|
||||
private:
|
||||
int _kind;
|
||||
@@ -151,7 +151,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(TypeVisitor *visitor);
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
virtual bool match0(const Type *otherType, Matcher *matcher) const;
|
||||
|
||||
private:
|
||||
FullySpecifiedType _elementType;
|
||||
@@ -176,7 +176,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(TypeVisitor *visitor);
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
virtual bool match0(const Type *otherType, Matcher *matcher) const;
|
||||
|
||||
private:
|
||||
const Name *_memberName;
|
||||
@@ -202,7 +202,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(TypeVisitor *visitor);
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
virtual bool match0(const Type *otherType, Matcher *matcher) const;
|
||||
|
||||
private:
|
||||
FullySpecifiedType _elementType;
|
||||
@@ -228,7 +228,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(TypeVisitor *visitor);
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
virtual bool match0(const Type *otherType, Matcher *matcher) const;
|
||||
|
||||
private:
|
||||
FullySpecifiedType _elementType;
|
||||
@@ -253,7 +253,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(TypeVisitor *visitor);
|
||||
virtual bool matchType0(const Type *otherType, TypeMatcher *matcher) const;
|
||||
virtual bool match0(const Type *otherType, Matcher *matcher) const;
|
||||
|
||||
private:
|
||||
const Name *_name;
|
||||
|
||||
@@ -245,10 +245,10 @@ void FullySpecifiedType::copySpecifiers(const FullySpecifiedType &type)
|
||||
f._isExplicit = type.f._isExplicit;
|
||||
}
|
||||
|
||||
bool FullySpecifiedType::match(const FullySpecifiedType &otherTy, TypeMatcher *matcher) const
|
||||
bool FullySpecifiedType::match(const FullySpecifiedType &otherTy, Matcher *matcher) const
|
||||
{
|
||||
if (_flags != otherTy._flags)
|
||||
return false;
|
||||
|
||||
return type()->matchType(otherTy.type(), matcher);
|
||||
return Type::match(type(), otherTy.type(), matcher);
|
||||
}
|
||||
|
||||
@@ -106,7 +106,7 @@ public:
|
||||
bool operator != (const FullySpecifiedType &other) const;
|
||||
bool operator < (const FullySpecifiedType &other) const;
|
||||
|
||||
bool match(const FullySpecifiedType &otherTy, TypeMatcher *matcher) const;
|
||||
bool match(const FullySpecifiedType &otherTy, Matcher *matcher) const;
|
||||
|
||||
FullySpecifiedType simplified() const;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include "Literals.h"
|
||||
#include "NameVisitor.h"
|
||||
#include "Matcher.h"
|
||||
#include <cstring>
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
@@ -200,6 +201,13 @@ Identifier::~Identifier()
|
||||
void Identifier::accept0(NameVisitor *visitor) const
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool Identifier::match0(const Name *otherName, Matcher *matcher) const
|
||||
{
|
||||
if (const Identifier *id = otherName->asNameId())
|
||||
return matcher->match(this, id);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Identifier::isEqualTo(const Name *other) const
|
||||
{
|
||||
if (this == other)
|
||||
|
||||
@@ -113,6 +113,7 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(NameVisitor *visitor) const;
|
||||
virtual bool match0(const Name *otherName, Matcher *matcher) const;
|
||||
};
|
||||
|
||||
} // namespace CPlusPlus
|
||||
|
||||
@@ -0,0 +1,311 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 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.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#include "Matcher.h"
|
||||
#include "CoreTypes.h"
|
||||
#include "Symbols.h"
|
||||
#include "Names.h"
|
||||
#include "Literals.h"
|
||||
|
||||
using namespace CPlusPlus;
|
||||
|
||||
Matcher::Matcher()
|
||||
{
|
||||
}
|
||||
|
||||
Matcher::~Matcher()
|
||||
{
|
||||
}
|
||||
|
||||
bool Matcher::match(const Type *type, const Type *otherType, Matcher *matcher)
|
||||
{
|
||||
if (type == otherType)
|
||||
return true;
|
||||
if (!type)
|
||||
return false;
|
||||
|
||||
return type->match0(otherType, matcher);
|
||||
}
|
||||
|
||||
bool Matcher::match(const Name *name, const Name *otherName, Matcher *matcher)
|
||||
{
|
||||
if (name == otherName)
|
||||
return true;
|
||||
if (!name || !otherName)
|
||||
return false;
|
||||
|
||||
return name->match0(otherName, matcher);
|
||||
}
|
||||
|
||||
bool Matcher::match(const UndefinedType *, const UndefinedType *)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const VoidType *, const VoidType *)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const IntegerType *type, const IntegerType *otherType)
|
||||
{
|
||||
if (type == otherType)
|
||||
return true;
|
||||
|
||||
else if (type->kind() != otherType->kind())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const FloatType *type, const FloatType *otherType)
|
||||
{
|
||||
if (type == otherType)
|
||||
return true;
|
||||
|
||||
else if (type->kind() != otherType->kind())
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const PointerToMemberType *type, const PointerToMemberType *otherType)
|
||||
{
|
||||
if (type == otherType)
|
||||
return true;
|
||||
|
||||
else if (! Name::match(type->memberName(), otherType->memberName(), this))
|
||||
return false;
|
||||
|
||||
else if (! type->elementType().match(otherType->elementType(), this))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const PointerType *type, const PointerType *otherType)
|
||||
{
|
||||
if (type == otherType)
|
||||
return true;
|
||||
|
||||
else if (! type->elementType().match(otherType->elementType(), this))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const ReferenceType *type, const ReferenceType *otherType)
|
||||
{
|
||||
if (type == otherType)
|
||||
return true;
|
||||
|
||||
else if (type->isRvalueReference() != otherType->isRvalueReference())
|
||||
return false;
|
||||
|
||||
else if (! type->elementType().match(otherType->elementType(), this))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const ArrayType *type, const ArrayType *otherType)
|
||||
{
|
||||
if (type == otherType)
|
||||
return true;
|
||||
|
||||
else if (type->size() != otherType->size())
|
||||
return false;
|
||||
|
||||
else if (! type->elementType().match(otherType->elementType(), this))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const NamedType *type, const NamedType *otherType)
|
||||
{
|
||||
if (type == otherType)
|
||||
return true;
|
||||
|
||||
else if (! Name::match(type->name(), otherType->name(), this))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const Function *type, const Function *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const Enum *type, const Enum *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const Namespace *type, const Namespace *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const Template *type, const Template *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const ForwardClassDeclaration *type, const ForwardClassDeclaration *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const Class *type, const Class *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const ObjCClass *type, const ObjCClass *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const ObjCProtocol *type, const ObjCProtocol *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const ObjCForwardClassDeclaration *type, const ObjCForwardClassDeclaration *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const ObjCForwardProtocolDeclaration *type, const ObjCForwardProtocolDeclaration *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const ObjCMethod *type, const ObjCMethod *otherType)
|
||||
{
|
||||
if (type != otherType)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const Identifier *name, const Identifier *otherName)
|
||||
{
|
||||
if (name == otherName)
|
||||
return true;
|
||||
return name->equalTo(otherName);
|
||||
}
|
||||
|
||||
bool Matcher::match(const AnonymousNameId *name, const AnonymousNameId *otherName)
|
||||
{
|
||||
return otherName && name->classTokenIndex() == otherName->classTokenIndex();
|
||||
}
|
||||
|
||||
bool Matcher::match(const TemplateNameId *name, const TemplateNameId *otherName)
|
||||
{
|
||||
const Identifier *l = name->identifier();
|
||||
const Identifier *r = otherName->identifier();
|
||||
if (! match(l, r))
|
||||
return false;
|
||||
if (name->templateArgumentCount() != otherName->templateArgumentCount())
|
||||
return false;
|
||||
for (unsigned i = 0, ei = name->templateArgumentCount(); i != ei; ++i) {
|
||||
const FullySpecifiedType &l = name->templateArgumentAt(i);
|
||||
const FullySpecifiedType &r = otherName->templateArgumentAt(i);
|
||||
if (! l.match(r, this))
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Matcher::match(const DestructorNameId *name, const DestructorNameId *otherName)
|
||||
{
|
||||
return Name::match(name->name(), otherName->name(), this);
|
||||
}
|
||||
|
||||
bool Matcher::match(const OperatorNameId *name, const OperatorNameId *otherName)
|
||||
{
|
||||
return name->kind() == otherName->kind();
|
||||
}
|
||||
|
||||
bool Matcher::match(const ConversionNameId *name, const ConversionNameId *otherName)
|
||||
{
|
||||
return name->type().match(otherName->type(), this);
|
||||
}
|
||||
|
||||
bool Matcher::match(const QualifiedNameId *name, const QualifiedNameId *otherName)
|
||||
{
|
||||
if (Name::match(name->base(), otherName->base(), this))
|
||||
return Name::match(name->name(), otherName->name(), this);
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Matcher::match(const SelectorNameId *name, const SelectorNameId *otherName)
|
||||
{
|
||||
const unsigned nc = name->nameCount();
|
||||
if (name->hasArguments() != otherName->hasArguments() ||
|
||||
nc != otherName->nameCount())
|
||||
return false;
|
||||
for (unsigned i = 0; i < nc; ++i)
|
||||
if (!Name::match(name->nameAt(i), otherName->nameAt(i), this))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/****************************************************************************
|
||||
**
|
||||
** Copyright (C) 2014 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.
|
||||
**
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef TYPEMATCHER_H
|
||||
#define TYPEMATCHER_H
|
||||
|
||||
#include "CPlusPlusForwardDeclarations.h"
|
||||
|
||||
namespace CPlusPlus {
|
||||
|
||||
class CPLUSPLUS_EXPORT Matcher
|
||||
{
|
||||
Matcher(const Matcher &other);
|
||||
void operator = (const Matcher &other);
|
||||
|
||||
public:
|
||||
Matcher();
|
||||
virtual ~Matcher();
|
||||
|
||||
static bool match(const Type *type, const Type *otherType, Matcher *matcher);
|
||||
static bool match(const Name *name, const Name *otherName, Matcher *matcher);
|
||||
|
||||
virtual bool match(const UndefinedType *type, const UndefinedType *otherType);
|
||||
virtual bool match(const VoidType *type, const VoidType *otherType);
|
||||
virtual bool match(const IntegerType *type, const IntegerType *otherType);
|
||||
virtual bool match(const FloatType *type, const FloatType *otherType);
|
||||
virtual bool match(const PointerToMemberType *type, const PointerToMemberType *otherType);
|
||||
virtual bool match(const PointerType *type, const PointerType *otherType);
|
||||
virtual bool match(const ReferenceType *type, const ReferenceType *otherType);
|
||||
virtual bool match(const ArrayType *type, const ArrayType *otherType);
|
||||
virtual bool match(const NamedType *type, const NamedType *otherType);
|
||||
|
||||
virtual bool match(const Function *type, const Function *otherType);
|
||||
virtual bool match(const Enum *type, const Enum *otherType);
|
||||
virtual bool match(const Namespace *type, const Namespace *otherType);
|
||||
virtual bool match(const Template *type, const Template *otherType);
|
||||
virtual bool match(const ForwardClassDeclaration *type, const ForwardClassDeclaration *otherType);
|
||||
virtual bool match(const Class *type, const Class *otherType);
|
||||
virtual bool match(const ObjCClass *type, const ObjCClass *otherType);
|
||||
virtual bool match(const ObjCProtocol *type, const ObjCProtocol *otherType);
|
||||
virtual bool match(const ObjCForwardClassDeclaration *type, const ObjCForwardClassDeclaration *otherType);
|
||||
virtual bool match(const ObjCForwardProtocolDeclaration *type, const ObjCForwardProtocolDeclaration *otherType);
|
||||
virtual bool match(const ObjCMethod *type, const ObjCMethod *otherType);
|
||||
|
||||
virtual bool match(const Identifier *name, const Identifier *otherName);
|
||||
virtual bool match(const AnonymousNameId *name, const AnonymousNameId *otherName);
|
||||
virtual bool match(const TemplateNameId *name, const TemplateNameId *otherName);
|
||||
virtual bool match(const DestructorNameId *name, const DestructorNameId *otherName);
|
||||
virtual bool match(const OperatorNameId *name, const OperatorNameId *otherName);
|
||||
virtual bool match(const ConversionNameId *name, const ConversionNameId *otherName);
|
||||
virtual bool match(const QualifiedNameId *name, const QualifiedNameId *otherName);
|
||||
virtual bool match(const SelectorNameId *name, const SelectorNameId *otherName);
|
||||
};
|
||||
|
||||
} // namespace CPlusPlus
|
||||
|
||||
#endif // TYPEMATCHER_H
|
||||
@@ -19,6 +19,7 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "Literals.h"
|
||||
#include "Matcher.h"
|
||||
#include "Name.h"
|
||||
#include "Names.h"
|
||||
#include "NameVisitor.h"
|
||||
@@ -57,6 +58,11 @@ bool Name::isQualifiedNameId() const
|
||||
bool Name::isSelectorNameId() const
|
||||
{ return asSelectorNameId() != 0; }
|
||||
|
||||
bool Name::match(const Name *name, const Name *otherName, Matcher *matcher)
|
||||
{
|
||||
return Matcher::match(name, otherName, matcher);
|
||||
}
|
||||
|
||||
void Name::accept(NameVisitor *visitor) const
|
||||
{
|
||||
if (visitor->preVisit(this))
|
||||
|
||||
@@ -53,7 +53,9 @@ public:
|
||||
virtual const QualifiedNameId *asQualifiedNameId() const { return 0; }
|
||||
virtual const SelectorNameId *asSelectorNameId() const { return 0; }
|
||||
|
||||
virtual bool isEqualTo(const Name *other) const = 0;
|
||||
virtual bool isEqualTo(const Name *other) const = 0; // TODO: remove me
|
||||
|
||||
static bool match(const Name *name, const Name *otherName, Matcher *matcher);
|
||||
|
||||
void accept(NameVisitor *visitor) const;
|
||||
static void accept(const Name *name, NameVisitor *visitor);
|
||||
@@ -65,6 +67,10 @@ public:
|
||||
|
||||
protected:
|
||||
virtual void accept0(NameVisitor *visitor) const = 0;
|
||||
|
||||
protected: // for Matcher
|
||||
friend class Matcher;
|
||||
virtual bool match0(const Name *otherName, Matcher *matcher) const = 0;
|
||||
};
|
||||
|
||||
} // namespace CPlusPlus
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
// THE SOFTWARE.
|
||||
|
||||
#include "Names.h"
|
||||
#include "Matcher.h"
|
||||
#include "NameVisitor.h"
|
||||
#include "Literals.h"
|
||||
#include <algorithm>
|
||||
@@ -32,6 +33,13 @@ QualifiedNameId::~QualifiedNameId()
|
||||
void QualifiedNameId::accept0(NameVisitor *visitor) const
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool QualifiedNameId::match0(const Name *otherName, Matcher *matcher) const
|
||||
{
|
||||
if (const QualifiedNameId *name = otherName->asQualifiedNameId())
|
||||
return matcher->match(this, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
const Identifier *QualifiedNameId::identifier() const
|
||||
{
|
||||
if (const Name *u = name())
|
||||
@@ -71,6 +79,13 @@ DestructorNameId::~DestructorNameId()
|
||||
void DestructorNameId::accept0(NameVisitor *visitor) const
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool DestructorNameId::match0(const Name *otherName, Matcher *matcher) const
|
||||
{
|
||||
if (const DestructorNameId *name = otherName->asDestructorNameId())
|
||||
return matcher->match(this, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
const Name *DestructorNameId::name() const
|
||||
{ return _name; }
|
||||
|
||||
@@ -96,6 +111,13 @@ TemplateNameId::~TemplateNameId()
|
||||
void TemplateNameId::accept0(NameVisitor *visitor) const
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool TemplateNameId::match0(const Name *otherName, Matcher *matcher) const
|
||||
{
|
||||
if (const TemplateNameId *other = otherName->asTemplateNameId())
|
||||
return matcher->match(this, other);
|
||||
return false;
|
||||
}
|
||||
|
||||
const Identifier *TemplateNameId::identifier() const
|
||||
{ return _identifier; }
|
||||
|
||||
@@ -117,7 +139,7 @@ bool TemplateNameId::isEqualTo(const Name *other) const
|
||||
return false;
|
||||
if (templateArgumentCount() != t->templateArgumentCount())
|
||||
return false;
|
||||
for (unsigned i = 0; i < templateArgumentCount(); ++i) {
|
||||
for (unsigned i = 0, ei = templateArgumentCount(); i != ei; ++i) {
|
||||
const FullySpecifiedType &l = _templateArguments[i];
|
||||
const FullySpecifiedType &r = t->_templateArguments[i];
|
||||
if (! l.isEqualTo(r))
|
||||
@@ -171,6 +193,13 @@ OperatorNameId::~OperatorNameId()
|
||||
void OperatorNameId::accept0(NameVisitor *visitor) const
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool OperatorNameId::match0(const Name *otherName, Matcher *matcher) const
|
||||
{
|
||||
if (const OperatorNameId *name = otherName->asOperatorNameId())
|
||||
return matcher->match(this, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
OperatorNameId::Kind OperatorNameId::kind() const
|
||||
{ return _kind; }
|
||||
|
||||
@@ -198,6 +227,13 @@ ConversionNameId::~ConversionNameId()
|
||||
void ConversionNameId::accept0(NameVisitor *visitor) const
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool ConversionNameId::match0(const Name *otherName, Matcher *matcher) const
|
||||
{
|
||||
if (const ConversionNameId *name = otherName->asConversionNameId())
|
||||
return matcher->match(this, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
FullySpecifiedType ConversionNameId::type() const
|
||||
{ return _type; }
|
||||
|
||||
@@ -221,6 +257,13 @@ SelectorNameId::~SelectorNameId()
|
||||
void SelectorNameId::accept0(NameVisitor *visitor) const
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool SelectorNameId::match0(const Name *otherName, Matcher *matcher) const
|
||||
{
|
||||
if (const SelectorNameId *name = otherName->asSelectorNameId())
|
||||
return matcher->match(this, name);
|
||||
return false;
|
||||
}
|
||||
|
||||
const Identifier *SelectorNameId::identifier() const
|
||||
{
|
||||
if (_names.empty())
|
||||
@@ -276,6 +319,13 @@ unsigned AnonymousNameId::classTokenIndex() const
|
||||
void AnonymousNameId::accept0(NameVisitor *visitor) const
|
||||
{ visitor->visit(this); }
|
||||
|
||||
bool AnonymousNameId::match0(const Name *otherName, Matcher *matcher) const
|
||||
{
|
||||
if (const AnonymousNameId *id = otherName->asAnonymousNameId())
|
||||
return matcher->match(this, id);
|
||||
return false;
|
||||
}
|
||||
|
||||
const Identifier *AnonymousNameId::identifier() const
|
||||
{ return 0; }
|
||||
|
||||
|
||||