Merge remote-tracking branch 'origin/2.2'

This commit is contained in:
Oswald Buddenhagen
2011-03-15 18:01:35 +01:00
94 changed files with 1777 additions and 2347 deletions

96
dist/changes-2.2.0 vendored
View File

@@ -9,20 +9,107 @@ git log --cherry-pick --pretty=oneline origin/master...origin/2.1
General
* Added support for running user defined external tools (Tools->External)
* Moved toolchain definitions out of Qt versions. You can now define
toolchains in Tools->Options->ToolChains. Creator now supports
more than one instance of each kind of toolchain.
Editing
* Add new Inkpot color scheme
* Moved 'Open in External Editor' to Tools->External->Text
* Add UTF-8 BOM support
Project Support
* QMake project support should be more robust against syntax errors
* Treatment of command line arguments of processes started from build
and run configurations underwent heavy modifications:
- argument lists use native shell syntax; this affects quoting and
environment variable expansion most
- the SOURCEDIR and BUILDDIR environment variables were replaced
with %{sourceDir} and %{buildDir} macros
- this affects working directories and executable paths as well
Debugging
* Rewrote debugging engine using the Microsoft Console Debugger (CDB)
for debugging executables built with Microsoft Visual Studio,
resulting in significant speed-up and better display of data
types, supporting both 32bit and 64bit versions of the
Debugging Tools for Windows.
* Made it possible to pin debugger tooltips.
* Reworked global architecture to allow multiple debugging sessions (for
different projects, combined Qml/C++ debugging, project 'snapshots', ...)
* Reworked breakpoint handling: new special breakpoint types for "break
on throw", "break on main", data breakpoints.
* Introduce combined c++/qml debugging (combined stack, cross-step)
* Rework per-type and per-item selection of display formats
* New dumpers for QTextCursor, QTextDocument, __m128, QScriptValue
QBasicAtomicPointer, bit fields, boost::shared_ptr
* Improve dumpers for QRegion, QVariant (custom types), QSharedPointer,
QMultiMap (QTCREATORBUG-3122), QObject, QWeakPointer
* Make alphabetic structure member sorting optional
* Make dumpers robust in case of missing debug information
* Improve python dumper profiling support
* Improve stepping performance
* Enable breakpoint setting from a disassembler view, QTCREATORBUG-3667
* Fix display of shadowed variables.
* Fix display of data containing quoote characters, QTCREATORBUG-3084
* Fix display of C style 'typedef struct X { ... } X;
* Fix stack/break view updates after manual module loading, QTCREATORBUG-3427
* Fix 'Jump To/Run to' when in instruction-wise mode
* Several fixed to the "watcher" handling
* Allow re-running debugger engines, QTCREATORBUG-3073
* Robust process control after -exec-interrupt errors, QTCREATORBUG-2850
* Robust detection of Qt-in-namespace builds
* Handle "live updates" in the memory view
* Make memory view writable
* Improve starting debugger session directly from the command line
BinEditor:
* Visualize data differences after updates
* Fix selection if cursor is left of anchor
* Allow copying also if selection is "backwards"
* Do not draw blinking cursor when there is a selection
Help
C++ Support
* Add QuickFix for implementing setters/getters for a Q_PROPERTY
* Add documentation about QuickFixes
* Fix switch statement indentation for GNU and Whitesmiths
style, QTCREATORBUG-2994
* Fix indentation of labels
QML/JS Support
* Gui cosmetics in JS debugger: Show stack frame level, only valid
line numbers in stack view, do not show function code, show dummy
child entry for empty arrays
* Add wizard for creating JavaScript files, QTCREATORBUG-3070
* Add local-file completion for url properties, QTCREATORBUG-2619
* Add warning about invalid files in url properties
* Add file name completion in imports, QTCREATORBUG-3067
* Add a locator filter for JS functions, QTCREATORBUG-2607
* Add JSlint-style warnings about common JS pitfalls, QTCREATORBUG-3071
* Add completion for attached properties like Component.onCompleted
* Allow QML modules to ship predumped type description files.
* Reenable instantiating component scope detection, QTCREATORBUG-2835
* Improve error reporting of failed plugin dumps
* Complete a trailing '{' for 'A on b' object bindings, QTCREATORBUG-2642
* Highlight capitalized types, QTCREATORBUG-2658
* Re-dump a plugin if the shared library/dll changes, QTCREATORBUG-3047
* Build qmldump in debug and release version on Windows, QTCREATORBUG-3549
* Change qmldump to output QML instead of XML
* Fix automatic '.' import to also pick up QML modules, QTCREATORBUG-3768
* Fix code model update when files are renamed, QTCREATORBUG-2986
* Fix incorrect completion when brace is on separate line, QTCREATORBUG-2658
* Fix quote autoinsertion in string literals, QTCREATORBUG-2155, QTCREATORBUG-3244
* Fix '{' not being an electric character, QTCREATORBUG-3405
* Fix indentation of 'foo: Namesp.Type {', QTCREATORBUG-3371
FakeVim:
* Implement Ctrl-N/Ctrl-P
* Implement 's' in visual block mode
* Fix Alt-Gr handling on Windows
* Handle more Ctrl-W + <x> commands
Platform Specific
@@ -33,6 +120,7 @@ Linux (GNOME and KDE)
Windows
Symbian Target
* Added support for the new on-device debugging agent (CODA)
Maemo Target
@@ -41,6 +129,14 @@ Designer
Version control plugins
Wizards
* Support new keywords %MONTH% and %DAY% for C++ template file
Misc
* Create infrastructure to setup "soft dependencies" between plugins
* Add a little tool 'qtpromaker' doing the job of 'qmake -project', but
much faster to make Qt Creator usable to quickly inspect and navigate
"alien" codebases a way to easily set up dummy .pro files is needed.
* Start documenting Qt Creator's coding style guidelines
Additional credits go to:
* The Inkpot color scheme was based on the Vim color scheme by

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 58 KiB

View File

@@ -130,15 +130,17 @@
\o \l{Debugging the Example Application}
\o \l{Interacting with the Debugger}
\o \l{Setting Up Debugger}
\o \l{Debugger Modes of Operation}
\o \l{Launching the Debugger in Different Modes}
\o \l{Using Debugging Helpers}
\o \l{Debugging Qt Quick Projects}
\o \l{Troubleshooting Debugger}
\endlist
\o \l{Using the Maemo Emulator}
\o \l{Deploying Applications to Mobile Devices}
\list
\o \l{Deploying Applications to Symbian Devices}
\o \l{Deploying Applications to Maemo Devices}
\o \l{Publishing Maemo Applications to Extras-devel}
\o \l{Publishing Applications to Ovi Store}
\o \l{Building with Remote Compiler}
\endlist
@@ -1165,7 +1167,7 @@
\image qmldesigner-qml-components.png "QML Components pane"
The \gui {Resources} pane displays the images and other files that you copy to
the project folder.
the project folder (to the same subfolder as the QML files).
\section1 Specifying Element Properties
@@ -2924,7 +2926,7 @@
select the type of your
project.
The contents of the wizard dialogs depend on the project type and
the build targets that you select in the \gui {Qt Versions} dialog.
the build targets that you select in the \gui {Target Setup} dialog.
Follow the instructions of the wizard.
For examples of creating different types of projects, see
@@ -3070,7 +3072,7 @@
installed on the development PC. Select the Qt versions that you want to use to build
the project for each target.
\image qtcreator-open-project-targets.png "Qt Versions dialog"
\image qtcreator-open-project-targets.png "Target Setup dialog"
The status \gui New indicates that Qt Creator did not find an existing build
for a particular development environment (Qt version) and target. Therefore,
@@ -4133,7 +4135,7 @@
The tool tip of the target selector shows more details about the actual
device that will be used when you run your application.
\o Start the \gui{App TRK} application on your device.
\o Start the debugging agent (CODA or App TRK) application on your device.
\o Click the \gui Run button.
@@ -4153,10 +4155,10 @@
\o The Nokia USB drivers that come with \e{PC Suite} or \e{Ovi Suite}
have been installed on the development PC.
\o The device is connected through USB cable in \e{PC Suite} mode.
\o \gui{App TRK} is running on the device, using the USB connection,
\o The debugging agent (CODA or App TRK) is running on the device, using
the USB connection,
with the status \e connected.
\o The device is detected and selected in the run configuration
details.
\o The device is detected and selected in the \gui {Run Settings}.
\endlist
If this does not help to solve your problem, search the qt-creator@trolltech.com
@@ -4474,7 +4476,7 @@
You can also pass command line arguments to your application on the device.
Press the \gui{Device info button} to get more information about the selected
device, such as the CPU type and the running TRK version.
device, such as the CPU type and the running debugging agent version.
\image qtcreator-symbian-run-settings.png "Run settings for Symbian devices"
@@ -4565,7 +4567,7 @@
\contentspage index.html
\previouspage creator-deployment-symbian.html
\page creator-deployment-maemo.html
\nextpage creator-publish-ovi.html
\nextpage creator-publishing-to-maemo-extras.html
\title Deploying Applications to Maemo Devices
@@ -4609,7 +4611,8 @@
in the \gui {Package version} field.
You can specify information that users see on a delivery channel, such as
Ovi Store. You can specify a short description of the application, package
Ovi Store or Maemo.org. You can specify a short description of the
application, package
name, and application icon.
The Debian control file contains an application icon in encoded form. To add the
@@ -4632,6 +4635,73 @@
*/
/*!
\contentspage index.html
\previouspage creator-deployment-maemo.html
\page creator-publishing-to-maemo-extras.html
\nextpage creator-publish-ovi.html
\title Publishing Maemo Applications to Extras-devel
Extras is the primary repository for Maemo applications where most
community software can be found. You can browse the applications available
in Extras at \l{http://maemo.org/downloads/Maemo5/}{Maemo Downloads}.
You can publish both free and commercial applications to Extras. Free
applications must be open source and pass through a QA process.
Commercial applications are usually closed, binary only, and the publisher
is responsible for assuring their quality and security.
You can upload free applications as Debian packages to
\l{http://wiki.maemo.org/Extras-devel}{Extras-devel} at Maemo.org to share
new updates to your application and to start the community QA process.
You need a \l{https://garage.maemo.org/}{Garage} account for the uploads,
but the package itself does not need to be hosted in the Garage.
You can use the \gui {Publish for Fremantle Extras-devel Free Repository}
wizard to create a source archive and, optionally, upload it to a build
server for compiling and packaging. The package is then moved to the
Extras-devel repository. From there on, you must follow the standard
Maemo processes to get the application published to Extras.
The wizard checks that the package contains all the information that is
required to publish applications on Extras: package description and
Package Manager icon. For more information about entering this information,
see \l{Creating Debian Installation Packages}.
To use the publishing wizard:
\list 1
\o Select the \gui {Maemo5} build target for your project.
\o Choose \gui {Build > Publish Project}.
\o Select \gui {Publish for Fremantle Extras-devel Free Repository},
and then select \gui {Start Wizard}.
\o Select the Qt version and device type to build against and click
\gui Next.
To create a source archive without uploading it to the build
server, select the \gui {Only create source package, do not upload}
check box.
\o In the \gui {Garage account name} field, enter your login name, or
select \gui {Get an account} to create a new account.
\image qtcreator-publish-maemo-extras.png "Upload Settings dialog"
You can also select \gui {Request upload rights} to use the Maemo
Extras Assistant to validate your Garage account.
\o Select \gui Commit to publish the application.
\endlist
*/
/*!
\contentspage index.html
\previouspage creator-maemo-emulator.html
@@ -4654,6 +4724,7 @@
\list
\o \l{Deploying Applications to Symbian Devices}
\o \l{Deploying Applications to Maemo Devices}
\o \l{Publishing Maemo Applications to Extras-devel}
\o \l{Publishing Applications to Ovi Store}
\o \l{Building with Remote Compiler}
\endlist
@@ -5007,17 +5078,32 @@
/*!
\contentspage index.html
\previouspage creator-deployment-maemo.html
\previouspage creator-publishing-to-maemo-extras.html
\page creator-publish-ovi.html
\nextpage creator-remote-compiler.html
\title Publishing Applications to Ovi Store
Ovi Store is the global content market of Nokia, which reaches millions of
people worldwide. Consumers can access Ovi Store through either of these
platforms:
\list
\o Ovi Store applications on mobile devices
\o Web browsers on desktop computers, laptops, netbooks, and tablets
\endlist
Consumers have access to a wide selection of content and can download
content in a few easy clicks.
The process and requirements to publish Qt applications to Ovi Store are
described in the
\l {http://wiki.forum.nokia.com/index.php/Guide_to_Publishing_Qt_Applications_to_the_Ovi_Store}{Guide to Publishing Qt Applications to the Ovi Store} wiki.
This section describes how to use Qt Creator publishing wizards to
This section describes how to
generate installation packages that
you can publish to Ovi Store.
@@ -5262,9 +5348,9 @@
\o In the \gui {Create in} field, enter the path for the project files. For example,
\c {C:\Qt\examples}, and then click \gui{Next}.
The \gui{Qt Versions} dialog opens.
The \gui{Target Setup} dialog opens.
\image qtcreator-mobile-project-qt-versions.png "Qt Versions dialog"
\image qtcreator-mobile-project-qt-versions.png "Target Setup dialog"
\o Select \gui Maemo, \gui {Qt Simulator}, and \gui {Symbian Device} targets,
and click \gui{Next}.
@@ -5282,7 +5368,7 @@
and landscape, and then click \gui{Next}.
\note This dialog opens only if you select \gui Maemo5 or
\gui {Symbian Device} target in the \gui {Qt Versions} dialog.
\gui {Symbian Device} target in the \gui {Target Setup} dialog.
The \gui {Symbian Specific} dialog opens.
@@ -5449,11 +5535,11 @@
\list 1
\o Install Qt libraries, Qt mobile libraries, and the TRK
debugging application on the device. For more information,
\o Install Qt libraries, Qt mobile libraries, and a
debugging agent on the device. For more information,
see \l{Setting Up Development Environment for Symbian}.
\o Start TRK on the device.
\o Start the debugging agent, App TRK or CODA, on the device.
\o Click the \gui {Target Selector} and select \gui {Symbian Device}.
@@ -5508,7 +5594,7 @@
to build the application and run it in Qt Simulator.
\o To see the compilation progress, press \key{Alt+4} to open the
\gui Compile Output pane.
\gui {Compile Output} pane.
The \gui Build progress bar on the toolbar turns green when the project
is successfully built. The application opens in Qt Simulator.
@@ -5522,7 +5608,7 @@
mobile functions and create your own scripts.
\o To test the application on a Symbian device, install Qt libraries
and the TRK debugging application on the device. For more information,
and a debugging agent on the device. For more information,
see \l{Setting Up Development Environment for Symbian}.
\o Click the \gui {Target Selector} and select \gui {Symbian Device}.
@@ -5578,7 +5664,7 @@
screen and two empty rectangles.
To use the states.png image in your application, you must copy it to the project
directory from the examples directory in the
directory (same subdirectory as the QML file) from the examples directory in the
Qt installation directory. For example:
\c {C:\QtSDK\Examples\4.7\declarative\animation\states}. The image appears
in the \gui Resources pane. You can also use any other image or a QML element, instead.
@@ -5876,9 +5962,9 @@
\o In the \gui {Create in} field, enter the path for the project files. For example,
\c {C:\Qt\examples}, and then click \gui{Next}.
The \gui {Qt Versions} dialog opens.
The \gui {Target Setup} dialog opens.
\image qtcreator-new-project-qt-versions-qt-gui.png "Qt Versions dialog"
\image qtcreator-new-project-qt-versions-qt-gui.png "Target Setup dialog"
\o Select the Qt versions to use as build targets for your project, and click
\gui{Next}.
@@ -6792,12 +6878,13 @@
requirements for installation. Typically, the interaction between Qt Creator
and the native debugger is set up automatically and you do not need to do anything.
\o \l{Debugger Modes of Operation} describes the operating modes in which the
\o \l{Launching the Debugger in Different Modes} describes the operating modes in which the
debugger plugin runs, depending on where and how the process is started and run.
\o \l{Using Debugging Helpers} describes how to get more detailed data
on complex data.
\o \l{Debugging Qt Quick Projects} describes how to debug Qt Quick projects.
\endlist
@@ -6810,7 +6897,7 @@
\page creator-debugger-operating-modes.html
\nextpage creator-debugging-helpers.html
\title Debugger Modes of Operation
\title Launching the Debugger in Different Modes
The debugger plugin runs in different operating modes depending on where and
how the process is started and run. Some of the modes are only available for
@@ -6834,14 +6921,14 @@
\o \bold Post-mortem to debug crashed processes on Windows.
\o \bold TRK to debug processes running on a Symbian device.
\o \bold On-device to debug processes running on a mobile device.
\endlist
\note Debugging QML and JavaScript is supported only in plain mode.
When you click the \gui {Start Debugging} button, the debugger is launched
in the appropriate operating mode (plain, terminal, or TRK), based on the
in the appropriate operating mode (plain, terminal, or on-device), based on the
build and run settings for the active project. Select \gui Debug menu options
to launch the debugger in the other modes.
@@ -6899,18 +6986,16 @@
on Windows. Click the \gui {Debug in Qt Creator} button in the error message
that is displayed by the Windows operating system.
\section2 TRK Mode
\section2 On-device Mode
The TRK mode is a special mode available only for Symbian. It
debugs processes running on a Symbian
device using the App TRK application that runs on the device.
To launch the debugger in the TRK mode, open the project, select Symbian as the
target, and click the \gui {Start Debugging} button.
For more information on setting up Symbian projects, see
\l{Setting Up Development Environment for Symbian}.
The on-device mode is a special mode available for run configurations
targeting mobile devices. It debugs processes running on mobile
devices using on-device debugging agents, such as CODA on Symbian and
gdbserver on Maemo and MeeGo.
To launch the debugger in the on-device mode, open the project, select a
run configuration that targets a mobile device, and click the
\gui {Start Debugging} button.
*/
@@ -7001,16 +7086,16 @@
\o gcc
\o gdb
\o Yes
\o TRK
\o On-device
\row
\o Maemo
\o gcc
\o gdb
\o Yes
\o Remote
\o On-device
\endtable
For more information on the debugger modes, see \l{Debugger Modes of Operation}.
For more information on the debugger modes, see \l{Launching the Debugger in Different Modes}.
\omit
@@ -7038,9 +7123,10 @@
\o RemoteGdbAdapter interacts with the gdbserver running on Linux.
\o TrkGdbAdapter interacts with Symbian devices. The gdb protocol and
the gdb serial protocol are used between gdb and the adapter. The TRK
protocol is used between the adapter and AppTRK running on the device.
\o CodaGdbAdapter interacts with Symbian devices. The gdb protocol and
the gdb serial protocol are used between gdb and the adapter. The
target communication framework (TCF) protocol is used between the
adapter and the CODA debugging agent running on the device.
\endlist
@@ -7062,23 +7148,26 @@
\o Notes
\row
\o Gdb
\o On Linux, install version 7.0.1, 7.1, or preferably, 7.2 or
later. On Mac OS X, install Apple gdb version 6.3.50-20050815
(build 1344) or later.
\o On Linux and Windows, use the Python-enabled gdb versions that
are installed when you install Qt Creator and Qt SDK. On Mac OS X,
use the gdb provided with Xcode.
For a custom target, you can build your own Python-enabled gdb.
Follow the instructions on
\l{http://developer.qt.nokia.com/wiki/QtCreatorBuildGdb}{Building Gdb}.
\row
\o Debugging tools for Windows
\o Using this engine requires you to install the
\e{Debugging tools for Windows}
\l{http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx}{32-bit}
\l{http://www.microsoft.com/whdc/devtools/debugging/installx86.Mspx}
or
\l{http://www.microsoft.com/whdc/devtools/debugging/install64bit.Mspx}{64-bit}
\l{http://www.microsoft.com/whdc/devtools/debugging/install64bit.Mspx}
package (Version 6.11.1.404 for the 32-bit or the 64-bit version
of Qt Creator, respectively),
which is freely available for download from the
\l{http://msdn.microsoft.com/en-us/default.aspx}
which are freely available for download from the
\l{http://msdn.microsoft.com/en-us/default.aspx}{Microsoft Developer Network}.
{Microsoft Developer Network}. The Qt Creator help browser does
The Qt Creator help browser does
not allow you to download files, and therefore, you must copy
the above links to a browser.
@@ -7108,12 +7197,12 @@
flag in your run configuration, in \gui Projects mode. In the run
configuration, select \gui{Use debug version of frameworks}.
For more detailed information about debugging on the Mac, see:
\l http://developer.apple.com/mac/library/technotes/tn2004/tn2124.html
For more detailed information about debugging on the Mac OS X, see:
\l{http://developer.apple.com/mac/library/technotes/tn2004/tn2124.html}{Mac OS X Debugging Magic}.
\note The Mac OS X Snow Leopard (10.6) has a bug, that can be worked
around as described in the link provided below:
\l http://bugreports.qt.nokia.com/browse/QTBUG-4962.
\note The Mac OS X Snow Leopard (10.6) has a bug that might cause the
application to crash. For a workaround, see:
\l{http://bugreports.qt.nokia.com/browse/QTBUG-4962}{QTBUG-4962}.
\endtable
@@ -7175,9 +7264,9 @@
features (like QtWebKit) are used.
The debugger is launched in the appropriate operating mode (plain, terminal,
or TRK), based on the build and run settings for the active project.
or on-device), based on the build and run settings for the active project.
Select \gui Debug menu options to launch the debugger in other modes.
For more information, see \l{Debugger Modes of Operation}.
For more information, see \l{Launching the Debugger in Different Modes}.
\note Debugging QML and JavaScript is supported only in plain mode.
@@ -7567,6 +7656,36 @@
\section1 Debugging Helpers Based on Python
Qt Creator uses gdb builds that enable Python scripting to display
information in the \gui {Locals and Watchers} view. When Python scripting
is used, code (Debugging helpers) does not need to be injected into the
debugged process to nicely display QStringList or \c std::map contents, for
example.
The code injection caused problems and put an extra stress on the debugged
process. You can now easily extend the debugging helpers to other types. No
compilation is required, just adding a few lines of Python.
Python scripting vastly reduces the communication overhead compared
with the previous solution. However, there are some obstacles:
\list
\o There is no Python-enabled gdb for Mac OS. Mac OS continues
injection with C++ based debugging helpers.
\o On the Symbian platform, an on-device debugging agent restricts the
communication between gdb and the device. Therefore, extracting
QObject properties, for example, is not possible.
\o There is no gdb to communicate with MSVC compiled applications on
Windows. So information can be displayed nicely only in a limited
fashion by using a cdb extension DLL.
\endlist
\section2 Extending the Python Based Debugging Helpers
On platforms featuring a Python-enabled version of the gdb debugger,
the data extraction is done by a Python script. This is more robust
as the script execution is separated from the debugged process. It
@@ -7786,7 +7905,8 @@
Uses gdb to call the function \c func on the value specified by
\a {item.value} and output the resulting item. This function is
not available when debugging core dumps and it is not available
on the Symbian platform due to restrictions imposed by AppTRK.
on the Symbian platform due to restrictions imposed by the on-device
debugging agent.
\o \gui{putItem(self, item)} - The "master function", handling
basic types, references, pointers and enums directly, iterates
@@ -7848,6 +7968,17 @@
\note QML Observer requires Qt 4.7.1 or later.
\section1 Enabling Debugging Helpers for Qt's Bootstrapped Applications
Qt's bootstrapped applications (such as moc and qmake) are built in a way
that is incompatible with the default build of the debugging helpers. To
work around this, add gdbmacros.cpp to the compiled sources in the
application Makefile.
Choose \gui {Tools > Options > Debugger > Debugging Helper > Use debugging
helper from custom location}, and specify an invalid location, such as
\c{/dev/null}.
*/
@@ -7960,7 +8091,7 @@
\contentspage index.html
\previouspage creator-debugging-helpers.html
\page creator-debugging-qml.html
\nextpage creator-maemo-emulator.html
\nextpage creator-troubleshooting-debugging.html
\title Debugging Qt Quick Projects
@@ -8362,9 +8493,9 @@
\o Click \gui{Next}.
The \gui {Qt Versions} dialog opens.
The \gui {Target Setup} dialog opens.
\image qmldesigner-new-project-qt-versions.png "Qt Versions dialog"
\image qmldesigner-new-project-qt-versions.png "Target Setup dialog"
\o Select the Qt versions to use as build targets for your project,
and then click \gui{Next}.
@@ -8382,7 +8513,7 @@
and landscape, and then click \gui Next.
\note This dialog opens only if you select \gui Maemo5 or
\gui {Symbian Device} target in the \gui {Qt Versions} dialog.
\gui {Symbian Device} target in the \gui {Target Setup} dialog.
The \gui {Symbian Specific} dialog opens.
@@ -9222,7 +9353,7 @@
/*!
\contentspage index.html
\previouspage creator-debugging-qml.html
\previouspage creator-troubleshooting-debugging.html
\page creator-maemo-emulator.html
\nextpage creator-deployment.html
@@ -10394,8 +10525,9 @@
\list
\o Debugging large applications on Symbian devices using the Symbian S^3
operating system might not work, because the TRK debug agent might not be able to
\o Debugging large applications on Symbian devices using the Symbian^3
operating system might not work, because the on-device debugging agent
might not be able to
access memory when the operating system starts paging. This causes breakpoint
handling and symbol resolution to fail. For more information, see
\l{http://bugreports.qt.nokia.com/browse/QTCREATORBUG-2158}{QTCREATORBUG-2158}.
@@ -10421,8 +10553,7 @@
by 'Wave \reg Systems' is installed and active (causing crashes in \c{vxvault.dll)}).
\o Gdb may take long to load debugging symbols, especially from large
libraries like \c libQtWebKit. Starting the debugging module can
take up to several minutes without visible progress.
libraries.
\o Setting breakpoints in code that is compiled into the binary more
than once does not work.
@@ -10789,201 +10920,67 @@
/*!
\contentspage index.html
\previouspage creator-task-lists.html
\page creator-faq.html
\nextpage creator-help.html
\previouspage creator-debugging-qml.html
\page creator-troubleshooting-debugging.html
\nextpage creator-maemo-emulator.html
\title FAQ
\title Troubleshooting Debugger
This section lists some frequently asked questions about Qt Creator and
answers to them.
This section lists some typical problems that you might encounter while
debugging and solutions for them.
\section1 General
\section2 How do I reset all Qt Creator settings?
Qt Creator creates two files and a directory: \c QtCreator.db,
\c QtCreator.ini, and \c qtcreator. The location depends on the platform.
On Linux, Unix, and Mac OS, the files are located in \c {~/.config/Nokia},
on Windows XP in
\c {<drive>:\Documents and Settings\<username>\Application Data\Nokia}, and
on Windows Vista and Windows 7 in
\c {<drive>:\Users\<username>\AppData\Roaming\Nokia}. For all versions,
try this path: \c {APPDATA\Nokia}.
\section2 Qt Creator comes with MinGW, should I use this version with Qt?
Until Qt both Qt and Qt Creator have been shipping with a MinGW version which uses MinGW 3.4. Starting with the 1.2.90 Tech Preview, Qt Creator ships with a more recent MinGW GCC 4.4, which Qt 4.6 final will also be using. GCC 3.4 and GCC 4.4 are not binary compatible. So if you try to use Qt 4.6 beta and before with Qt Creator 1.2.90 and older, tell Qt Creator to use the MinGW from Qt by setting <20>MinGw location<6F> to the according MinGW directory in Tools <20>> Options <20>> Qt4 <20>> Qt Versions.
\section2 Qt Creator does not find a helper application, such as git or a compiler.
Make sure the application is in your system PATH when starting Qt Creator.
Also select \gui {Tools > Options} to check the settings specified for the
application. Many plugins specify either the path to the tool they need or
the environment they run in.
This is especially relevant for the Mac OS where \c {/usr/local/bin} might
not be in the path when Qt Creator is started.
\section2 How do I change the language for Qt Creator?
Qt Creator has been localized into several languages. If the system
language is one of the supported languages, it is automatically selected.
To change the language, select \gui {Tools > Options > Environment} and
select a language in the \gui Language field. The change takes effect after
you restart Qt Creator.
\section1 Qt Designer
\section2 Custom widgets not loaded in Design mode even though it works in standalone \QD.
\QD fetches plugins from standard locations and loads the plugins that
match its build key. The locations are different for standalone and
integrated \QD.
For more information, see \l{Adding Qt Designer Plugins}.
\section1 Help
\section2 The Qt Reference Documentation missing and context help cannot find topics.
Qt Creator comes fully integrated with Qt documentation and
examples using the Qt Help plugin.
\note The integrated Qt Reference Documentation is only available for Qt
4.4 and later.
Qt Creator, \QSDK, and other Qt deliverables contain documentation
as .qch files. All the documentation is accessible in the \gui Help mode.
To view the documentation that is available and to add documentation,
select \gui {Tools > Options... > Help > Documentation}.
For more information, see \l{Adding External Documentation}.
\section1 Debugger
\section2 The debugger does not work.
First, make sure you use at least version 1.2.1. Several debugger related bug fixed in this version. Then, there is a <20>Debugger View<65> (under <20>Debug <20>> Views <20>> Debugger<65>).
Note: Up to Qt Creator 1.2, the view was called <20>Gdb View<65>. The contents of the pane on the right hand side is most helpful. It is advised to attach it to any debugger related report on the mailing list (qt-creator@trolltech.com) or to put it on http://creator.pastebin.com [creator.pastebin.com] before asking people on IRC (#qt-creator at FreeNode).
\section2 Does debugging on Mac need some special setup?
If you want to debug into frameworks, such as Qt code, you need to set
\c{?1 DYLD_IMAGE_SUFFIX=_debug}
(there is an option for that in the Qt4 run configuration). Also XCode 3.x is preferred.
\section2 The built-in debugger is slow during startup and runtime, especially on Windows.
The debugger which ships with Creator in the Qt SDK on Windows is GDB from MinGW. Unfortunately, GDB is quite slow on Windows in general. Qt Creator interacts with GDB and adds custom dumpers for Qt types, and is thus not the problem of the slowness. Note that Creator can be used with MSVC on Windows, too <20> even for debugging.
\section2 How do I enable the debugging helpers for Qt<51>s bootstrapped applications (moc, qmake, etc)
The bootstrapped applications are built in a way that is incompatible with
the default build of the debugging helpers. To work around this, add
gdbmacros.cpp to the compiled sources in the application Makefile.
Choose \gui {Tools > Options > Debugger > Debugging Helper > Use debugging
helper from custom location}, and specify an invalid location, such as
\c{/dev/null}.
For more information, see \l{Using Debugging Helpers}.
\section2 The debugger does not hit my breakpoints
\section1 Debugger Does Not Hit Breakpoints
You might have created a release build that does not contain debug
information. A gcc debug build should have the <20>-g<> option on the compiler command line. Check that this option is present in the <20>Compile output<75> pane (Alt-4). If not, adjust your build settings in the <20>Project<63> tab.
information. A GNU Compiler Collection (GCC) debug build has the \c {-g}
option on the compiler command line. Check that this option is present in
the \gui {Compile Output} pane. If it is not, adjust your build settings
in the \gui {Projects} mode.
When using the Locals & Watches window to inspect a pointer variable, expanding the variable<6C>s tree item shows another tree item level instead of directly showing the members of the pointer variable. That<61>s ugly.
\section1 Debugger Does Not Work
There<EFBFBD>s a <20>Dereference pointers automatically<6C> item in the Locals and Watchers context menu.
If the debugger does not work properly, try the following:
\section2 If I have a choice of gdb versions, which should I use?
\list 1
Use the gdb version delivered with Qt Creator or Qt SDK. Except for Mac OS,
\o Make sure you use at least Qt Creator 2.1.
\o In the \gui Debug mode, select \gui {Windows > Views > Debugger
Log} to open the \gui {Debugger Log} view. Browse the contents of
the pane on the right hand side to find out what went wrong.
Always attach the contents of the pane to debugger-related
questions to the Qt Creator mailing list (qt-creator@trolltech.com)
or paste them to
\l{http://creator.pastebin.com}{creator.pastebin.com} before
asking questions in the IRC (on the #qt-creator channel at
FreeNode).
?1 sudo dpkg -i gdb_6.8-3ubuntu2_[arch].deb
\endlist
\section1 Directly Displaying Pointer Variable Members
\section2 The debugger tells me <not in scope> for some variables that are definitely in scope. What happened?
When you use the \gui {Locals and Watchers} view to inspect a pointer
variable and expand the variable tree item, another tree item level
is displayed. To directly display the members of the pointer variable,
select \gui {Dereference Pointers Automatically} in the context menu in the
\gui {Locals and Watchers} view.
The message is created by the debugging helpers. Qt Creator posts an expression to the gdb command line to invoke the debugging helpers, including the address of the object to examine. In some cases this address is modified by gdb before actually calling the helper function. It is unclear why and when this happens, but if it happens, the debugging helpers operate on wrong data and come to wrong conclusions, the most likely outcome is that it will find garbage and declare the variable as <not in scope>.
\section1 Built-in Debugger Is Slow During Startup and Runtime
\section2 What<61>s up with Python in the debugger?
The Qt Creator for Windows installation packages install gdb from MinGW.
Unfortunately, gdb is quite slow on Windows. Qt Creator does not cause
this, as it interacts with gdb and adds custom dumpers for Qt types.
Qt Creator is able to take advantage of using gdb builds that enable python scripting. It is currently only used for creating the contents of the Locals and Watcher view, but we might use it for stack display later. Using python scripting has three major advantages for us:
There is no need to inject code (<28>Debugging helpers<72>) into the debugged process to <20>nicely display<61>, say, QStringList or std::map contents. The code injection was a constant source of trouble and introduced extra stress on the debugged process, something one usually does not want when debugging.
It is now easily possible to extend the <20>Debugging helpers<72> to other types. No compilation required, just a few lines of python.
Python scripting vastly reduces the communication overhead compared to the previous <20>pure MI<4D> based solution.
So while in theory all is fine now, in practice there are some obstacles:
There is no python-enabled gdb for Mac. Mac will have to continue injection with C++ based debugging helpers.
On the Symbian platform and the AppTRK tool used artificially restricts gdb<64>s ability to talk to the device, so extracting e.g. QObject properties is not possible.
There is no gdb to talk to MSVC compiled applications on Windows. So <20>nice display<61> only works in a limited fashion using injection of C++ based Debugging helpers and cdb.
Also, the official gdb 7.0 release will not work as it crashes quite often due to http://sourceware.org/bugzilla/show_bug.cgi?id=10884 [sourceware.org]
Official gdb 7.0.1 works, but requires a few nasty workarounds on the Creator side as it does not have all the python features Qt Creators would like to use. Find updated sources for Ubuntu 9.10 (Karmic) by adding the following to your /etc/apt/sources.list:
?123 deb http://ppa.launchpad.net/daniel-molkentin/gdb/ubuntu karmic main deb-src http://ppa.launchpad.net/daniel-molkentin/gdb/ubuntu karmic main
To use Qt Creator<6F>s new python based gdb integration you need
gdb 7.0.1 or later <20> or <20>
self-compiled gdb from Archer:
Python 2.5 or later (Kubuntu: python2.6-dev)
A gdb from Archer:
Checkout the sources:
?123 git clone git://sourceware.org/git/archer.git cd archer git checkout -b archer-tromey-python origin/archer-tromey-python
Build it:
?12 ./configure <20>with-python <20>disable-werror make
Your new gdb will emerge as gdb/gdb
Point Creator<6F>s gdb path (Options <20>> Debugger <20>> Gdb <20>> Gdb Location) to your Python-enabled gdb or use the QTC_DEBUGGER_PATH environment variable
Start debugging as usual.
Go to the Debugger <20>> Views <20>> Debugger view to check if everything is ok. Close to the beginning there is a command <20>help bb<62> issued, check whether it returns with a <20>done<6E> or an <20>error<6F> reply.
\section2 Are there prebuilt gdb binaries you recommend?
Yes:
For Linux/x86: ftp://ftp.qt.nokia.com/misc/gdb/gdb-python-linux-i686 [ftp.qt.nokia.com]
For Linux/x86_64: ftp://ftp.qt.nokia.com/misc/gdb/gdb-python-linux-x86_64 [ftp.qt.nokia.com]
Why is stepping into functions in shared libraries so slow on Linux?
There was a gdb bug (http://sourceware.org/bugzilla/show_bug.cgi?id=11198 [sourceware.org]) which has been fixed by now. It has also been suggested that
?1 sudo apt-get install libc6-dbg
solves the problem on Ubuntu machines.
\section1 Code Editor
How can I get code-completion to work on the standard headers and phonon?
That does work only with builds from March 31 2009 or newer.
\section1 Compilation
How can I make use of my multi-core CPU with Qt Creator?
On Linux and Mac OS X, go to Project Mode, select your configuration in the build settings tab, locate the Build Steps entry and add -j <num> where <num> is the amount of cores in your CPU.
On Windows, nmake does not support the -j parameter. Instead, we provide a drop-in replacement called jom. You can download a precompiled version of jom from the Qt FTP. Put jom.exe in a location in PATH. Go to the location described above and set jom.exe as the make command. Note: Unlike GNU make, jom will automatically detect your cores and will spawn as many parallel processes as your CPU has cores. You can override this behavior by using the -j parameter as described above.
\note You can use Qt Creator with MSVC on Windows for debugging.
\section1 Debugger Displays <not in scope> Message
The message is created by the debugging helpers. Qt Creator posts an
expression to the gdb command line to invoke the debugging helpers.
The expression includes the address of the object to examine. This
address might be modified by gdb before the helper function is called. It
is unclear why and when this happens, but if it happens, the debugging
helpers operate on wrong data and come to wrong conclusions. Most likely,
they find garbage and declare the variable to be <not in scope>.
*/

View File

@@ -56,6 +56,17 @@
the required applications on Symbian devices. You can also use any of
the standard methods for installing applications.
To debug applications on Symbian devices by using the Qt Creator \gui Debug
mode, you must install an on-device debugging agent on the device. You have
a choice between App TRK and CODA debugging agents. For more information,
see
\if defined(qcmanual)
\l{Using On-device Debugging Agents}.
\else
\e \l{http://doc.qt.nokia.com/qtcreator-latest/creator-developing-symbian.html}{Using On-device Debugging Agents}.
\endif
The tool chain for building applications locally on the development PC for
the \gui {Symbian Device} target is only supported on Windows.
If you develop on Linux or Mac OS, you must use the Remote Compiler
@@ -72,13 +83,8 @@
following:
\list
\o The Nokia USB drivers that come with \e{PC Suite} or \e{Ovi Suite}
\o The
\if defined(qcmanual)
\l{http://tools.ext.nokia.com/trk/}{App TRK}
\else
\e {App TRK}
\endif
application for your device
\o An on-device debugging agent, \e {App TRK} or \e CODA, installed on
the device
\o \e Qt installed on the device
\o \e {Qt Mobility APIs} installed on the device, if you use them in
applications
@@ -98,6 +104,7 @@
to install Carbide.c++ v2.0.0 or higher.
\endif
\section1 Installing Required Applications on Devices
Separate installation packages are provided for Symbian^3 and Symbian^1
@@ -127,8 +134,7 @@
\o Choose \gui {Start > Qt SDK > Symbian^3 Qt 4.7.2 > Install TRK
(Debug Agent) for Symbian^3 on Device} and follow the
instructions on the screen to install
the TRK
debugging application to the device.
the App TRK debugging agent to the device.
\o Choose \gui {Start > Qt SDK > Symbian^3 Qt 4.7.2 > Install QtWebKit
for for Qt 4.7.2 on Symbian^3 Device} and follow the
@@ -157,8 +163,7 @@
\o Choose \gui {Start > Qt SDK > Symbian^1 Qt 4.7.2 > Install TRK
(Debug Agent)} for the type of the connected device and follow the
instructions on the screen to install
the TRK
debugging application to the device.
the App TRK debugging agent to the device.
\o Choose \gui {Start > Qt SDK > Symbian^1 Qt 4.7.2 > Install QtWebKit
for for Qt 4.7.2 on Symbian^1 Device} and follow the
@@ -169,7 +174,59 @@
In addition, you can install an example application and demos to Symbian^1
devices.
\if defined(qcmanual)
\section1 Using On-device Debugging Agents
CODA is a new on-device debugging agent that will eventually replace App TRK.
You can choose which debugging agent to use in the \gui {Run Settings} for
the project.
CODA offers the following benefits:
\list
\o Extended error information
\o Debugging over WLAN
\o Extended information about the device
\endlist
CODA differs from App TRK in the following ways:
\list
\o Coda does not support debugging over a Bluetooth connection.
\o Coda supports only Symbian^1 and Symbian^3 devices. It does not
support S60 3rd Edition devices.
\endlist
\section2 Installing Debugging Agents
You can download CODA from the
\l{http://tools.ext.nokia.com/coda/}{CODA download server}:
\list
\o Symbian^1 versions of CODA are located in the pf5250 folder.
\o Symbian^3 versions of CODA are located in the tb92 folder.
\endlist
The builds that are marked as \e delta builds work on top of App TRK, and
therefore, App TRK and CODA can co-exist on a device. Other than the delta
builds cannot be installed on a device where App TRK is installed.
The \QSDK installation program creates a shortcut for installing
App TRK on Symbian devices, but you can also download and install it
separately from the
\l{http://tools.ext.nokia.com/trk/}{App TRK download server}.
\section1 Adding Symbian Platform SDKs
\QSDK contains all the tools you need for developing Qt applications for
@@ -177,7 +234,7 @@
install additional Symbian Platform SDKs:
\list
\o \l{http://www.forum.nokia.com/main/resources/tools_and_sdks/S60SDK/}
\o \l{http://www.forum.nokia.com/info/sw.nokia.com/id/ec866fab-4b76-49f6-b5a5-af0631419e9c/S60_All_in_One_SDKs.html}
{S60 Platform SDK 3rd Edition FP1 or higher}.
\o Either the GCCE ARM Toolchain that is included in the Symbian
SDKs, or RVCT 2.2 [build 686] or later (which is not available free
@@ -229,7 +286,8 @@
The tool tip of the target selector shows more details about the actual
device that will be used when you run your application.
\o Start the \gui{App TRK} application on your device and deny the
\o Start the debugging application, App TRK or CODA, on the device and
deny the
Bluetooth connection.
\o Select \gui Options to select USB as connection type.

View File

@@ -146,12 +146,6 @@ unix {
UI_DIR = $${OUT_PWD}/.uic
}
linux-g++* {
# Bail out on non-selfcontained libraries. Just a security measure
# to prevent checking in code that does not compile on other platforms.
QMAKE_LFLAGS += -Wl,--allow-shlib-undefined -Wl,--no-undefined
}
win32-msvc* {
#Don't warn about sprintf, fopen etc being 'unsafe'
DEFINES += _CRT_SECURE_NO_WARNINGS

View File

@@ -88,11 +88,7 @@ bool AbstractLiveEditTool::topItemIsMovable(const QList<QGraphicsItem*> & itemLi
QGraphicsItem *firstSelectableItem = topMovableGraphicsItem(itemList);
if (firstSelectableItem == 0)
return false;
QDeclarativeItem *declarativeItem
= dynamic_cast<QDeclarativeItem*>(firstSelectableItem->toGraphicsObject());
if (declarativeItem != 0)
if (toQDeclarativeItem(firstSelectableItem) != 0)
return true;
return false;
@@ -122,7 +118,7 @@ bool AbstractLiveEditTool::topItemIsResizeHandle(const QList<QGraphicsItem*> &/*
QDeclarativeItem *AbstractLiveEditTool::toQDeclarativeItem(QGraphicsItem *item)
{
return dynamic_cast<QDeclarativeItem*>(item->toGraphicsObject());
return qobject_cast<QDeclarativeItem*>(item->toGraphicsObject());
}
QGraphicsItem *AbstractLiveEditTool::topMovableGraphicsItem(const QList<QGraphicsItem*> &itemList)

View File

@@ -63,24 +63,56 @@ const char * const KEY_TOOLBOX_GEOMETRY = "toolBox/geometry";
const int SceneChangeUpdateInterval = 5000;
class ToolBox : public QWidget
{
Q_OBJECT
public:
ToolBox(QWidget *parent = 0);
~ToolBox();
QmlToolBar *toolBar() const { return m_toolBar; }
private:
QSettings m_settings;
QmlToolBar *m_toolBar;
};
ToolBox::ToolBox(QWidget *parent)
: QWidget(parent, Qt::Tool)
, m_settings(QLatin1String("Nokia"), QLatin1String("QmlObserver"), this)
, m_toolBar(new QmlToolBar)
{
setWindowFlags((windowFlags() & ~Qt::WindowCloseButtonHint) | Qt::CustomizeWindowHint);
setWindowTitle(tr("Qt Quick Toolbox"));
QVBoxLayout *verticalLayout = new QVBoxLayout;
verticalLayout->setMargin(0);
verticalLayout->addWidget(m_toolBar);
setLayout(verticalLayout);
restoreGeometry(m_settings.value(QLatin1String(KEY_TOOLBOX_GEOMETRY)).toByteArray());
}
ToolBox::~ToolBox()
{
m_settings.setValue(QLatin1String(KEY_TOOLBOX_GEOMETRY), saveGeometry());
}
QDeclarativeViewObserverPrivate::QDeclarativeViewObserverPrivate(QDeclarativeViewObserver *q) :
q(q),
designModeBehavior(false),
showAppOnTop(false),
executionPaused(false),
slowdownFactor(1.0f),
toolBar(0),
toolBox(0),
settings(0)
toolBox(0)
{
}
QDeclarativeViewObserverPrivate::~QDeclarativeViewObserverPrivate()
{
if (toolBar) {
settings->setValue(QLatin1String(KEY_TOOLBOX_GEOMETRY),
toolBar->window()->saveGeometry());
}
}
QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view, QObject *parent) :
@@ -96,9 +128,6 @@ QDeclarativeViewObserver::QDeclarativeViewObserver(QDeclarativeView *view, QObje
data->boundingRectHighlighter = new BoundingRectHighlighter(this);
data->subcomponentEditorTool = new SubcomponentEditorTool(this);
data->currentTool = data->selectionTool;
data->settings = new QSettings(QLatin1String("Nokia"),
QLatin1String("QmlObserver"),
this);
// to capture ChildRemoved event when viewport changes
data->view->installEventFilter(this);
@@ -169,7 +198,7 @@ void QDeclarativeViewObserver::setObserverContext(int contextIndex)
void QDeclarativeViewObserverPrivate::_q_setToolBoxVisible(bool visible)
{
#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5)
#if !defined(Q_OS_SYMBIAN) && !defined(Q_WS_MAEMO_5) && !defined(Q_WS_SIMULATOR)
if (!toolBox && visible)
createToolBox();
if (toolBox)
@@ -416,7 +445,7 @@ void QDeclarativeViewObserverPrivate::_q_clearComponentCache()
void QDeclarativeViewObserverPrivate::_q_removeFromSelection(QObject *obj)
{
QList<QGraphicsItem*> items = selectedItems();
if (QGraphicsItem *item = dynamic_cast<QGraphicsItem*>(obj))
if (QGraphicsItem *item = qobject_cast<QGraphicsObject*>(obj))
items.removeOne(item);
setSelectedItems(items);
}
@@ -481,8 +510,8 @@ void QDeclarativeViewObserver::setDesignModeBehavior(bool value)
{
emit designModeBehaviorChanged(value);
if (data->toolBar)
data->toolBar->setDesignModeBehavior(value);
if (data->toolBox)
data->toolBox->toolBar()->setDesignModeBehavior(value);
data->debugService->setDesignModeBehavior(value);
data->designModeBehavior = value;
@@ -878,7 +907,10 @@ QRectF QDeclarativeViewObserver::adjustToScreenBoundaries(const QRectF &bounding
void QDeclarativeViewObserverPrivate::createToolBox()
{
toolBar = new QmlToolBar;
toolBox = new ToolBox(q->declarativeView());
QmlToolBar *toolBar = toolBox->toolBar();
QObject::connect(q, SIGNAL(selectedColorChanged(QColor)),
toolBar, SLOT(setColorBoxColor(QColor)));
@@ -912,18 +944,8 @@ void QDeclarativeViewObserverPrivate::createToolBox()
QObject::connect(q, SIGNAL(zoomToolActivated()), toolBar, SLOT(activateZoom()));
QObject::connect(q, SIGNAL(marqueeSelectToolActivated()),
toolBar, SLOT(activateMarqueeSelectTool()));
QVBoxLayout *verticalLayout = new QVBoxLayout;
verticalLayout->setMargin(0);
verticalLayout->addWidget(toolBar);
toolBox = new QWidget(q->declarativeView(), Qt::Tool);
toolBox->setWindowFlags((toolBox->windowFlags() & ~Qt::WindowCloseButtonHint)
| Qt::CustomizeWindowHint);
toolBox->setWindowTitle(tr("Qt Quick Toolbox"));
toolBox->setLayout(verticalLayout);
toolBox->restoreGeometry(settings->value(QLatin1String(KEY_TOOLBOX_GEOMETRY)).toByteArray());
}
} // namespace QmlJSDebugger
#include "qdeclarativeviewobserver.moc"

View File

@@ -40,8 +40,6 @@
#include "qdeclarativeviewobserver.h"
#include "qdeclarativeobserverservice.h"
QT_FORWARD_DECLARE_CLASS(QSettings)
namespace QmlJSDebugger {
class JSDebuggerAgent;
@@ -52,7 +50,7 @@ class ColorPickerTool;
class LiveLayerItem;
class BoundingRectHighlighter;
class SubcomponentEditorTool;
class QmlToolBar;
class ToolBox;
class CrumblePath;
class AbstractLiveEditTool;
@@ -93,9 +91,7 @@ public:
bool executionPaused;
qreal slowdownFactor;
QmlToolBar *toolBar;
QWidget *toolBox;
QSettings *settings;
ToolBox *toolBox;
void setViewport(QWidget *widget);

File diff suppressed because it is too large Load Diff

View File

@@ -70,6 +70,7 @@
#include <utils/fancymainwindow.h>
#include <utils/styledbar.h>
#include <utils/qtcassert.h>
#include <utils/checkablemessagebox.h>
#include <cmakeprojectmanager/cmakeprojectconstants.h>
#include <qt4projectmanager/qt4projectmanagerconstants.h>
@@ -90,6 +91,7 @@
#include <QtGui/QLabel>
#include <QtGui/QCheckBox>
#include <QtGui/QDialogButtonBox>
#include <QtGui/QMainWindow>
using namespace Core;
using namespace Analyzer;
@@ -464,38 +466,25 @@ void AnalyzerManager::AnalyzerManagerPrivate::startTool()
const QString currentMode = buildType == ProjectExplorer::BuildConfiguration::Debug ? tr("Debug") : tr("Release");
QSettings *settings = Core::ICore::instance()->settings();
const QString configKey = QString("%1/%2").arg(Constants::MODE_ANALYZE, "AnalyzeCorrectMode");
const QString configKey = QLatin1String(Constants::MODE_ANALYZE) + QLatin1Char('/') + QLatin1String("AnalyzeCorrectMode");
int ret;
if (settings->contains(configKey)) {
ret = settings->value(configKey, QDialog::Accepted).toInt();
} else {
QDialog dialog;
dialog.setWindowTitle(tr("Run %1 in %2 mode?").arg(toolName).arg(currentMode));
QGridLayout *layout = new QGridLayout;
QLabel *iconLabel = new QLabel;
iconLabel->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
QIcon icon = dialog.style()->standardIcon(QStyle::SP_MessageBoxInformation);
dialog.setWindowIcon(icon);
iconLabel->setPixmap(icon.pixmap(QSize(icon.actualSize(QSize(64, 64)))));
layout->addWidget(iconLabel, 0, 0);
QLabel *textLabel = new QLabel;
textLabel->setWordWrap(true);
textLabel->setText(tr("You are trying to run %1 on an application in %2 mode. "
"%1 is designed to be used in %3 mode.\n\n"
"Do you want to continue and run %1 in %2 mode?").arg(toolName).arg(currentMode).arg(toolMode));
layout->addWidget(textLabel, 0, 1);
QCheckBox *dontAskAgain = new QCheckBox;
dontAskAgain->setText(tr("&Do not ask again"));
layout->addWidget(dontAskAgain, 1, 0, 1, 2);
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Yes | QDialogButtonBox::Cancel);
connect(buttons, SIGNAL(accepted()),
&dialog, SLOT(accept()));
connect(buttons, SIGNAL(rejected()),
&dialog, SLOT(reject()));
layout->addWidget(buttons, 2, 0, 1, 2);
dialog.setLayout(layout);
ret = dialog.exec();
if (dontAskAgain->isChecked() && ret == QDialog::Accepted)
const QString title = tr("Run %1 in %2 Mode?").arg(toolName).arg(currentMode);
const QString message = tr("<html><head/><body><p>You are trying to run the tool '%1' on an application in %2 mode. "
"The tool is designed to be used in %3 mode.</p><p>"
"Do you want to continue and run it in %2 mode?</p></body></html>").
arg(toolName).arg(currentMode).arg(toolMode);
const QString checkBoxText = tr("&Do not ask again");
bool checkBoxSetting = false;
const QDialogButtonBox::StandardButton button =
Utils::CheckableMessageBox::question(Core::ICore::instance()->mainWindow(), title, message, checkBoxText,
&checkBoxSetting, QDialogButtonBox::Yes|QDialogButtonBox::Cancel,
QDialogButtonBox::Cancel);
ret = button == QDialogButtonBox::Yes ? QDialog::Accepted : QDialog::Rejected;
if (checkBoxSetting && ret == QDialog::Accepted)
settings->setValue(configKey, ret);
}
if (ret == QDialog::Rejected)

View File

@@ -205,9 +205,11 @@ void AnalyzerOutputPane::createWidgets(QWidget *paneParent)
m_paneWidget->setObjectName(objectName() + QLatin1String("Widget"));
m_paneStackedLayout->addWidget(new QLabel(tr("No current analysis tool")));
m_toolbarStackedWidget = new QStackedWidget;
m_toolBarSeparator = new Utils::StyledSeparator;
// Temporarily assign to (wrong) parent to suppress flicker in conjunction with QStackedWidget.
m_toolbarStackedWidget = new QStackedWidget(paneParent);
m_toolbarStackedWidget->setObjectName(objectName() + QLatin1String("ToolBarStackedWidget"));
m_toolBarSeparator = new Utils::StyledSeparator(paneParent);
m_toolBarSeparator->setObjectName(objectName() + QLatin1String("ToolBarSeparator"));
// Add adapters added before.
const int adapterCount = m_adapters.size();

View File

@@ -343,7 +343,7 @@ bool BinEditor::save(const QString &oldFileName, const QString &newFileName)
if (oldFileName != newFileName) {
QString tmpName;
{
QTemporaryFile tmp;
QTemporaryFile tmp(newFileName + QLatin1String("_XXXXXX.new"));
if (!tmp.open())
return false;
tmpName = tmp.fileName();

View File

@@ -79,8 +79,10 @@ NavigationWidgetPlaceHolder::NavigationWidgetPlaceHolder(Core::IMode *mode, QWid
NavigationWidgetPlaceHolder::~NavigationWidgetPlaceHolder()
{
if (m_current == this) {
NavigationWidget::instance()->setParent(0);
NavigationWidget::instance()->hide();
if (NavigationWidget *nw = NavigationWidget::instance()) {
nw->setParent(0);
nw->hide();
}
}
}

View File

@@ -225,8 +225,9 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
else // stream_op_cont already
turnInto(stream_op_cont);
break;
case T_RPAREN:
case T_COMMA:
case T_SEMICOLON: leave(); continue; // always nested, propagate semicolon
case T_SEMICOLON: leave(); continue; // always nested, propagate
} break;
case member_init_open:

View File

@@ -939,11 +939,18 @@ void CdbEngine::processFinished()
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineShutdownOk")
notifyEngineShutdownOk();
}
} else {
// The QML/CPP engine relies on the standard sequence of InferiorShutDown,etc.
// Otherwise, we take a shortcut.
if (isSlaveEngine()) {
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyInferiorExited")
notifyInferiorExited();
} else {
STATE_DEBUG(state(), Q_FUNC_INFO, __LINE__, "notifyEngineSpontaneousShutdown")
notifyEngineSpontaneousShutdown();
}
}
}
void CdbEngine::detachDebugger()
{

View File

@@ -176,8 +176,10 @@ QByteArray cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
str << bp.module << '!';
str << cdbBreakPointFileName(bp, sourcePathMapping) << ':' << bp.lineNumber << '`';
break;
case Watchpoint: // Read/write 1 byte
str << "rw 1 " << hex << hexPrefixOn << bp.address << hexPrefixOff << dec;
case Watchpoint: { // Read/write, no space here
const unsigned size = bp.size ? bp.size : 1;
str << "r" << size << ' ' << hex << hexPrefixOn << bp.address << hexPrefixOff << dec;
}
break;
}
if (bp.ignoreCount)

View File

@@ -138,11 +138,7 @@ include(gdb/gdb.pri)
include(script/script.pri)
include(pdb/pdb.pri)
include(lldb/lldbhost.pri)
contains(QT_CONFIG, declarative) {
QT += declarative
include(qml/qml.pri)
}
include(tcf/tcf.pri)
include(shared/shared.pri)

View File

@@ -507,6 +507,7 @@ QWidget *DebuggerMainWindow::createContents(IMode *mode)
splitter->addWidget(mainWindowSplitter);
splitter->setStretchFactor(0, 0);
splitter->setStretchFactor(1, 1);
splitter->setObjectName(QLatin1String("DebugModeWidget"));
return splitter;
}

View File

@@ -1117,8 +1117,7 @@ DebuggerPluginPrivate::~DebuggerPluginPrivate()
delete m_debuggerSettings;
m_debuggerSettings = 0;
delete m_mainWindow;
m_mainWindow = 0;
// Mainwindow will be deleted by debug mode.
delete m_snapshotHandler;
m_snapshotHandler = 0;

View File

@@ -104,13 +104,14 @@ static const char *engineTypeName(DebuggerEngineType et)
case Debugger::NoEngineType:
break;
case Debugger::GdbEngineType:
return "Gdb";
return "Gdb engine";
case Debugger::ScriptEngineType:
return "Script engine";
case Debugger::CdbEngineType:
return "Cdb engine";
case Debugger::PdbEngineType:
return "Pdb engine"; case Debugger::TcfEngineType:
return "Pdb engine";
case Debugger::TcfEngineType:
return "Tcf engine";
case Debugger::QmlEngineType:
return "QML engine";
@@ -129,7 +130,7 @@ static inline QString engineTypeNames(const QList<DebuggerEngineType> &l)
QString rc;
foreach (DebuggerEngineType et, l) {
if (!rc.isEmpty())
rc.append(QLatin1Char(','));
rc.append(QLatin1String(", "));
rc += QLatin1String(engineTypeName(et));
}
return rc;
@@ -495,6 +496,31 @@ QString ConfigurationCheck::errorDetailsString() const
return errorDetails.join(QLatin1String("\n\n"));
}
// Convenience helper to check whether an engine is enabled and configured
// correctly.
static inline bool canUseEngine(DebuggerEngineType et,
const DebuggerStartParameters &sp,
unsigned cmdLineEnabledEngines,
ConfigurationCheck *result)
{
// Enabled?
if ((et & cmdLineEnabledEngines) == 0) {
result->errorDetails.push_back(DebuggerPlugin::tr("The debugger engine '%1' is disabled.").
arg(engineTypeName(et)));
return false;
}
// Configured.
switch (et) {
case Debugger::CdbEngineType:
return checkCdbConfiguration(sp, result);
case Debugger::GdbEngineType:
return checkGdbConfiguration(sp, result);
default:
break;
}
return true;
}
/*!
\fn ConfigurationCheck checkDebugConfiguration(unsigned cmdLineEnabledEngines,
const DebuggerStartParameters &sp)
@@ -529,71 +555,56 @@ DEBUGGER_EXPORT ConfigurationCheck checkDebugConfiguration(const DebuggerStartPa
qDebug() << " Required: " << engineTypeNames(requiredTypes);
// Filter out disables types, command line + current settings.
unsigned cmdLineEnabledEngines = debuggerCore()->enabledEngines();
#ifdef CDB_ENABLED
if (!isCdbEngineEnabled() && !Cdb::isCdbEngineEnabled())
cmdLineEnabledEngines &= ~CdbEngineType;
#endif
#ifdef WITH_LLDB
if (!Core::ICore::instance()->settings()->value(QLatin1String("LLDB/enabled")).toBool())
cmdLineEnabledEngines &= ~LldbEngineType;
#else
cmdLineEnabledEngines &= ~LldbEngineType;
#endif
QList<DebuggerEngineType> usableTypes;
foreach (DebuggerEngineType et, requiredTypes)
if (et & cmdLineEnabledEngines) {
usableTypes.push_back(et);
DebuggerEngineType usableType = NoEngineType;
QList<DebuggerEngineType> unavailableTypes;
foreach (DebuggerEngineType et, requiredTypes) {
if (canUseEngine(et, sp, cmdLineEnabledEngines, &result)) {
usableType = et;
break;
} else {
const QString msg = DebuggerPlugin::tr("The debugger engine '%1' preferred for "
"debugging binaries of type %2 is disabled.").
arg(engineTypeName(et), sp.toolChainAbi.toString());
debuggerCore()->showMessage(msg, LogWarning);
unavailableTypes.push_back(et);
}
}
if (usableType == NoEngineType) {
if (requiredTypes.size() == 1) {
result.errorMessage = DebuggerPlugin::tr(
"The debugger engine '%1' required for debugging binaries of the type '%2'"
" is not configured correctly.").
arg(QLatin1String(engineTypeName(requiredTypes.front())), sp.toolChainAbi.toString());
} else {
result.errorMessage = DebuggerPlugin::tr(
"None of the debugger engines '%1' capable of debugging binaries of the type '%2'"
" is configured correctly.").
arg(engineTypeNames(requiredTypes), sp.toolChainAbi.toString());
}
if (usableTypes.isEmpty()) {
result.errorMessage = DebuggerPlugin::tr("This configuration requires the debugger engine %1, which is disabled.").
arg(QLatin1String(engineTypeName(usableTypes.front())));
return result;
}
if (debug)
qDebug() << " Usable engines: " << engineTypeNames(usableTypes);
// Configuration check: Strip off non-configured engines, find first one to use.
while (!usableTypes.isEmpty()) {
bool configurationOk = true;
switch (usableTypes.front()) {
case Debugger::CdbEngineType:
configurationOk = checkCdbConfiguration(sp, &result);
break;
case Debugger::GdbEngineType:
configurationOk = checkGdbConfiguration(sp, &result);
break;
default:
break;
}
if (configurationOk) {
break;
} else {
const QString msg = DebuggerPlugin::tr("The debugger engine '%1' preferred "
"for debugging binaries of type %2 is not set up correctly: %3").
arg(engineTypeName(usableTypes.front()), sp.toolChainAbi.toString(),
result.errorDetails.isEmpty() ? QString() : result.errorDetails.back());
qDebug() << "Configured engine: " << engineTypeName(usableType);
// Inform verbosely about MinGW-gdb/CDB fallbacks. Do not complain about LLDB, for now.
if (!result.errorDetails.isEmpty() && unavailableTypes.count(LldbEngineType) != unavailableTypes.size()) {
const QString msg = DebuggerPlugin::tr(
"The preferred debugger engine for debugging binaries of type '%1' is not available.\n"
"The debugger engine '%2' will be used as a fallback.\nDetails: %3").
arg(sp.toolChainAbi.toString(), engineTypeName(usableType),
result.errorDetails.join(QString(QLatin1Char('\n'))));
debuggerCore()->showMessage(msg, LogWarning);
usableTypes.pop_front();
}
}
if (debug)
qDebug() << "Configured engines: " << engineTypeNames(usableTypes);
if (usableTypes.isEmpty()) {
result.errorMessage = DebuggerPlugin::tr("The debugger engine required for this configuration is not correctly configured.");
return result;
showMessageBox(QMessageBox::Warning, "Warning", msg);
}
// Anything left: Happy.
result.errorMessage.clear();
result.errorDetails.clear();
if (qmlLanguage && cppLanguage) {
result.masterSlaveEngineTypes.first = QmlCppEngineType;
result.masterSlaveEngineTypes.second = usableTypes.front();
result.masterSlaveEngineTypes.second = usableType;
} else {
result.masterSlaveEngineTypes.first = usableTypes.front();
result.masterSlaveEngineTypes.first = usableType;
}
if (debug)
qDebug() << engineTypeName(result.masterSlaveEngineTypes.first) << engineTypeName(result.masterSlaveEngineTypes.second);

View File

@@ -1033,8 +1033,8 @@ void CodaGdbAdapter::startAdapter()
} else {
m_codaDevice = SymbianUtils::SymbianDeviceManager::instance()
->getCodaDevice(parameters.remoteChannel);
bool ok = m_codaDevice && m_codaDevice->device()->isOpen();
bool ok = !m_codaDevice.isNull() && m_codaDevice->device()->isOpen();
if (!ok) {
QString msg = QString("Couldn't open serial device %1")
.arg(parameters.remoteChannel);

View File

@@ -42,7 +42,6 @@ namespace Constants {
const char * const INFO_READ_ONLY = "DesignerXmlEditor.ReadOnly";
const char * const K_DESIGNER_XML_EDITOR_ID = "FormEditor.DesignerXmlEditor";
const char * const C_DESIGNER_XML_EDITOR = "Designer Xml Editor";
const char * const DESIGNER_XML_EDITOR_ID ="DesignerXmlEditor";
const char * const C_DESIGNER_XML_DISPLAY_NAME = QT_TRANSLATE_NOOP("Designer", "Form Editor");
const char * const SETTINGS_CATEGORY = "P.Designer";

View File

@@ -65,7 +65,7 @@ FormEditorFactory::FormEditorFactory()
QString FormEditorFactory::id() const
{
return QLatin1String(DESIGNER_XML_EDITOR_ID);
return QLatin1String(K_DESIGNER_XML_EDITOR_ID);
}
QString FormEditorFactory::displayName() const

View File

@@ -186,8 +186,8 @@ void FormEditorStack::modeAboutToChange(Core::IMode *m)
if (Designer::Constants::Internal::debug && m)
qDebug() << "FormEditorStack::modeAboutToChange" << m->id();
// Sync the editor when leaving design mode
if (m && m->id() == QLatin1String(Core::Constants::MODE_DESIGN))
// Sync the editor when entering edit mode
if (m && m->id() == QLatin1String(Core::Constants::MODE_EDIT))
foreach(const EditorData &data, m_formEditors)
data.formWindowEditor->syncXmlEditor();
}

View File

@@ -207,28 +207,23 @@ void GenericProject::refresh(RefreshOptions options)
CPlusPlus::CppModelManagerInterface *modelManager =
CPlusPlus::CppModelManagerInterface::instance();
if (m_toolChain && modelManager) {
const QByteArray predefinedMacros = m_toolChain->predefinedMacros();
if (modelManager) {
CPlusPlus::CppModelManagerInterface::ProjectInfo pinfo = modelManager->projectInfo(this);
pinfo.defines = predefinedMacros;
pinfo.defines += '\n';
pinfo.defines += m_defines;
QStringList allIncludePaths;
QStringList allFrameworkPaths;
if (m_toolChain) {
pinfo.defines = m_toolChain->predefinedMacros();
pinfo.defines += '\n';
foreach (const HeaderPath &headerPath, m_toolChain->systemHeaderPaths()) {
if (headerPath.kind() == HeaderPath::FrameworkHeaderPath)
allFrameworkPaths.append(headerPath.path());
pinfo.frameworkPaths.append(headerPath.path());
else
allIncludePaths.append(headerPath.path());
pinfo.includePaths.append(headerPath.path());
}
}
allIncludePaths += this->allIncludePaths();
pinfo.frameworkPaths = allFrameworkPaths;
pinfo.includePaths = allIncludePaths;
pinfo.includePaths += allIncludePaths();
pinfo.defines += m_defines;
// ### add _defines.
pinfo.sourceFiles = files();
@@ -335,6 +330,8 @@ void GenericProject::setToolChain(ToolChain *tc)
return;
m_toolChain = tc;
refresh(Configuration);
emit toolChainChanged(m_toolChain);
}
@@ -426,13 +423,14 @@ bool GenericProject::fromMap(const QVariantMap &map)
}
QString id = map.value(QLatin1String(TOOLCHAIN_KEY)).toString();
const ToolChainManager *toolChainManager = ToolChainManager::instance();
if (!id.isNull()) {
setToolChain(ToolChainManager::instance()->findToolChain(id));
setToolChain(toolChainManager->findToolChain(id));
} else {
QList<ToolChain *> tcs =
ToolChainManager::instance()->findToolChains(Abi::hostAbi());
QList<ToolChain *> tcs = toolChainManager->findToolChains(Abi::hostAbi());
if (tcs.isEmpty())
tcs = ToolChainManager::instance()->toolChains();
tcs = toolChainManager->toolChains();
if (!tcs.isEmpty())
setToolChain(tcs.at(0));
}
@@ -470,9 +468,9 @@ GenericBuildSettingsWidget::GenericBuildSettingsWidget(GenericTarget *target)
connect(m_toolChainChooser, SIGNAL(activated(int)), this, SLOT(toolChainSelected(int)));
connect(m_target->genericProject(), SIGNAL(toolChainChanged(ProjectExplorer::ToolChain*)),
this, SLOT(toolChainChanged(ProjectExplorer::ToolChain*)));
connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainAdded(ToolChain*)),
connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainAdded(ProjectExplorer::ToolChain*)),
this, SLOT(updateToolChainList()));
connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainRemoved(ToolChain*)),
connect(ProjectExplorer::ToolChainManager::instance(), SIGNAL(toolChainRemoved(ProjectExplorer::ToolChain*)),
this, SLOT(updateToolChainList()));
}

View File

@@ -604,12 +604,8 @@ void MercurialPlugin::showCommitWidget(const QList<QPair<QString, QString> > &st
return;
}
CommitEditor *commitEditor = qobject_cast<CommitEditor *>(editor);
if (!commitEditor) {
outputWindow->appendError(tr("Unable to create a commit editor."));
return;
}
QTC_ASSERT(qobject_cast<CommitEditor *>(editor), return)
CommitEditor *commitEditor = static_cast<CommitEditor *>(editor);
const QString msg = tr("Commit changes for \"%1\".").
arg(QDir::toNativeSeparators(m_submitRepository));

View File

@@ -208,7 +208,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Error,
QLatin1String("#error Symbian error"),
QLatin1String("C:\\temp\\test\\untitled8\\main.cpp"), 7,
QLatin1String("C:/temp/test/untitled8/main.cpp"), 7,
Constants::TASK_CATEGORY_COMPILE))
<< QString();
// Symbian reports #warning(s) twice (using different syntax).
@@ -218,7 +218,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< QString() << QString()
<< (QList<ProjectExplorer::Task>() << Task(Task::Warning,
QLatin1String("#warning Symbian warning"),
QLatin1String("C:\\temp\\test\\untitled8\\main.cpp"), 8,
QLatin1String("C:/temp/test/untitled8/main.cpp"), 8,
Constants::TASK_CATEGORY_COMPILE))
<< QString();
QTest::newRow("GCCE #warning2")
@@ -243,7 +243,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Error,
QLatin1String("undefined reference to `MainWindow::doSomething()'"),
QLatin1String("C:\\temp\\test\\untitled8/main.cpp"), 8,
QLatin1String("C:/temp/test/untitled8/main.cpp"), 8,
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Error,
QLatin1String("collect2: ld returned 1 exit status"),
@@ -264,7 +264,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Error,
QLatin1String("undefined reference to `MainWindow::doSomething()'"),
QLatin1String("C:\\temp\\test\\untitled8/main.cpp"), -1,
QLatin1String("C:/temp/test/untitled8/main.cpp"), -1,
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Error,
QLatin1String("collect2: ld returned 1 exit status"),
@@ -279,7 +279,7 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
<< (QList<ProjectExplorer::Task>()
<< Task(Task::Error,
QLatin1String("file not recognized: File format not recognized"),
QLatin1String("c:\\Qt\\4.6\\lib/QtGuid4.dll"), -1,
QLatin1String("c:/Qt/4.6/lib/QtGuid4.dll"), -1,
Constants::TASK_CATEGORY_COMPILE))
<< QString();
QTest::newRow("Invalid rpath")
@@ -511,11 +511,11 @@ void ProjectExplorerPlugin::testGccOutputParsers_data()
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Error,
QLatin1String("undefined reference to `vtable for QPlotAxis'"),
QLatin1String("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), 26,
QLatin1String("M:/Development/x64/QtPlot/qplotaxis.cpp"), 26,
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Error,
QLatin1String("undefined reference to `vtable for QPlotAxis'"),
QLatin1String("M:\\Development\\x64\\QtPlot/qplotaxis.cpp"), 26,
QLatin1String("M:/Development/x64/QtPlot/qplotaxis.cpp"), 26,
Constants::TASK_CATEGORY_COMPILE)
<< Task(Task::Error,
QLatin1String("collect2: ld returned 1 exit status"),

View File

@@ -528,6 +528,7 @@ QList<ToolChain *> Internal::GccToolChainFactory::autoDetectToolchains(const QSt
tc->setCompilerPath(compilerPath);
tc->setDebuggerCommand(debuggerPath);
tc->setTargetAbi(abi);
tc->setDisplayName(tc->defaultDisplayName()); // reset displayname
result.append(tc.take());
}

View File

@@ -456,12 +456,7 @@ void ProjectExplorerPlugin::testGnuMakeParserTaskMangling()
QFETCH(Task, outputTask);
// setup files:
QString tempdir;
#if defined Q_OS_WIN
tempdir = QDir::fromNativeSeparators(qgetenv("TEMP"));
#else
tempdir = QLatin1String("/tmp");
#endif
QString tempdir = QDir::tempPath();
tempdir.append(QChar('/'));
tempdir.append(QUuid::createUuid().toString());
tempdir.append(QChar('/'));

View File

@@ -329,6 +329,10 @@ bool ProjectExplorerPlugin::initialize(const QStringList &arguments, QString *er
this, SLOT(startupProjectChanged()));
connect(d->m_session, SIGNAL(dependencyChanged(ProjectExplorer::Project*,ProjectExplorer::Project*)),
this, SLOT(updateActions()));
connect(d->m_session, SIGNAL(sessionLoaded()),
this, SLOT(updateActions()));
connect(d->m_session, SIGNAL(sessionLoaded()),
this, SLOT(updateWelcomePage()));
d->m_proWindow = new ProjectWindow;

View File

@@ -215,6 +215,7 @@ private slots:
void updateVariable(const QString &variable);
void publishProject();
void updateWelcomePage();
#ifdef WITH_TESTS
void testGccOutputParsers_data();
@@ -252,7 +253,6 @@ private:
IRunControlFactory *findRunControlFactory(RunConfiguration *config, const QString &mode);
void addToRecentProjects(const QString &fileName, const QString &displayName);
void updateWelcomePage();
static ProjectExplorerPlugin *m_instance;
ProjectExplorerPluginPrivate *d;

View File

@@ -627,9 +627,6 @@ bool SessionManager::loadImpl(const QString &fileName)
if (debug)
qDebug() << "SessionManager - restoring session returned " << success;
if (success)
emit sessionLoaded();
return success;
}
@@ -1031,6 +1028,7 @@ bool SessionManager::loadSession(const QString &session)
if (QFileInfo(fileName).exists()) {
if (loadImpl(fileName)) {
updateName(session);
emit sessionLoaded();
return true;
}
} else {
@@ -1038,6 +1036,7 @@ bool SessionManager::loadSession(const QString &session)
if (!createImpl(sessionNameToFileName(session)))
return false;
updateName(session);
emit sessionLoaded();
return true;
}
return false;

View File

@@ -462,12 +462,12 @@ QVariantMap UserFileAccessor::restoreSettings(Project *project)
QApplication::translate("ProjectExplorer::UserFileAccessor",
"Using Old Project Settings File"),
QApplication::translate("ProjectExplorer::UserFileAccessor",
"A versioned backup of the .user settings file will be used, "
"<html><head/><body><p>A versioned backup of the .user settings file will be used, "
"because the non-versioned file was created by an incompatible "
"newer version of Qt Creator.\n"
"newer version of Qt Creator.</p><p>"
"Project settings changes made since the last time this version "
"of Qt Creator was used with this project are ignored, and changes "
"made now will <b>not</b> be propagated to the newer version."),
"made now will <b>not</b> be propagated to the newer version.</p></body></html>"),
QMessageBox::Ok);
project->setProperty(USERFILE_PROP, fileName);
skipBackup = true;

View File

@@ -67,7 +67,7 @@ class CORESHARED_EXPORT MetaInfo
friend class QmlDesigner::Internal::ModelPrivate;
friend class QmlDesigner::Internal::MetaInfoParser;
friend class QmlDesigner::Internal::SubComponentManagerPrivate;
friend bool QmlDesigner::operator==(const MetaInfo &, const MetaInfo &);
friend bool operator==(const MetaInfo &, const MetaInfo &);
public:
MetaInfo(const MetaInfo &metaInfo);

View File

@@ -68,12 +68,7 @@ QString ViewLogger::time() const
ViewLogger::ViewLogger(QObject *parent)
: AbstractView(parent)
{
#ifdef Q_OS_MAC
const QString tempPath = "/tmp";
#else
const QString tempPath = QDir::tempPath();
#endif
const QString path = tempPath + QString("/qmldesigner-logger-%1-XXXXXX.txt").
const QString path = QDir::tempPath() + QString("/qmldesigner-logger-%1-XXXXXX.txt").
arg(QDateTime::currentDateTime().toString(Qt::ISODate).
replace(':', '-'));
QTemporaryFile *temporaryFile = new QTemporaryFile(path, this);

View File

@@ -2,42 +2,20 @@
<ui version="4.0">
<class>Qt4ProjectManager::Internal::DebuggingHelper</class>
<widget class="QWidget" name="Qt4ProjectManager::Internal::DebuggingHelper">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>321</width>
<height>150</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<property name="margin">
<number>0</number>
</property>
<item>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
<widget class="QLabel" name="gdbHelperLabel">
<property name="toolTip">
<string>Helps showing content of Qt types. Only used in older versions of gdb.</string>
</property>
<property name="text">
<string>Gdb Helper:</string>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="gdbHelperStatus">
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="0" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="1" column="0">
<widget class="QLabel" name="qmlDumpLabel">
<property name="toolTip">
@@ -98,13 +76,6 @@
</property>
</spacer>
</item>
<item row="0" column="4">
<widget class="QPushButton" name="gdbHelperBuildButton">
<property name="text">
<string>Build</string>
</property>
</widget>
</item>
<item row="1" column="4">
<widget class="QPushButton" name="qmlDumpBuildButton">
<property name="text">
@@ -153,6 +124,43 @@
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="gdbHelperLabel">
<property name="toolTip">
<string>Helps showing content of Qt types. Only used in older versions of gdb.</string>
</property>
<property name="text">
<string>Gdb Helper:</string>
</property>
</widget>
</item>
<item row="4" column="1">
<widget class="QLabel" name="gdbHelperStatus">
<property name="text">
<string notr="true">TextLabel</string>
</property>
</widget>
</item>
<item row="4" column="2">
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item row="4" column="4">
<widget class="QPushButton" name="gdbHelperBuildButton">
<property name="text">
<string>Build</string>
</property>
</widget>
</item>
</layout>
</item>
<item>

View File

@@ -39,6 +39,8 @@
#include <qt4projectmanager/qtversionmanager.h>
#include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/debugginghelper.h>
#include <projectexplorer/abi.h>
#include <utils/qtcassert.h>
#include <QtCore/QCoreApplication>
@@ -47,7 +49,8 @@ using namespace Qt4ProjectManager::Internal;
using ProjectExplorer::DebuggingHelperLibrary;
DebuggingHelperBuildTask::DebuggingHelperBuildTask(const QtVersion *version, Tools tools)
DebuggingHelperBuildTask::DebuggingHelperBuildTask(const QtVersion *version, Tools tools) :
m_tools(tools & availableTools(version))
{
if (!version || !version->isValid())
return;
@@ -90,37 +93,34 @@ DebuggingHelperBuildTask::DebuggingHelperBuildTask(const QtVersion *version, Too
m_qmakeCommand = version->qmakeCommand();
m_makeCommand = tc->makeCommand();
m_mkspec = version->mkspec();
m_tools = tools;
// Check the build requirements of the tools
if (m_tools & QmlDump) {
if (!QmlDumpTool::canBuild(version)) {
m_tools ^= QmlDump;
}
}
if (m_tools & QmlObserver) {
if (!QmlObserverTool::canBuild(version)) {
m_tools ^= QmlObserver;
} else {
m_tools |= QmlDebugging;
}
}
if (m_tools & QmlDebugging) {
if (!QmlDebuggingLibrary::canBuild(version)) {
m_tools ^= QmlDebugging;
m_tools &= ~QmlObserver; // remove observer if set
}
}
}
DebuggingHelperBuildTask::~DebuggingHelperBuildTask()
{
}
DebuggingHelperBuildTask::Tools DebuggingHelperBuildTask::availableTools(const QtVersion *version)
{
QTC_ASSERT(version, return 0; )
// Check the build requirements of the tools
DebuggingHelperBuildTask::Tools tools = 0;
// Gdb helpers are needed on Mac/gdb only.
foreach (const ProjectExplorer::Abi &abi, version->qtAbis()) {
if (abi.os() == ProjectExplorer::Abi::MacOS) {
tools |= DebuggingHelperBuildTask::GdbDebugging;
break;
}
}
if (QmlDumpTool::canBuild(version))
tools |= QmlDump;
if (QmlDebuggingLibrary::canBuild(version)) {
tools |= QmlDebugging;
if (QmlObserverTool::canBuild(version))
tools |= QmlObserver; // requires QML debugging.
}
return tools;
}
void DebuggingHelperBuildTask::run(QFutureInterface<void> &future)
{
future.setProgressRange(0, 5);
@@ -185,8 +185,8 @@ bool DebuggingHelperBuildTask::buildDebuggingHelper(QFutureInterface<void> &futu
return false;
QStringList qmakeArgs;
qmakeArgs << QLatin1String("INCLUDEPATH+=") + qmlDebuggingDirectory + "/include";
qmakeArgs << QLatin1String("LIBS+=-L") + qmlDebuggingDirectory;
qmakeArgs << QLatin1String("INCLUDEPATH+=\"\\\"") + qmlDebuggingDirectory + "include\\\"\"";
qmakeArgs << QLatin1String("LIBS+=-L\"\\\"") + qmlDebuggingDirectory + QLatin1String("\\\"\"");
if (!QmlObserverTool::build(qmlObserverDirectory, m_makeCommand, m_qmakeCommand, m_mkspec,
m_environment, m_target, qmakeArgs, output, &m_errorMessage))

View File

@@ -62,13 +62,15 @@ public:
void run(QFutureInterface<void> &future);
static Tools availableTools(const QtVersion *version);
signals:
void finished(int qtVersionId, DebuggingHelperBuildTask::Tools tools, const QString &output);
private:
bool buildDebuggingHelper(QFutureInterface<void> &future, QString *output);
Tools m_tools;
const Tools m_tools;
int m_qtId;
QString m_qtInstallData;

View File

@@ -103,6 +103,11 @@ void MakeStep::setClean(bool clean)
m_clean = clean;
}
bool MakeStep::isClean() const
{
return m_clean;
}
QVariantMap MakeStep::toMap() const
{
QVariantMap map(ProjectExplorer::AbstractProcessStep::toMap());
@@ -163,7 +168,7 @@ bool MakeStep::init()
Utils::QtcProcess::addArgs(&args, m_userArgs);
if (!m_clean) {
if (!isClean()) {
if (!bc->defaultMakeTarget().isEmpty())
Utils::QtcProcess::addArg(&args, bc->defaultMakeTarget());
}
@@ -172,7 +177,6 @@ bool MakeStep::init()
// FIXME doing this without the user having a way to override this is rather bad
// so we only do it for unix and if the user didn't override the make command
// but for now this is the least invasive change
if (toolchain
&& toolchain->targetAbi().binaryFormat() != ProjectExplorer::Abi::PEFormat
&& m_makeCmd.isEmpty())
@@ -295,12 +299,17 @@ void MakeStepConfigWidget::updateDetails()
emit updateSummary();
return;
}
QString args = m_makeStep->userArguments();
if (!m_makeStep->isClean()) {
if (!bc->defaultMakeTarget().isEmpty())
Utils::QtcProcess::addArg(&args, bc->defaultMakeTarget());
}
// -w option enables "Enter"/"Leaving directory" messages, which we need for detecting the
// absolute file path
// FIXME doing this without the user having a way to override this is rather bad
// so we only do it for unix and if the user didn't override the make command
// but for now this is the least invasive change
QString args = m_makeStep->userArguments();
ProjectExplorer::ToolChain *toolChain = bc->toolChain();
if (toolChain
&& toolChain->targetAbi().binaryFormat() != ProjectExplorer::Abi::PEFormat

View File

@@ -99,6 +99,7 @@ public:
QString userArguments();
void setUserArguments(const QString &arguments);
void setClean(bool clean);
bool isClean() const;
QVariantMap toMap() const;

View File

@@ -71,7 +71,7 @@ public:
: m_buildTask(new DebuggingHelperBuildTask(version, DebuggingHelperBuildTask::QmlDump))
, m_failed(false)
{
qmlDumpBuilds()->insert(m_version.uniqueId(), this);
qmlDumpBuilds()->insert(version->uniqueId(), this);
connect(m_buildTask, SIGNAL(finished(int,DebuggingHelperBuildTask::Tools,QString)),
this, SLOT(finish(int,DebuggingHelperBuildTask::Tools,QString)),
@@ -156,7 +156,6 @@ private:
QList<ProjectToUpdate> m_projectsToUpdate;
Internal::DebuggingHelperBuildTask *m_buildTask; // deletes itself after run()
QtVersion m_version;
bool m_failed;
};
} // end of anonymous namespace

View File

@@ -59,7 +59,7 @@ bool QmlObserverTool::canBuild(const QtVersion *qtVersion)
{
return (qtVersion->supportsTargetId(Constants::DESKTOP_TARGET_ID)
|| qtVersion->supportsTargetId(Constants::QT_SIMULATOR_TARGET_ID))
&& (qtVersion->qtVersion() > QtVersionNumber(4, 7, 1));
&& (qtVersion->qtVersion() >= QtVersionNumber(4, 7, 1));
}
QString QmlObserverTool::toolForProject(ProjectExplorer::Project *project)

View File

@@ -322,7 +322,7 @@
<item row="10" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>
<widget class="Utils::PathChooser" name="keyFileLineEdit"/>
<widget class="Utils::PathChooser" name="keyFileLineEdit" native="true"/>
</item>
<item>
<widget class="QPushButton" name="makeKeyFileDefaultButton">
@@ -518,8 +518,8 @@
<slot>userNameEditingFinished()</slot>
<hints>
<hint type="sourcelabel">
<x>536</x>
<y>286</y>
<x>540</x>
<y>317</y>
</hint>
<hint type="destinationlabel">
<x>422</x>
@@ -534,8 +534,8 @@
<slot>passwordEditingFinished()</slot>
<hints>
<hint type="sourcelabel">
<x>412</x>
<y>314</y>
<x>424</x>
<y>349</y>
</hint>
<hint type="destinationlabel">
<x>423</x>
@@ -559,22 +559,6 @@
</hint>
</hints>
</connection>
<connection>
<sender>removeConfigButton</sender>
<signal>clicked()</signal>
<receiver>MaemoDeviceConfigurationsSettingsWidget</receiver>
<slot>deleteConfig()</slot>
<hints>
<hint type="sourcelabel">
<x>697</x>
<y>66</y>
</hint>
<hint type="destinationlabel">
<x>513</x>
<y>101</y>
</hint>
</hints>
</connection>
<connection>
<sender>passwordButton</sender>
<signal>toggled(bool)</signal>
@@ -598,8 +582,8 @@
<slot>keyFileEditingFinished()</slot>
<hints>
<hint type="sourcelabel">
<x>434</x>
<y>346</y>
<x>344</x>
<y>383</y>
</hint>
<hint type="destinationlabel">
<x>257</x>
@@ -614,8 +598,8 @@
<slot>keyFileEditingFinished()</slot>
<hints>
<hint type="sourcelabel">
<x>434</x>
<y>346</y>
<x>344</x>
<y>383</y>
</hint>
<hint type="destinationlabel">
<x>257</x>
@@ -647,7 +631,7 @@
<hints>
<hint type="sourcelabel">
<x>697</x>
<y>165</y>
<y>163</y>
</hint>
<hint type="destinationlabel">
<x>510</x>
@@ -662,8 +646,8 @@
<slot>authenticationTypeChanged()</slot>
<hints>
<hint type="sourcelabel">
<x>280</x>
<y>147</y>
<x>279</x>
<y>156</y>
</hint>
<hint type="destinationlabel">
<x>525</x>
@@ -695,7 +679,7 @@
<hints>
<hint type="sourcelabel">
<x>697</x>
<y>132</y>
<y>131</y>
</hint>
<hint type="destinationlabel">
<x>358</x>
@@ -710,8 +694,8 @@
<slot>timeoutEditingFinished()</slot>
<hints>
<hint type="sourcelabel">
<x>217</x>
<y>257</y>
<x>222</x>
<y>285</y>
</hint>
<hint type="destinationlabel">
<x>6</x>
@@ -726,8 +710,8 @@
<slot>timeoutEditingFinished()</slot>
<hints>
<hint type="sourcelabel">
<x>217</x>
<y>257</y>
<x>222</x>
<y>285</y>
</hint>
<hint type="destinationlabel">
<x>0</x>
@@ -774,8 +758,8 @@
<slot>showPassword(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>535</x>
<y>313</y>
<x>539</x>
<y>347</y>
</hint>
<hint type="destinationlabel">
<x>3</x>
@@ -807,7 +791,7 @@
<hints>
<hint type="sourcelabel">
<x>697</x>
<y>198</y>
<y>195</y>
</hint>
<hint type="destinationlabel">
<x>598</x>

View File

@@ -118,9 +118,11 @@ bool CodaRunControl::setupLauncher()
// We get the port from SymbianDeviceManager
appendMessage(tr("Connecting to '%1'...").arg(m_serialPort), NormalMessageFormat);
m_codaDevice = SymbianUtils::SymbianDeviceManager::instance()->getCodaDevice(m_serialPort);
bool ok = m_codaDevice && m_codaDevice->device()->isOpen();
if (!ok) {
if (m_codaDevice.isNull()) {
appendMessage(tr("Unable to create CODA connection. Please try again."), ErrorMessageFormat);
return false;
}
if (!m_codaDevice->device()->isOpen()) {
appendMessage(tr("Could not open serial device: %1").arg(m_codaDevice->device()->errorString()), ErrorMessageFormat);
return false;
}

View File

@@ -148,12 +148,20 @@ bool S60DeployConfiguration::isStaticLibrary(const Qt4ProFileNode &projectNode)
return false;
}
bool S60DeployConfiguration::hasSisPackage(const Qt4ProFileNode &projectNode) const
{
if (projectNode.projectType() != ApplicationTemplate
&& projectNode.projectType() != LibraryTemplate)
return false;
return !isStaticLibrary(projectNode);
}
QStringList S60DeployConfiguration::signedPackages() const
{
QList<Qt4ProFileNode *> list = qt4Target()->qt4Project()->allProFiles();
QStringList result;
foreach (Qt4ProFileNode *node, list) {
if (isStaticLibrary(*node)) //no sis package
if (!hasSisPackage(*node))
continue;
TargetInformation ti = node->targetInformation();
if (ti.valid)
@@ -176,7 +184,7 @@ QStringList S60DeployConfiguration::packageFileNamesWithTargetInfo() const
QList<Qt4ProFileNode *> leafs = qt4Target()->qt4Project()->allProFiles();
QStringList result;
foreach (Qt4ProFileNode *qt4ProFileNode, leafs) {
if (isStaticLibrary(*qt4ProFileNode)) //no sis package
if (!hasSisPackage(*qt4ProFileNode))
continue;
TargetInformation ti = qt4ProFileNode->targetInformation();
if (!ti.valid)
@@ -195,7 +203,7 @@ QStringList S60DeployConfiguration::packageTemplateFileNames() const
QList<Qt4ProFileNode *> list = qt4Target()->qt4Project()->allProFiles();
QStringList result;
foreach (Qt4ProFileNode *node, list) {
if (isStaticLibrary(*node)) //no sis package
if (!hasSisPackage(*node))
continue;
TargetInformation ti = node->targetInformation();
if (ti.valid)
@@ -209,7 +217,7 @@ QStringList S60DeployConfiguration::appPackageTemplateFileNames() const
QList<Qt4ProFileNode *> list = qt4Target()->qt4Project()->allProFiles();
QStringList result;
foreach (Qt4ProFileNode *node, list) {
if (isStaticLibrary(*node)) //no sis package
if (!hasSisPackage(*node))
continue;
TargetInformation ti = node->targetInformation();
if (ti.valid)

View File

@@ -131,6 +131,7 @@ private:
QString createPackageName(const QString &baseName) const;
bool isDebug() const;
bool isStaticLibrary(const Qt4ProFileNode &projectNode) const;
bool hasSisPackage(const Qt4ProFileNode &projectNode) const;
private:
ProjectExplorer::BuildConfiguration *m_activeBuildConfiguration;

View File

@@ -301,6 +301,9 @@ QWidget *S60DeployConfigurationWidget::createCommunicationChannel()
communicationChannelGridLayout->addLayout(wlanChannelLayout, 1, 1);
communicationChannelGroupBox->setLayout(communicationChannelGridLayout);
updateCommunicationChannelUi();
return communicationChannelGroupBox;
}
@@ -410,6 +413,33 @@ void S60DeployConfigurationWidget::setSerialPort(int index)
clearDeviceInfo();
}
void S60DeployConfigurationWidget::updateCommunicationChannelUi()
{
S60DeployConfiguration::CommunicationChannel channel = m_deployConfiguration->communicationChannel();
if (channel == S60DeployConfiguration::CommunicationTrkSerialConnection) {
m_trkRadioButton->setChecked(true);
m_codaRadioButton->setChecked(false);
m_serialRadioButton->setChecked(true);
m_wlanRadioButton->setDisabled(true);
m_ipAddress->setDisabled(true);
m_serialPortsCombo->setDisabled(false);
updateSerialDevices();
} else {
m_trkRadioButton->setChecked(false);
m_codaRadioButton->setChecked(true);
m_wlanRadioButton->setDisabled(false);
if (channel == S60DeployConfiguration::CommunicationCodaTcpConnection) {
m_ipAddress->setDisabled(false);
m_serialPortsCombo->setDisabled(true);
m_deviceInfoButton->setEnabled(true);
} else {
m_ipAddress->setDisabled(true);
m_serialPortsCombo->setDisabled(false);
updateSerialDevices();
}
}
}
void S60DeployConfigurationWidget::updateCommunicationChannel()
{
if (!m_trkRadioButton->isChecked() && !m_codaRadioButton->isChecked())
@@ -552,6 +582,10 @@ void S60DeployConfigurationWidget::updateDeviceInfo()
} else if (m_deployConfiguration->communicationChannel() == S60DeployConfiguration::CommunicationCodaSerialConnection) {
const SymbianUtils::SymbianDevice commDev = currentDevice();
m_codaInfoDevice = SymbianUtils::SymbianDeviceManager::instance()->getCodaDevice(commDev.portName());
if (m_codaInfoDevice.isNull()) {
setDeviceInfoLabel(tr("Unable to create CODA connection. Please try again."), true);
return;
}
if (!m_codaInfoDevice->device()->isOpen()) {
setDeviceInfoLabel(m_codaInfoDevice->device()->errorString(), true);
return;

View File

@@ -100,6 +100,7 @@ private slots:
void slotWaitingForTrkClosed();
void silentInstallChanged(int);
void updateCommunicationChannel();
void updateCommunicationChannelUi();
void updateWlanAddress(const QString &address);
void cleanWlanAddress();
void codaEvent(const Coda::CodaEvent &event);

View File

@@ -570,7 +570,10 @@ void S60DeployStep::handleSymbianInstall(const Coda::CodaCommandResult &result)
else
initFileInstallation();
} else {
reportError(tr("Installation failed: %1").arg(result.errorString()));
reportError(tr("Installation failed: %1; "
"see %2 for descriptions of the error codes")
.arg(result.errorString(),
QLatin1String("http://wiki.forum.nokia.com/index.php/Symbian_OS_Error_Codes")));
}
}

View File

@@ -295,12 +295,7 @@ QString S60DeviceRunConfiguration::localExecutableFileName() const
if (!ti.valid)
return QString();
const ProjectExplorer::Abi hostAbi = ProjectExplorer::Abi::hostAbi();
if (hostAbi.os() == ProjectExplorer::Abi::LinuxOS) {
return executableFromPackageUnix(ti.buildDir + QLatin1Char('/') + ti.target + QLatin1String("_template.pkg"));
}
ProjectExplorer::ToolChain *tc = qt4Target()->activeBuildConfiguration()->toolChain();
ProjectExplorer::ToolChain *tc = target()->activeBuildConfiguration()->toolChain();
return localExecutableFromVersion(qtVersion(), symbianTarget(), targetName(), tc);
}

View File

@@ -877,7 +877,7 @@ void Qt4Project::addDefaultBuild()
void Qt4Project::proFileParseError(const QString &errorMessage)
{
Core::ICore::instance()->messageManager()->printToOutputPane(errorMessage);
Core::ICore::instance()->messageManager()->printToOutputPanePopup(errorMessage);
}
ProFileReader *Qt4Project::createProFileReader(Qt4ProFileNode *qt4ProFileNode, Qt4BuildConfiguration *bc)

View File

@@ -39,10 +39,6 @@
#include "qt4projectmanagerconstants.h"
#include "qt4target.h"
#include "qtversionmanager.h"
#include "qmldumptool.h"
#include "qmlobservertool.h"
#include "qmldebugginglibrary.h"
#include "debugginghelperbuildtask.h"
#include <projectexplorer/abi.h>
#include <projectexplorer/debugginghelper.h>
@@ -439,20 +435,22 @@ void QtOptionsPageWidget::removeQtDir()
void QtOptionsPageWidget::updateDebuggingHelperUi()
{
QtVersion *version = currentVersion();
const QtVersion *version = currentVersion();
const QTreeWidgetItem *currentItem = m_ui->qtdirList->currentItem();
if (!version || !version->supportsBinaryDebuggingHelper()) {
m_ui->debuggingHelperWidget->setVisible(false);
} else {
bool canBuildQmlDumper = QmlDumpTool::canBuild(version);
bool canBuildQmlDebuggingLib = QmlDebuggingLibrary::canBuild(version);
bool canBuildQmlObserver = QmlObserverTool::canBuild(version);
const DebuggingHelperBuildTask::Tools availableTools = DebuggingHelperBuildTask::availableTools(version);
const bool canBuildGdbHelper = availableTools & DebuggingHelperBuildTask::GdbDebugging;
const bool canBuildQmlDumper = availableTools & DebuggingHelperBuildTask::QmlDump;
const bool canBuildQmlDebuggingLib = availableTools & DebuggingHelperBuildTask::QmlDebugging;
const bool canBuildQmlObserver = availableTools & DebuggingHelperBuildTask::QmlObserver;
bool hasGdbHelper = !version->gdbDebuggingHelperLibrary().isEmpty();
bool hasQmlDumper = version->hasQmlDump();
bool hasQmlDebuggingLib = version->hasQmlDebuggingLibrary();
bool hasQmlObserver = !version->qmlObserverTool().isEmpty();
const bool hasGdbHelper = !version->gdbDebuggingHelperLibrary().isEmpty();
const bool hasQmlDumper = version->hasQmlDump();
const bool hasQmlDebuggingLib = version->hasQmlDebuggingLibrary();
const bool hasQmlObserver = !version->qmlObserverTool().isEmpty();
bool isBuildingGdbHelper = false;
bool isBuildingQmlDumper = false;
@@ -495,11 +493,15 @@ void QtOptionsPageWidget::updateDebuggingHelperUi()
gdbHelperText = QDir::toNativeSeparators(version->gdbDebuggingHelperLibrary());
gdbHelperTextFlags = Qt::TextSelectableByMouse;
} else {
if (canBuildGdbHelper) {
gdbHelperText = tr("<i>Not yet built.</i>");
} else {
gdbHelperText = tr("<i>Not needed.</i>");
}
}
m_debuggingHelperUi->gdbHelperStatus->setText(gdbHelperText);
m_debuggingHelperUi->gdbHelperStatus->setTextInteractionFlags(gdbHelperTextFlags);
m_debuggingHelperUi->gdbHelperBuildButton->setEnabled(!isBuildingGdbHelper);
m_debuggingHelperUi->gdbHelperBuildButton->setEnabled(canBuildGdbHelper && !isBuildingGdbHelper);
QString qmlDumpStatusText;
Qt::TextInteractionFlags qmlDumpStatusTextFlags = Qt::NoTextInteraction;
@@ -535,7 +537,7 @@ void QtOptionsPageWidget::updateDebuggingHelperUi()
if (qmlDebuggingLibStatusText != debugPath) {
if (!qmlDebuggingLibStatusText.isEmpty()
&& !debugPath.isEmpty()) {
qmlDebuggingLibStatusText += QLatin1String("\n");
qmlDebuggingLibStatusText += QLatin1Char('\n');
}
qmlDebuggingLibStatusText += debugPath;
}

View File

@@ -177,33 +177,40 @@ QtVersionManager::QtVersionManager()
// Update from 2.1 or earlier:
QString mingwDir = s->value(QLatin1String("MingwDirectory")).toString();
if (!mingwDir.isEmpty()) {
QFileInfo fi(mingwDir + QLatin1String("/bin/g++.exe"));
if (fi.exists() && fi.isExecutable()) {
ProjectExplorer::MingwToolChain *tc = createToolChain<ProjectExplorer::MingwToolChain>(ProjectExplorer::Constants::MINGW_TOOLCHAIN_ID);
if (tc) {
tc->setCompilerPath(QDir::fromNativeSeparators(mingwDir) + QLatin1String("/bin/gcc.exe"));
tc->setCompilerPath(fi.absoluteFilePath());
tc->setDisplayName(tr("MinGW from %1").arg(version->displayName()));
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
}
}
}
QString mwcDir = s->value(QLatin1String("MwcDirectory")).toString();
if (!mwcDir.isEmpty()) {
QFileInfo fi(mwcDir + QLatin1String("/x86Build/Symbian_Tools/Command_Line_Tools/mwwinrc.exe"));
if (fi.exists() && fi.isExecutable()) {
WinscwToolChain *tc = createToolChain<WinscwToolChain>(Constants::WINSCW_TOOLCHAIN_ID);
if (tc) {
tc->setCompilerPath(QDir::fromNativeSeparators(mwcDir)
+ QLatin1String("/x86Build/Symbian_Tools/Command_Line_Tools/mwwinrc.exe"));
tc->setCompilerPath(fi.absoluteFilePath());
tc->setDisplayName(tr("WINSCW from %1").arg(version->displayName()));
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
}
}
}
QString gcceDir = s->value(QLatin1String("GcceDirectory")).toString();
if (!gcceDir.isEmpty()) {
QFileInfo fi(gcceDir + QLatin1String("/bin/arm-none-symbianelf-g++.exe"));
if (fi.exists() && fi.isExecutable()) {
GcceToolChain *tc = createToolChain<GcceToolChain>(Constants::GCCE_TOOLCHAIN_ID);
if (tc) {
tc->setCompilerPath(QDir::fromNativeSeparators(gcceDir)
+ QLatin1String("/bin/arm-none-symbianelf-g++.exe"));
tc->setCompilerPath(fi.absoluteFilePath());
tc->setDisplayName(tr("GCCE from %1").arg(version->displayName()));
ProjectExplorer::ToolChainManager::instance()->registerToolChain(tc);
}
}
}
m_versions.insert(version->uniqueId(), version);
}
@@ -369,6 +376,11 @@ void QtVersionManager::writeVersionsIntoSettings()
s->setValue("autodetectionSource", version->autodetectionSource());
s->setValue("S60SDKDirectory", version->systemRoot());
s->setValue(QLatin1String("SBSv2Directory"), version->sbsV2Directory());
// Remove obsolete settings: New toolchains would be created at each startup
// otherwise, overriding manually set ones.
s->remove(QLatin1String("MingwDirectory"));
s->remove(QLatin1String("MwcDirectory"));
s->remove(QLatin1String("GcceDirectory"));
++it;
}
s->endArray();

View File

@@ -60,6 +60,7 @@ macx {
contains(QT_CONFIG, reduce_exports):CONFIG += hide_symbols
CONFIG += plugin plugin_with_soname
linux*:QMAKE_LFLAGS += $$QMAKE_LFLAGS_NOUNDEF
!macx {
target.path = /$$IDE_LIBRARY_BASENAME/qtcreator/plugins/$$PROVIDER

View File

@@ -137,10 +137,10 @@ QDateTime CodaCommandResult::tcfTimeToQDateTime(quint64 tcfTimeMS)
void CodaCommandError::write(QTextStream &str) const
{
if (isError()) {
if (timeMS)
if (debug && timeMS)
str << CodaCommandResult::tcfTimeToQDateTime(timeMS).toString(Qt::ISODate) << ": ";
str << "Error code: " << code
<< " '" << format << '\'';
str << "'" << format << '\'' //for symbian the format is the real error message
<< " Code: " << code;
if (!alternativeOrganization.isEmpty())
str << " ('" << alternativeOrganization << "', code: " << alternativeCode << ')';
} else{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

@@ -1,196 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeIconFile</key>
<string>qtcreator.icns</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>pro</string>
</array>
<key>CFBundleTypeName</key>
<string>Qt Project File</string>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>pri</string>
</array>
<key>CFBundleTypeName</key>
<string>Qt Project Include File</string>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>qrc</string>
</array>
<key>CFBundleTypeName</key>
<string>Qt Resource File</string>
<key>LSHandlerRank</key>
<string>Default</string>
</dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeExtensions</key>
<array>
<string>pri</string>
</array>
<key>CFBundleTypeName</key>
<string>Qt UI File</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>h</string>
<string>hpp</string>
</array>
<key>CFBundleTypeName</key>
<string>Header File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>cc</string>
<string>CC</string>
<string>cp</string>
<string>CP</string>
<string>cpp</string>
<string>CPP</string>
<string>cxx</string>
<string>CXX</string>
<string>c++</string>
<string>C++</string>
</array>
<key>CFBundleTypeName</key>
<string>C++ Source File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>mm</string>
<string>MM</string>
</array>
<key>CFBundleTypeName</key>
<string>Objective-C++ Source File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>m</string>
</array>
<key>CFBundleTypeName</key>
<string>Objective-C Source File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>c</string>
<string>C</string>
</array>
<key>CFBundleTypeName</key>
<string>C Source File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
<string>utxt</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>txt</string>
<string>text</string>
</array>
<key>CFBundleTypeName</key>
<string>Text File</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>TEXT</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*</string>
</array>
<key>CFBundleTypeName</key>
<string>NSStringPboardType</string>
<key>CFBundleTypeOSTypes</key>
<array>
<string>****</string>
</array>
<key>CFBundleTypeRole</key>
<string>Editor</string>
</dict>
</array>
<key>NSHumanReadableCopyright</key>
<string>(C) 2008-2011 Nokia Corporation
Commercial Usage
Licensees holding valid Qt Commercial licenses may use this file in accordance with the Qt Commercial License Agreement provided with the Software or, alternatively, in accordance with the terms contained in a written agreement between you and Nokia.
GNU Lesser General Public License Usage
Alternatively, this plugin may be used under the terms of the GNU Lesser General Public License version 2.1 as published by the Free Software Foundation 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.</string>
<key>CFBundleIconFile</key>
<string>@ICON@</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
<string>@EXECUTABLE@</string>
<key>CFBundleIdentifier</key>
<string>com.nokia.bauhaus</string>
<key>CFBundleVersion</key>
<string>1.0.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
</dict>
</plist>

View File

@@ -1,99 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "aboutdialog.h"
#include "integrationcore.h"
#include "pluginmanager.h"
#include <QtCore/QDebug>
#include <QtCore/QUrl>
#include <QtGui/QApplication>
#include <QtGui/QGridLayout>
#include <QtGui/QTextEdit>
#include <QtGui/QPushButton>
static QString aboutText = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0//EN\" \"http://www.w3.org/TR/REC-html40/strict.dtd\">"
"<html><head><style type=\"text/css\">\np, li { white-space: pre-wrap; }\n</style></head><body style=\"font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;\">"
"<p align=\"center\"><img src=\"logo\"/></p>"
"<h2 align=\"center\">Bauhaus</h2>"
"</body></html>";
AboutDialog::AboutDialog(QWidget* parent):
QDialog(parent)
{
setWindowFlags(windowFlags() | Qt::CustomizeWindowHint | Qt::WindowCloseButtonHint);
setStyleSheet(QString("background-color: #FFFFFF;"));
QGridLayout* dialogLayout = new QGridLayout;
setLayout(dialogLayout);
QTextEdit* textArea = new QTextEdit(this);
textArea->setReadOnly(true);
textArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
textArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
textArea->setFrameShape(QFrame::NoFrame);
textArea->setLineWidth(0);
QImage logoImage = QImage(QString(":/128xBauhaus_Logo.png"));
textArea->document()->addResource(QTextDocument::ImageResource, QUrl("logo"), logoImage);
textArea->setHtml(aboutText);
dialogLayout->addWidget(textArea, 0, 0, 1, 3);
QPushButton* aboutPluginsButton = new QPushButton("About Plug-ins...", this);
dialogLayout->addWidget(aboutPluginsButton, 1, 0, 1, 1);
connect(aboutPluginsButton, SIGNAL(clicked()), this, SLOT(doAboutPlugins()));
QPushButton* aboutQtButton = new QPushButton("About Qt...", this);
dialogLayout->addWidget(aboutQtButton, 1, 1, 1, 1);
connect(aboutQtButton, SIGNAL(clicked()), qApp, SLOT(aboutQt()));
QPushButton* closeButton = new QPushButton("Close", this);
dialogLayout->addWidget(closeButton, 1, 2, 1, 1);
connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
}
void AboutDialog::go(QWidget* parent)
{
AboutDialog dialog(parent);
dialog.setWindowTitle(tr("About Bauhaus", "AboutDialog"));
dialog.exec();
}
void AboutDialog::doAboutPlugins()
{
QmlDesigner::IntegrationCore *core = QmlDesigner::IntegrationCore::instance();
QDialog* dialog = core->pluginManager()->createAboutPluginDialog(this);
dialog->setWindowFlags(Qt::Sheet);
dialog->exec();
}

View File

@@ -1,57 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef AboutDialog_h
#define AboutDialog_h
#include <QtGui/QDialog>
/*!
This dialog could do with some animations and general beautification.
*/
class AboutDialog: public QDialog
{
Q_OBJECT
public:
static void go(QWidget* parent = 0);
public slots:
void doAboutPlugins();
private:
AboutDialog(QWidget* parent = 0);
};
#endif // AboutDialog_h

View File

@@ -1,47 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "application.h"
#include <QtCore/QCoreApplication>
#include <QtCore/QFileInfo>
QString Application::sharedDirPath()
{
QString path = QCoreApplication::applicationDirPath();
#ifdef Q_OS_MACX
path += "/../../..";
#endif // Q_OS_MACX
return QFileInfo(path + "/../../../../share/qtcreator/qmldesigner/").absoluteFilePath();
}

View File

@@ -1,44 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef APPLICATION_H
#define APPLICATION_H
#include <QtCore/QString>
class Application {
public:
static QString sharedDirPath();
};
#endif // APPLICATION_H

View File

@@ -1,3 +0,0 @@
QStatusBar {
border-top: 1px solid #b8b9b8;
}

View File

@@ -1,3 +0,0 @@
QStatusBar {
border-top: 1px solid #b8b9b8;
}

View File

@@ -1,28 +0,0 @@
QTreeView#widgetTreeView {
background: #bababa;
border: 0px;
font-size: 11px;
selection-color: #fff;
selection-background-color: #3875d7;
font-variant: normal;
}
//QTreeView::item {
// padding: 3px;
//}
//
//QTreeView::item:selected {
// border: 3px solid #ff0000;
// padding: 3px;
// background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #3c77ad, stop: 1 #003882);
//}
//QTreeView#widgetTreeView::item {
// inactive, in favour of the 2 items above (for testing, as the QTreeView seems to contain a bug which prevents border/padding to work correctly
// border: 1px solid #ff0000;
//}
QStackedWidget#widgetTreeStack {
background: #bababa;
border: 0px;
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -1,18 +0,0 @@
<RCC>
<qresource prefix="/">
<file>toolbar-cssedit.png</file>
<file>toolbar-edit.png</file>
<file>bauhaus-windows.css</file>
<file>bauhaus-macos.css</file>
<file>bauhaus-x11.css</file>
<file>128xBauhaus_Logo.png</file>
<file>bauhaus.css</file>
<file alias="qmldesigner/templates/General/Empty QWidget">templates/qwidget.qml</file>
<file alias="qmldesigner/templates/General/Empty QGraphicsView">templates/qgraphicsview.qml</file>
<file>64xBauhaus_Logo.png</file>
<file>preview.png</file>
<file alias="qmldesigner/templates/General/Empty Fx">templates/fx.qml</file>
<file>16xBauhaus_Logo.png</file>
<file>256xBauhaus_Logo.png</file>
</qresource>
</RCC>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

@@ -1,165 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include <QtDebug>
#include <QtCore/QFile>
#include <QtCore/QTextStream>
#include <QtGui/QApplication>
#include <integrationcore.h>
#include <pluginmanager.h>
#include <model.h>
#include <exception.h>
#include "mainwindow.h"
enum {
debug = false
};
static void doStyling(QApplication& app)
{
QString ws;
#ifdef Q_WS_MAC
ws = "macos";
#endif // Q_WS_MAC
#ifdef Q_WS_WIN
ws = "windows";
#endif // Q_WS_WIN
#ifdef Q_WS_X11
ws = "x11";
#endif // Q_WS_X11
QFile platformCssFile(QString(":/bauhaus-%1.css").arg(ws));
platformCssFile.open(QIODevice::ReadOnly | QIODevice::Text);
QTextStream platformCssStream(&platformCssFile);
QString styleSheet(platformCssStream.readAll());
platformCssFile.close();
QFile genericCssFile(QLatin1String(":/bauhaus.css"));
genericCssFile.open(QIODevice::ReadOnly | QIODevice::Text);
QTextStream genericCssStream(&genericCssFile);
styleSheet.append(genericCssStream.readAll());
genericCssFile.close();
app.setStyleSheet(styleSheet);
}
static void parseArguments(const QStringList& argumentList, MainWindow& mainWindow)
{
QStringList passArgumentList;
passArgumentList.append("--no-resync");
passArgumentList.append("-h");
passArgumentList.append("-graphicssystem");
for (int i = 1; i < argumentList.size(); ++i) {
if (argumentList[i].at(0) == QLatin1Char('-')) {
if (argumentList[i] == "--file" || argumentList[i] == "-file" || argumentList[i] == "-f") {
++i;
if (i < argumentList.size()) {
mainWindow.openFile(argumentList[i]);
} else {
mainWindow.doOpen();
}
} else if (argumentList[i] == "--help" || argumentList[i] == "-h") {
qWarning() << "Usage: bauhaus [OPTION...]\n";
qWarning() << " -f, --file open this file";
qWarning() << " --no-resync disable rewriter";
exit(0);
} else if (passArgumentList.contains(argumentList[i].split('=').first())) {
} else {
qWarning() << "bauhaus: unrecognized option "<< argumentList[i];
qWarning() << "Try `bauhaus --help'";
exit(1);
}
} else {
mainWindow.openFile(argumentList[i]);
}
}
}
static QStringList pluginPaths()
{
QStringList result;
#ifdef Q_OS_MAC
result += QCoreApplication::applicationDirPath() + "/../PlugIns/Bauhaus/ItemLibs";
#else // Q_OS_MAC
result += QCoreApplication::applicationDirPath() + "/../lib/itemlibs";
#endif // Q_OS_MAC
return result;
}
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Q_INIT_RESOURCE(bauhaus);
doStyling(app);
#ifdef Q_WS_X11
QIcon applicationIcon;
applicationIcon.addFile(":/16xBauhaus_Log");
applicationIcon.addFile(":/64xBauhaus_Logo.png");
applicationIcon.addFile(":/128xBauhaus_Logo.png");
applicationIcon.addFile(":/256xBauhaus_Logo.png");
Q_ASSERT(!applicationIcon.isNull());
app.setWindowIcon(applicationIcon);
#endif
QCoreApplication::setOrganizationName("Nokia");
QCoreApplication::setOrganizationDomain("nokia.com");
QCoreApplication::setApplicationName("Bauhaus");
try {
QmlDesigner::IntegrationCore core;
core.pluginManager()->setPluginPaths(pluginPaths());
MainWindow mainWindow;
mainWindow.show();
parseArguments(app.arguments(), mainWindow);
// if (mainWindow.documentCount() == 0)
// mainWindow.showWelcomeScreen();
//
return app.exec();
} catch (const QmlDesigner::Exception &exception) {
qWarning() << exception;
return -1;
}
}

View File

@@ -1,569 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include <QtCore/QtDebug>
#include <QtCore/QBuffer>
#include <QtCore/QFileInfo>
#include <QtCore/QSettings>
#include <QtGui/QAction>
#include <QtGui/QApplication>
#include <QtGui/QBoxLayout>
#include <QtGui/QCloseEvent>
#include <QtGui/QErrorMessage>
#include <QtGui/QFrame>
#include <QtGui/QMessageBox>
#include <QtGui/QSplitter>
#include <QtGui/QStackedWidget>
#include <QtGui/QStatusBar>
#include <QFile>
#include "aboutdialog.h"
#include "allpropertiesviewcontroller.h"
#include "designdocumentcontroller.h"
#include "multipledocumentscontroller.h"
#include "mainwindow.h"
#include "stylemanager.h"
#include "widgetboxcontroller.h"
#include "navigatorcontroller.h"
#include "stateseditorcontroller.h"
#include "xuifiledialog.h"
#include "welcomescreen.h"
using namespace QmlDesigner;
class StyleAction: public QAction
{
public:
StyleAction(const QString& text, const QString& styleName, QObject* parent): QAction(text, parent), m_styleName(styleName) {}
StyleAction(const QString& text, QObject* parent): QAction(text, parent), m_styleName(QString()) {}
QString styleName() const { return m_styleName; }
private:
QString m_styleName;
};
MainWindow::MainWindow(QWidget* parent):
QMainWindow(parent),
m_shutdown(false),
m_lastPath(QString()),
m_documentCount(0),
m_menuBar(new QMenuBar(this)),
m_itemLibraryController(new ItemLibraryController(this)),
m_navigatorController(new NavigatorController(this)),
m_statesEditorController(new StatesEditorController(this)),
m_propertiesViewController(new AllPropertiesViewController(this)),
m_multipleDocumentsController(new MultipleDocumentsController(this)),
m_recentFilesMenu(0),
m_mainArea(new QStackedWidget(this)),
m_welcomeScreen(new WelcomeScreen(this))
{
// setWindowFlags(Qt::MacWindowToolBarButtonHint);
// setUnifiedTitleAndToolBarOnMac(true);
setObjectName(QLatin1String("mainWindow"));
setWindowTitle(tr("Bauhaus", "MainWindowClass"));
resize(1046, 700);
QFile file(":/qmldesigner/stylesheet.css");
file.open(QFile::ReadOnly);
QString styleSheet = QLatin1String(file.readAll());
setStyleSheet(styleSheet);
setMenuBar(m_menuBar);
createMenus();
createMainArea();
createStatusBar();
updateActions();
updateMainArea();
connect(m_multipleDocumentsController, SIGNAL(documentCountChanged(unsigned)), this, SLOT(documentCountChanged(unsigned)));
connect(m_welcomeScreen, SIGNAL(newFile(QString)), this, SLOT(newFile(QString)));
connect(m_welcomeScreen, SIGNAL(openFile(QString)), this, SLOT(openFile(QString)));
}
MainWindow::~MainWindow()
{
m_documentActions.clear();
}
int MainWindow::documentCount() const
{
return m_documentCount;
}
void MainWindow::closeEvent(QCloseEvent *event)
{
m_shutdown = true;
m_multipleDocumentsController->closeAll(true);
event->setAccepted(false);
}
void MainWindow::doQuit()
{
m_shutdown = true;
m_multipleDocumentsController->closeAll(true);
}
void MainWindow::createMenus()
{
// File menu:
QMenu* fileMenu = new QMenu(tr("&File"), m_menuBar);
m_menuBar->addMenu(fileMenu);
QAction* newAction = new QAction(tr("&New..."), fileMenu);
newAction->setShortcut(QKeySequence(tr("Ctrl+N")));
connect(newAction, SIGNAL(triggered()), this, SLOT(doNew()));
fileMenu->addAction(newAction);
QAction* openAction = new QAction(tr("&Open..."), fileMenu);
openAction->setShortcut(QKeySequence(tr("Ctrl+O")));
connect(openAction, SIGNAL(triggered()), this, SLOT(doOpen()));
fileMenu->addAction(openAction);
m_recentFilesMenu = new QMenu(tr("Recent Files"), fileMenu);
connect(m_recentFilesMenu, SIGNAL(aboutToShow()), this, SLOT(showRecentFilesMenu()));
fileMenu->addMenu(m_recentFilesMenu);
fileMenu->addSeparator();
QAction* saveAction = new QAction(tr("&Save"), fileMenu);
saveAction->setShortcut(QKeySequence(tr("Ctrl+S")));
connect(saveAction, SIGNAL(triggered()), m_multipleDocumentsController, SLOT(doSave()));
fileMenu->addAction(saveAction);
m_documentActions.append(saveAction);
QAction* saveAsAction = new QAction(tr("Save &As..."), fileMenu);
connect(saveAsAction, SIGNAL(triggered()), m_multipleDocumentsController, SLOT(doSaveAs()));
fileMenu->addAction(saveAsAction);
m_documentActions.append(saveAsAction);
fileMenu->addSeparator();
m_previewAction = new QAction(tr("&Preview"), fileMenu);
m_previewAction->setShortcut(QKeySequence(tr("Ctrl+R")));
// m_previewAction->setIcon(QIcon(":/preview.png"));
m_previewAction->setCheckable(true);
connect(m_previewAction, SIGNAL(toggled(bool)), m_multipleDocumentsController, SLOT(doPreview(bool)));
connect(m_multipleDocumentsController, SIGNAL(previewVisibilityChanged(bool)), m_previewAction, SLOT(setChecked(bool)));
fileMenu->addAction(m_previewAction);
m_documentActions.append(m_previewAction);
m_previewWithDebugAction = new QAction(tr("&Preview with Debug"), fileMenu);
m_previewWithDebugAction->setShortcut(QKeySequence(tr("Ctrl+D")));
m_previewWithDebugAction->setCheckable(true);
connect(m_previewWithDebugAction, SIGNAL(toggled(bool)), m_multipleDocumentsController, SLOT(doPreviewWithDebug(bool)));
connect(m_multipleDocumentsController, SIGNAL(previewWithDebugVisibilityChanged(bool)), m_previewWithDebugAction, SLOT(setChecked(bool)));
fileMenu->addAction(m_previewWithDebugAction);
m_documentActions.append(m_previewWithDebugAction);
#ifndef Q_WS_MAC
fileMenu->addSeparator();
#endif // !Q_WS_MAC
QAction* quitAction = new QAction(tr("&Quit"), fileMenu);
quitAction->setShortcut(QKeySequence(tr("Ctrl+Q")));
fileMenu->addAction(quitAction);
connect(quitAction, SIGNAL(triggered()), this, SLOT(doQuit()));
// Edit menu:
QMenu* editMenu = new QMenu(tr("&Edit"), m_menuBar);
m_menuBar->addMenu(editMenu);
QAction* undoAction = m_multipleDocumentsController->undoAction();
undoAction->setParent(editMenu);
undoAction->setShortcut(tr("Ctrl+Z"));
editMenu->addAction(undoAction);
QAction* redoAction = m_multipleDocumentsController->redoAction();
redoAction->setParent(editMenu);
#ifdef Q_WS_WIN
redoAction->setShortcut(tr("Ctrl+Y"));
#else // !Q_WS_WIN
redoAction->setShortcut(tr("Ctrl+Shift+Z"));
#endif // Q_WS_WIN
editMenu->addAction(redoAction);
editMenu->addSeparator();
QAction *copyAction = new QAction(tr("&Copy"), editMenu);
connect(copyAction, SIGNAL(triggered()), m_multipleDocumentsController, SLOT(doCopy()));
copyAction->setShortcuts(QList<QKeySequence>() << QKeySequence(QKeySequence::Copy));
editMenu->addAction(copyAction);
m_documentActions.append(copyAction);
QAction *cutAction = new QAction(tr("&Cut"), editMenu);
connect(cutAction, SIGNAL(triggered()), m_multipleDocumentsController, SLOT(doCut()));
cutAction->setShortcuts(QList<QKeySequence>() << QKeySequence(QKeySequence::Cut));
editMenu->addAction(cutAction);
m_documentActions.append(cutAction);
QAction *pasteAction = new QAction(tr("&Paste"), editMenu);
connect(pasteAction, SIGNAL(triggered()), m_multipleDocumentsController, SLOT(doPaste()));
pasteAction->setShortcuts(QList<QKeySequence>() << QKeySequence(QKeySequence::Paste));
editMenu->addAction(pasteAction);
m_documentActions.append(pasteAction);
QAction *deleteAction = new QAction(tr("&Delete"), editMenu);
connect(deleteAction, SIGNAL(triggered()), m_multipleDocumentsController, SLOT(doDelete()));
deleteAction->setShortcuts(QList<QKeySequence>() << QKeySequence(tr("Del")) << QKeySequence(tr("Backspace")));
editMenu->addAction(deleteAction);
m_documentActions.append(deleteAction);
// View menu:
QMenu* viewMenu = new QMenu(tr("&View"), m_menuBar);
m_menuBar->addMenu(viewMenu);
//
// m_showNewLookPropertiesAction = viewMenu->addAction(tr("&New Look Properties"));
// m_showNewLookPropertiesAction->setCheckable(true);
// m_showNewLookPropertiesAction->setEnabled(false);
// connect(m_showNewLookPropertiesAction, SIGNAL(triggered()), m_propertiesViewController, SLOT(showNewLookProperties()));
// m_documentActions.append(m_showNewLookPropertiesAction);
//
// m_showTraditionalPropertiesAction = viewMenu->addAction(tr("&Traditional Properties"));
// m_showTraditionalPropertiesAction->setCheckable(true);
// m_showTraditionalPropertiesAction->setEnabled(false);
// connect(m_showTraditionalPropertiesAction, SIGNAL(triggered()), m_propertiesViewController, SLOT(showTraditionalProperties()));
// m_documentActions.append(m_showTraditionalPropertiesAction);
//
// QActionGroup* propertiesLookGroup = new QActionGroup(this);
// propertiesLookGroup->addAction(m_showNewLookPropertiesAction);
// propertiesLookGroup->addAction(m_showTraditionalPropertiesAction);
// m_showNewLookPropertiesAction->setChecked(true);
// viewMenu->addSeparator();
#ifdef ENABLE_TEXT_VIEW
QAction* showFormAction = m_multipleDocumentsController->showFormAction(viewMenu);
viewMenu->addAction(showFormAction);
QAction* showTextAction = m_multipleDocumentsController->showTextAction(viewMenu);
viewMenu->addAction(showTextAction);
QActionGroup* formTextGroup = new QActionGroup(this);
formTextGroup->addAction(showFormAction);
formTextGroup->addAction(showTextAction);
showFormAction->setChecked(true);
viewMenu->addSeparator();
#endif // ENABLE_TEXT_VIEW
// Style selection:
// QMenu* styleMenu = viewMenu->addMenu("&Style");
// QActionGroup* styleGroup = new QActionGroup(this);
//
// StyleAction* defaultStyleAction = new StyleAction("&Default", viewMenu);
// styleMenu->addAction(defaultStyleAction);
// defaultStyleAction->setCheckable(true);
// styleGroup->addAction(defaultStyleAction);
// connect(defaultStyleAction, SIGNAL(triggered()), this, SLOT(styleActionTriggered()));
//
// styleMenu->addSeparator();
//
// foreach (const QString styleName, StyleManager::styles()) {
// StyleAction* styleAction = new StyleAction(styleName, styleName, viewMenu);
// styleMenu->addAction(styleAction);
// styleAction->setCheckable(true);
// styleGroup->addAction(styleAction);
// connect(styleAction, SIGNAL(triggered()), this, SLOT(styleActionTriggered()));
// }
//
// defaultStyleAction->setChecked(true);
// Help menu:
QMenu* helpMenu = new QMenu(tr("&Help"), this);
helpMenu->setObjectName(QString::fromAscii("helpMenu"));
m_menuBar->addMenu(helpMenu);
QAction* aboutAppAction = new QAction(tr("&About..."), this);
aboutAppAction->setObjectName(QString::fromAscii("aboutAppAction"));
connect(aboutAppAction, SIGNAL(triggered()), this, SLOT(doAbout()));
helpMenu->addAction(aboutAppAction);
}
void MainWindow::showRecentFilesMenu()
{
m_recentFilesMenu->clear();
foreach (const QString &path, recentFiles()) {
QAction *action = m_recentFilesMenu->addAction(path);
action->setData(path);
connect(action, SIGNAL(triggered()), this, SLOT(doOpen()));
}
}
void MainWindow::styleActionTriggered()
{
//### remove setStyle()
// StyleAction* source = dynamic_cast<StyleAction*>(sender());
//
// if (source) {
// QString styleName = source->styleName();
//
// if (styleName.isNull()) {
// } else {
// StyleManager::setStyle(styleName);
// }
// }
}
void MainWindow::createMainArea()
{
QSplitter* mainSplitter = new QSplitter(this);
mainSplitter->setObjectName("mainSplitter");
// Left area:
QSplitter* leftSplitter = new QSplitter(mainSplitter);
leftSplitter->setObjectName("leftSplitter");
leftSplitter->setOrientation(Qt::Vertical);
{
QSizePolicy policy = leftSplitter->sizePolicy();
policy.setHorizontalStretch(0);
policy.setHorizontalPolicy(QSizePolicy::Preferred);
leftSplitter->setSizePolicy(policy);
}
leftSplitter->addWidget(m_navigatorController->widget());
QTabWidget *leftBottomTabWidget = new QTabWidget(this);
leftBottomTabWidget->addTab(m_itemLibraryController->widget(), "Library");
leftBottomTabWidget->addTab(m_propertiesViewController->widget(), tr("Properties"));
leftSplitter->addWidget(leftBottomTabWidget);
// right area:
QSplitter *rightSplitter = new QSplitter(mainSplitter);
rightSplitter->setObjectName("rightSplitter");
rightSplitter->setOrientation(Qt::Vertical);
rightSplitter->addWidget(m_statesEditorController->widget());
rightSplitter->addWidget(m_multipleDocumentsController->tabWidget());
{
QSizePolicy policy = m_multipleDocumentsController->tabWidget()->sizePolicy();
policy.setHorizontalStretch(1);
policy.setHorizontalPolicy(QSizePolicy::Expanding);
m_multipleDocumentsController->tabWidget()->setSizePolicy(policy);
}
// Finishing touches:
mainSplitter->setSizes(QList<int>() << 240 << 530);
rightSplitter->setSizes(QList<int>() << 100 << 400);
leftSplitter->setSizes(QList<int>() << 300 << 300);
// Wire everything together:
connect(m_multipleDocumentsController, SIGNAL(activeDocumentChanged(DesignDocumentController*)),
m_itemLibraryController, SLOT(show(DesignDocumentController*)));
connect(m_multipleDocumentsController, SIGNAL(documentClosed(DesignDocumentController*)),
m_itemLibraryController, SLOT(close(DesignDocumentController*)));
connect(m_multipleDocumentsController, SIGNAL(activeDocumentChanged(DesignDocumentController*)),
m_navigatorController, SLOT(show(DesignDocumentController*)));
connect(m_multipleDocumentsController, SIGNAL(documentClosed(DesignDocumentController*)),
m_navigatorController, SLOT(close(DesignDocumentController*)));
connect(m_multipleDocumentsController, SIGNAL(activeDocumentChanged(DesignDocumentController*)),
m_statesEditorController, SLOT(show(DesignDocumentController*)));
connect(m_multipleDocumentsController, SIGNAL(documentClosed(DesignDocumentController*)),
m_statesEditorController, SLOT(close(DesignDocumentController*)));
connect(m_multipleDocumentsController, SIGNAL(activeDocumentChanged(DesignDocumentController*)),
m_propertiesViewController, SLOT(show(DesignDocumentController*)));
connect(m_multipleDocumentsController, SIGNAL(documentClosed(DesignDocumentController*)),
m_propertiesViewController, SLOT(close(DesignDocumentController*)));
m_mainArea->addWidget(m_welcomeScreen);
m_mainArea->addWidget(mainSplitter);
setCentralWidget(m_mainArea);
}
void MainWindow::createStatusBar()
{
// statusBar();
}
void MainWindow::doNew()
{
// QWizard wizard;
// Internal::FormTemplateWizardPage page;
// wizard.addPage(&page);
// wizard.setWindowTitle("New Component Wizard");
// if (wizard.exec() != QDialog::Accepted)
// return;
QFile file(":/qmldesigner/templates/General/Empty Fx");
file.open(QFile::ReadOnly);
newFile(file.readAll());
// newFile(page.templateContents().toLatin1());
}
void MainWindow::doOpen()
{
if (QAction *senderAction = qobject_cast<QAction*>(sender())) {
if (senderAction->data().isValid()) {
// from recent files menu
QString path = senderAction->data().toString();
openFile(path);
return;
}
}
XUIFileDialog::runOpenFileDialog(m_lastPath, this, this, SLOT(openFile(QString)));
}
void MainWindow::openFile(const QString &fileName)
{
// qDebug() << "openFile("+fileName+")";
//
if (fileName.isNull())
return;
m_lastPath = QFileInfo(fileName).path();
QString errorMessage;
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) {
errorMessage = tr("Could not open file <%1>").arg(fileName);
} else {
DesignDocumentController* controller = new DesignDocumentController(m_multipleDocumentsController);
controller->setFileName(fileName);
QList<QmlDesigner::RewriterView::Error> errors = controller->loadMaster(file.readAll());
if (errors.isEmpty()) {
connect(controller, SIGNAL(fileToOpen(QString)), this, SLOT(openFile(QString)));
m_multipleDocumentsController->open(controller);
addRecentFile(QFileInfo(file).absoluteFilePath());
} else {
errorMessage = serializeErrors(errors);
delete controller;
}
}
if (!errorMessage.isEmpty()) {
QErrorMessage msgBox(this);
msgBox.showMessage(errorMessage);
msgBox.exec();
}
}
void MainWindow::newFile(const QString &templateName)
{
if (templateName.isNull())
return;
QFile file(templateName);
if (!file.open(QFile::ReadOnly))
return;
newFile(file.readAll());
}
void MainWindow::doAbout()
{
AboutDialog::go(this);
}
void MainWindow::documentCountChanged(unsigned newCount)
{
if (m_documentCount == newCount)
return;
m_documentCount = newCount;
if (!m_shutdown) {
updateActions();
updateMainArea();
}
}
void MainWindow::updateActions()
{
bool enable = m_documentCount != 0;
foreach (QAction *documentAction, m_documentActions)
documentAction->setEnabled(enable);
}
void MainWindow::updateMainArea()
{
if (m_multipleDocumentsController->activeDocumentCount() == 0) {
m_welcomeScreen->setRecentFiles(recentFiles());
m_mainArea->setCurrentIndex(0); // welcome screen
} else {
m_mainArea->setCurrentIndex(1);
}
}
void MainWindow::newFile(const QByteArray &templateContents)
{
DesignDocumentController *controller = new DesignDocumentController(m_multipleDocumentsController);
QList<QmlDesigner::RewriterView::Error> errors = controller->loadMaster(templateContents);
if (errors.isEmpty()) {
connect(controller, SIGNAL(fileToOpen(QString)), this, SLOT(openFile(QString)));
m_multipleDocumentsController->open(controller);
} else {
delete controller;
QErrorMessage msgBox(this);
msgBox.showMessage(serializeErrors(errors));
msgBox.exec();
}
}
QStringList MainWindow::recentFiles() const
{
const QSettings settings;
return settings.value("recentFiles", QStringList()).toStringList();
}
void MainWindow::addRecentFile(const QString &path)
{
QSettings settings;
QStringList files = settings.value("recentFiles", QStringList()).toStringList();
files.removeAll(path);
if (files.size() > 10)
files.removeLast();
files.prepend(path);
settings.setValue("recentFiles", files);
}
QString MainWindow::serializeErrors(const QList<QmlDesigner::RewriterView::Error> &errors)
{
if (errors.isEmpty())
return QString();
QString errorMsg = tr("Qml Errors:");
foreach (const QmlDesigner::RewriterView::Error &error, errors) {
if (!error.url().isEmpty())
errorMsg.append(tr("\n%1 %2:%3 - %4").arg(error.url().toString(), QString(error.line()), QString(error.column()), error.description()));
else
errorMsg.append(tr("\n%1:%2 - %3").arg(QString(error.line()), QString(error.column()), error.description()));
}
return errorMsg;
}

View File

@@ -1,124 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QtCore/QList>
#include <QtCore/QString>
#include <QtGui/QMainWindow>
#include <QtGui/QMenuBar>
#include <QtGui/QMenu>
#include <QtGui/QStackedWidget>
#include "rewriterview.h"
class QmlError;
class WelcomeScreen;
namespace QmlDesigner {
class ItemLibraryController;
class NavigatorController;
class StatesEditorController;
class AllPropertiesViewController;
class MultipleDocumentsController;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
MainWindow(QWidget* parent = 0);
~MainWindow();
int documentCount() const;
public slots:
void documentCountChanged(unsigned newCount);
void openFile(const QString &fileName);
void newFile(const QString &fileTemplate);
void doNew();
void doOpen();
void doQuit();
void doAbout();
protected:
void closeEvent(QCloseEvent *event);
private slots:
void showRecentFilesMenu();
void styleActionTriggered();
private:
void createMenus();
void createMainArea();
void createMainEditArea();
void createMainStyleArea();
void createStatusBar();
void updateActions();
void updateMainArea();
void newFile(const QByteArray &templateContents);
QStringList recentFiles() const;
void addRecentFile(const QString &path);
QString serializeErrors(const QList<QmlDesigner::RewriterView::Error> &errors);
private:
bool m_shutdown;
QString m_lastPath;
QList<QAction*> m_documentActions;
unsigned int m_documentCount;
QMenuBar* m_menuBar;
QmlDesigner::ItemLibraryController* m_itemLibraryController;
QmlDesigner::NavigatorController* m_navigatorController;
QmlDesigner::StatesEditorController* m_statesEditorController;
QmlDesigner::AllPropertiesViewController* m_propertiesViewController;
QmlDesigner::MultipleDocumentsController* m_multipleDocumentsController;
QAction* m_previewAction;
QAction* m_previewWithDebugAction;
QAction* m_showNewLookPropertiesAction;
QAction* m_showTraditionalPropertiesAction;
QMenu* m_recentFilesMenu;
QStackedWidget *m_mainArea;
WelcomeScreen *m_welcomeScreen;
};
#endif // MAINWINDOW_H

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -1,50 +0,0 @@
!contains(QT_CONFIG, declarative) {
error("Qt is not configured with the declarative model.");
}
TEMPLATE = app
CONFIG(debug, debug|release):CONFIG += console
TARGET = bauhaus
macx:TARGET = Bauhaus
CONFIG += qt
CONFIG += webkit
QT += gui opengl
HEADERS += \
aboutdialog.h \
mainwindow.h \
application.h \
welcomescreen.h
SOURCES += \
aboutdialog.cpp \
main.cpp \
mainwindow.cpp \
application.cpp \
welcomescreen.cpp
include(../../../libs/qmljs/qmljs-lib.pri)
HEADERS+=../../../libs/utils/changeset.h
SOURCES+=../../../libs/utils/changeset.cpp
INCLUDEPATH+=../../../libs
DEFINES+=QTCREATOR_UTILS_STATIC_LIB QML_BUILD_STATIC_LIB
include(../../../plugins/qmldesigner/config.pri)
include(../../../plugins/qmldesigner/components/integration/integration.pri)
include(../../../plugins/qmldesigner/components/propertyeditor/propertyeditor.pri)
include(../../../plugins/qmldesigner/components/formeditor/formeditor.pri)
include(../../../plugins/qmldesigner/components/navigator/navigator.pri)
include(../../../plugins/qmldesigner/components/stateseditor/stateseditor.pri)
include(../../../plugins/qmldesigner/components/itemlibrary/itemlibrary.pri)
include(../../../plugins/qmldesigner/components/resources/resources.pri)
include(../../../plugins/qmldesigner/components/pluginmanager/pluginmanager.pri)
include(../../../plugins/qmldesigner/components/themeloader/qts60stylethemeio.pri)
include (../../../plugins/qmldesigner/core/core.pri)
RESOURCES += bauhaus.qrc
win32:RC_FILE = bauhaus.rc
macx {
ICON = bauhaus-logo.icns
QMAKE_INFO_PLIST = Info.plist
}
QMAKE_CXXFLAGS_HIDESYMS=""

View File

@@ -1,7 +0,0 @@
import Qt 4.7
Item {
id: rootItem
width: 640
height: 480
}

View File

@@ -1,10 +0,0 @@
import Qt 4.7
QGraphicsView {
objectName: "view"
width: 300
height: 300
scene: QGraphicsScene {
objectName: "scene"
}
}

View File

@@ -1,9 +0,0 @@
import Qt 4.7
QWidget {
objectName: "Form"
x: 300
y: 200
width: 455
height: 376
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

@@ -1,154 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include "welcomescreen.h"
#include "application.h"
#include <QtGui/QBoxLayout>
#include <QtDeclarative/QmlView>
#include <QtDeclarative/QmlGraphicsItem>
#include <QtDeclarative/QmlContext>
#include <QtCore/QCoreApplication>
RecentFileModel::RecentFileModel(QObject *parent) :
QListModelInterface(parent)
{
}
void RecentFileModel::setRecentFiles(const QStringList &filePaths)
{
QStringList oldPaths = m_paths;
m_paths.clear();
if (oldPaths.size() > 0) {
emit itemsRemoved(0, oldPaths.size());
}
m_paths = filePaths;
if (m_paths.size() > 0) {
emit itemsInserted(0, m_paths.size());
}
}
int RecentFileModel::count() const
{
return m_paths.size();
}
QHash<int, QVariant> RecentFileModel::data(int index, const QList<int> &/*roles*/) const
{
QHash<int,QVariant> dataHash;
dataHash.insert(NameRole, displayPath(m_paths.at(index)));
dataHash.insert(FileNameRole, m_paths.at(index));
return dataHash;
}
QVariant RecentFileModel::data(int index, int role) const
{
if (role == NameRole)
return displayPath(m_paths.at(index));
if (role == FileNameRole)
return m_paths.at(index);
return QVariant();
}
QList<int> RecentFileModel::roles() const
{
return QList<int>() << NameRole << FileNameRole;
}
QString RecentFileModel::toString(int role) const
{
switch (role) {
case NameRole: return "name"; break;
case FileNameRole: return "fileName"; break;
default: Q_ASSERT_X(0, Q_FUNC_INFO, "Unknown role");
}
return QString();
}
QString RecentFileModel::displayPath(const QString &filePath) const
{
QString displayPath = filePath;
while (displayPath.length() > 25 && displayPath.contains('/')) {
displayPath.remove(0, displayPath.indexOf('/') + 1);
}
if (displayPath != filePath)
displayPath.prepend("../");
return displayPath;
}
WelcomeScreen::WelcomeScreen(QWidget *parent) :
QWidget(parent),
m_view(new QmlView(this)),
m_recentFileModel(new RecentFileModel(this))
{
m_view->setUrl(QUrl::fromLocalFile(Application::sharedDirPath() + "welcomescreen.qml"));
m_view->setContentResizable(true);
QmlContext *context = m_view->rootContext();
context->setContextProperty(QLatin1String("recentFiles"), m_recentFileModel);
m_view->execute();
QObject *rootItem = m_view->root();
connect(rootItem, SIGNAL(openFile()), this, SLOT(openFile()));
QBoxLayout *layout = new QBoxLayout(QBoxLayout::LeftToRight, this);
layout->setMargin(0);
layout->addWidget(m_view);
QPalette palette;
palette.setColor(QPalette::Window, QColor(0x2e, 0x2e, 0x2e));
setPalette(palette);
setBackgroundRole(QPalette::Window);
setAutoFillBackground(true);
}
void WelcomeScreen::setRecentFiles(const QStringList &files)
{
m_recentFileModel->setRecentFiles(files);
}
void WelcomeScreen::openFile()
{
QString filePath = m_view->root()->property("selectedFile").toString();
if (filePath.startsWith(':')) {
emit newFile(filePath);
} else {
emit openFile(filePath);
}
}

View File

@@ -1,81 +0,0 @@
/**************************************************************************
**
** This file is part of Qt Creator
**
** Copyright (c) 2011 Nokia Corporation and/or its subsidiary(-ies).
**
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** No Commercial Usage
**
** This file contains pre-release code and may not be distributed.
** You may use this file in accordance with the terms and conditions
** contained in the Technology Preview License Agreement accompanying
** this package.
**
** 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, Nokia gives you certain additional
** rights. These rights are described in the Nokia Qt LGPL Exception
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
**
**************************************************************************/
#include <QtCore/QMetaType>
#include <QtGui/QDialog>
#include <private/qlistmodelinterface_p.h>
class QmlView;
class RecentFileModel : public QListModelInterface {
Q_OBJECT
public:
enum Roles {
NameRole,
FileNameRole
};
RecentFileModel(QObject *parent = 0);
void setRecentFiles(const QStringList &filePaths);
int count() const;
QHash<int, QVariant> data(int index, const QList<int> &roles = QList<int>()) const;
QVariant data(int index, int role) const;
QList<int> roles() const;
QString toString(int role) const;
private:
QString displayPath(const QString &filePath) const;
QStringList m_paths;
};
class WelcomeScreen : public QWidget {
Q_OBJECT
public:
WelcomeScreen(QWidget *parent);
void setRecentFiles(const QStringList &recentFiles);
signals:
void appExit();
void openFile(const QString &filePath);
void newFile(const QString &templatePath);
private slots:
void openFile();
private:
QmlView *m_view;
RecentFileModel *m_recentFileModel;
};

View File

@@ -71,6 +71,7 @@ private Q_SLOTS:
void braceList();
void bug1();
void bug2();
void bug3();
void switch1();
void memberInitializer();
void templates();
@@ -669,6 +670,23 @@ void tst_CodeFormatter::bug2()
checkIndent(data);
}
void tst_CodeFormatter::bug3()
{
QList<Line> data;
data << Line("class AutoAttack")
<< Line("{")
<< Line("public:")
<< Line(" AutoAttack(unsigned delay, unsigned warmup)")
<< Line(" ~ : mWarmup(warmup && warmup < delay ? warmup : delay >> 2)")
<< Line(" {}")
<< Line(" unsigned getWarmup() const { return mWarmup; }")
<< Line("private:")
<< Line(" unsigned mWarmup;")
<< Line("}")
;
checkIndent(data);
}
void tst_CodeFormatter::braceList()
{
QList<Line> data;