Merge remote branch 'origin/2.2'

Conflicts:
	src/plugins/debugger/disassembleragent.cpp
This commit is contained in:
dt
2011-03-21 17:48:19 +01:00
168 changed files with 3038 additions and 1057 deletions

64
README
View File

@@ -182,8 +182,28 @@ we thank the authors who made this possible:
* Open Source front-end for C++ (license MIT), enhanced for use in Qt Creator
Roberto Raggi <roberto.raggi@gmail.com>
QtCreator/src/shared/cplusplus
Copyright 2005 Roberto Raggi <roberto@kdevelop.org>
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
KDEVELOP TEAM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* Botan, a C++ crypto library. Version 1.8.8
Copyright (C) 1999-2004 The Botan Project. All rights reserved.
@@ -227,6 +247,7 @@ we thank the authors who made this possible:
The source code of Botan C++ crypto library can be found in
QtCreator/src/libs/3rdparty
* NetSieben SSH Library is a Secure Shell client library for C++. Version 1.3.2
Commercial License: For organizations who do not want to release the source
@@ -247,3 +268,46 @@ we thank the authors who made this possible:
The source code of NetSieben Secure Shell C++ Library can be found in
QtCreator/src/libs/3rdparty.
* ClassView and ImageViewer plugins
Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
All rights reserved.
Copyright (c) 2010 Denis Mingulov.
Contact: Nokia Corporation (qt-info@nokia.com)
This file is part of Qt Creator.
You may use this file under the terms of the BSD license as follows:
"Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
the names of its contributors may be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."

46
dist/changes-2.2.0 vendored
View File

@@ -9,14 +9,20 @@ 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.
* 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
* GLSL Support with:
- syntax checking
- highlighting
- code completion
* Add 'expand/collapse all' context menu entry to Outline pane
* Support for user defined macros was contributed by Nicolas Arnaud-Cormos
Project Support
* QMake project support should be more robust against syntax errors
@@ -29,18 +35,19 @@ Project Support
- this affects working directories and executable paths as well
* CMake: Add Ui completion, changes in .ui files are picked up without
a rebuild.
* Syntax highlighting and completion for QMake project files
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.
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.
on throw", "break on main", data breakpoints
* Introduce combined c++/qml debugging (combined stack, cross-step) (gdb only)
* Rework per-type and per-item selection of display formats
* New dumpers for QTextCursor, QTextDocument, __m128, QScriptValue
@@ -64,6 +71,7 @@ Debugging
* Handle "live updates" in the memory view
* Make memory view writable (gdb only)
* Improve starting debugger session directly from the command line
* Improve debugging helpers dialog
BinEditor:
* Visualize data differences after updates
@@ -71,7 +79,6 @@ BinEditor:
* Allow copying also if selection is "backwards"
* Do not draw blinking cursor when there is a selection
Help
C++ Support
@@ -80,11 +87,11 @@ C++ Support
* Fix switch statement indentation for GNU and Whitesmiths
style, QTCREATORBUG-2994
* Fix indentation of labels
* Highlighting for virtual functions
* Navigate to correct overloaded function/method
* Snippets for class/struct/loops
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
@@ -106,9 +113,23 @@ QML/JS Support
* 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
* .qmlproject format: Allow specifying the 'mainFile' qml file, bump version to 1.1
* Qt Quick UI project: allow user to change run environment
QML/JS Debugging:
* Compile qmljsdebugger code as static library, and link it based on checkbox in qmake step
(replaces QMLJSDEBUGGER_PATH / QMLJSDEBUGGER define)
* Qt Quick Application: Allow debugging also in release builds, improve error diagnostics
* 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
* Added qml tooltips for property inspection at debug time
* Extended QML Observer for inspection and tweaking of item's properties
* Added navigation of the object tree in the QML Observer through a crumble path
* Add 'show app on top' option
* Move toolbar from Observer tab to the main toolbar space
* Support setting of breakpoints in .qml files embedded as qrc resources
* Improve 'linkification' of QML errors in Application Output pane
FakeVim:
* Implement Ctrl-N/Ctrl-P
@@ -132,6 +153,7 @@ Maemo Target
Designer
Version control plugins
* Bazaar support was contributed by Hugues Delorme
Wizards
* Support new keywords %MONTH% and %DAY% for C++ template file
@@ -141,10 +163,12 @@ 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.
"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
Ciaran McCreesh, adapted for Qt Creator by Jan Kundrát and
subsequently updated by Campbell Barton.
subsequently updated by Campbell Barton
* Hugues Delorme for the bazaar plugin which he continues to improve
* Nicolas Arnaud-Cormos for the Macro plugin

13
dist/known-issues vendored Normal file
View File

@@ -0,0 +1,13 @@
The Qt Creator Manual lists known issues in Qt Creator:
http://doc.qt.nokia.com/qtcreator-snapshot/creator-known-issues.html
For a complete list of reported issues, see the Qt Bug Tracker:
http://bugreports.qt.nokia.com/
For a list of fixed issues and added features, see the changelog file in the qtcreator\dist folder or the Qt Bug Tracker.

View File

@@ -1,9 +0,0 @@
Mac:
DYLD_IMAGE_SUFFIX does not work on Mac OS X Snow Leopard. So don't use the
corresponding setting in the Projects tab.
See: http://wimleers.com/blog/dyld-image-suffix-causing-havoc-on-mac-os-x-snow-leopard
A possible workaround is:
sudo mv /usr/lib/libSystem.B_debug.dylib /usr/lib/libSystem.B_debug.dylib.backup
sudo cp /usr/lib/libSystem.B.dylib /usr/lib/libSystem.B_debug.dylib.backup

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 114 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 142 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

After

Width:  |  Height:  |  Size: 76 KiB

View File

@@ -263,6 +263,8 @@
\o Mercurial
\o Bazaar
\endlist
The functions available to you in Qt Creator depend on the version control
@@ -610,6 +612,7 @@
You can use Qt Creator in the following modes:
\list
\o \gui Welcome mode for opening projects.
\o \gui{\l{Using the Editor}{Edit}} mode for editing project and source files.
\o \gui{\l{Developing Application UI}{Design}} mode for designing and developing
application user interfaces. This mode is available for UI files (.ui or
@@ -644,8 +647,7 @@
\o \gui {Class View} shows the class hierarchy of the currently
open projects.
\o \gui Outline shows the symbol hierachy of a C++ file and the element hierarchy of a QML file.
\o \gui {Type Hierarchy} shows the base classes of a class. For
more information, see \l{Viewing Type Hierarchy}.
\o \gui {Type Hierarchy} shows the base classes of a class.
\endlist
@@ -723,6 +725,11 @@
\endlist
\section2 Viewing Type Hierarchy
To view the base classes of a class, right-click the class and select
\gui {Open Type Hierarchy} or press \key {Ctrl+Shift+T}.
\section1 Viewing Output
The task pane in Qt Creator can display one of the following panes:
@@ -1779,11 +1786,6 @@
To switch between the definition and declaration of a symbol, press \key {Shift+F2}
or right-click the symbol and select \gui {Switch Between Method Declaration/Definition}.
\section1 Viewing Type Hierarchy
To view the base classes of a class, right-click the class and select
\gui {Open Type Hierarchy} or press \key {Ctrl+Shift+T}.
\section1 Using Update Code Model
To refresh the internal information in Qt Creator pertaining to your code,
@@ -1979,8 +1981,7 @@
\o Select \gui {Tools > External > Configure}.
\o Select
\inlineimage qtcreator-windows-add.png
\o Select \gui {Add > Add Tool}
to add a new tool. You can also select \gui {Add Category} to add a
new category.
@@ -2892,17 +2893,17 @@
\list
\o Qt Quick Projects
\o Qt Quick Project
Use QML to define the user interface and,
optionally, C++ or JavaScript to define the application logic
\o Qt Widget Projects
\o Qt Widget Project
Use \QD forms to define a Qt widget based
user interface and C++ to define the application logic
\o Other Projects
\o Other Project
\list
@@ -2920,6 +2921,12 @@
\endlist
\o Project from Version Control
Import a project from a supported version control system. For more
information on how version control systems are integrated in
Qt Creator, see \l{Using Version Control Systems}.
\endlist
To create a new project, select \gui File > \gui{New File or Project} and
@@ -3679,7 +3686,7 @@
\gui{Qt Versions}.
\o Qt Creator automatically sets the correct environment variables for
compilation. Select the internal version number of the installed
Microsoft Visual C++ tool chain in the \gui Toolchain list.
Microsoft Visual C++ tool chain in the \gui tool chain list.
\image qtcreator-qt4-qtversions-win-msvc.png
@@ -3704,12 +3711,12 @@
\image qtcreator-qt4-qtversions-win-symbian.png
\o To build an application for your device using GCCE, enter the path
to the CSL ARM toolchain directory in
to the CSL ARM tool chain directory in
\gui{CSL\\GCCE directory}.
You do not need to specify this path if the compiler is included in
the \c{PATH} environment variable.
\o To build an application for the emulator (WINSCW toolchain), enter
\o To build an application for the emulator (WINSCW tool chain), enter
the path to your Carbide C++ installation directory in
\gui{Carbide directory}.
@@ -3717,7 +3724,7 @@
\o To build an application using the Symbian build system (SBS v2) that
is available for Symbian OS 9.5 based SDKs, enter the path to the SBS
v2 toolchain directory in \gui{SBS v2 directory}.
v2 tool chain directory in \gui{SBS v2 directory}.
\endlist
\section2 Compiling Projects With Linux
@@ -3910,7 +3917,7 @@
\section1 Setting Up a Project
When you install the \QSDK, the build and run settings for the toolchains
When you install the \QSDK, the build and run settings for the tool chains
delivered with the \QSDK are set up automatically.
To view and modify the settings for currently open projects, switch to the
@@ -4091,7 +4098,7 @@
\endlist
Qt Creator uses the compiler specified in the MADDE toolchain to
Qt Creator uses the compiler specified in the MADDE tool chain to
build the application.
Qt Creator generates an installation package, installs it on the device,
@@ -6210,29 +6217,33 @@
Version control systems supported by Qt Creator are:
\table
\header
\i \bold{Version Control System}
\i \bold{Address}
\i \bold{Notes}
\i Version Control System
\i Address
\i Notes
\row
\i \bold{Git}
\i \l{http://git-scm.com/}
\i
\i Bazaar
\i \l{http://bazaar.canonical.com/}
\i Qt Creator 2.2 and later
\row
\i \bold{Subversion}
\i \l{http://subversion.tigris.org/}
\i
\row
\i \bold{Perforce}
\i \l{http://www.perforce.com}
\i Server version 2006.1 and later
\row
\i \bold{CVS}
\i CVS
\i \l{http://www.cvshome.org}
\i
\row
\i \bold{Mercurial}
\i Git
\i \l{http://git-scm.com/}
\i
\row
\i Mercurial
\i \l{http://mercurial.selenic.com/}
\i Qt Creator 2.0 and later
\row
\i Perforce
\i \l{http://www.perforce.com}
\i Server version 2006.1 and later
\row
\i Subversion
\i \l{http://subversion.apache.org/}
\i
\endtable
@@ -6297,22 +6308,36 @@
Reviewed-by:
Signed-off-by:
\endcode
\endlist
The fields above appear below the submit message. They provide completion
for the aliases/public user names specified in the
\e{User/alias configuration file} as well as a button that opens the
aforementioned user name dialog.
\o \gui{SSH prompt command} specifies an ssh-askpass command that you
can use (on Linux) to prompt the user for a password when using SSH.
For example, \c ssh-askpass or \c x11-ssh-askpass, depending on the
ssh-askpass implementation that you use.
\endlist
\section1 Creating VCS Repositories for New Projects
Qt Creator allows for creating VCS repositories for version
Qt Creator allows you to create repositories for version
control systems that support local repository creation, such as
Git or Mercurial.
Git, Mercurial, or Bazaar.
When creating a new project by selecting \gui File >
\gui{New File or Project...}, you can choose a version
control system in the final wizard page.
You can also select \gui Tools and then select \gui {Create Repository...}
in the submenu for the version control system.
To import a project that is under version control, choose \gui {File >
New File or Project... > Project from Version Control} and select the
version control system that you use. Follow the instructions of the
wizard to import the project.
\section1 Using Version Control Systems
The \gui{Tools} menu contains a submenu for each supported version
@@ -6355,8 +6380,7 @@
\section2 Viewing Versioning History and Change Details
Display the versioning history of a file by selecting \gui{Log}
(for Git and Mercurial) or \gui{Filelog} (for CVS, Perforce, and
Subversion). Typically, the log output contains the date, the commit
or \gui{Filelog}. Typically, the log output contains the date, the commit
message, and a change or revision identifier. Click on the identifier to
display a description of the change including the diff.
Right-clicking on an identifier brings up a context menu that lets you
@@ -6426,6 +6450,68 @@
\endlist
\section2 Viewing Status
You can select \gui{Status...} to view the status of the project or
repository.
\section2 Updating the Working Tree
You can select \gui Update to update your working tree with the latest
changes from the branch. Some version control systems allow you to choose
between updating the current project and updating all projects.
With Git, you stash your changes and then pull the changes from the
repository.
\section2 Deleting Files
You can select \gui Delete to delete obsolete files from the repository.
With Git, you delete the files from the working tree and then stage the
deleted files for a commit.
\section2 Using Additional Bazaar Functions
Bazaar is a free version control system sponsored by Canonical.
The \gui Bazaar submenu contains the following additional items:
\table
\header
\o Menu Item
\o Description
\row
\i \gui{Pull...}
\i Turn the branch into a mirror of another branch.
\row
\i \gui{Push...}
\i Update a mirror of the branch.
\endtable
\section2 Using Additional CVS Functions
CVS is an open source version control system.
The \gui CVS submenu contains the following additional items:
\table
\header
\o Menu Item
\o Description
\row
\i \gui{Edit}
\i Open a file for editing.
\row
\i \gui{Push...}
\i Push changes to the remote repository.
\row
\i \gui{Unedit}
\i Discard the changes that you made in a file.
\endtable
\section2 Using Additional Git Functions
Git is a fast decentralized version control system. Git is available
@@ -6434,7 +6520,9 @@
The \gui Git submenu contains the following additional items:
\table
\header
\o Menu Item
\o Description
\row
\i \gui {Patch > Apply from Editor/Apply from File...}
\i Patches are rewriting instructions that can be applied to a set of files.
@@ -6453,6 +6541,9 @@
of patches and project files) are displayed in the \gui {Clean Repository}
dialog. Select the files to delete and click \gui Delete. This allows you to
clean a build completely.
\row
\i \gui{Launch gitk}
\i Start the commit viewer for Git, gitk.
\row
\i \gui{Branches...}
@@ -6472,6 +6563,10 @@
\i \gui{Show Commit...}
\i Select a commit to view. Enter the SHA of the commit
in the \gui Change field.
\row
\i \gui{Amend Last Commit...}
\i Revert the last commit.
\endtable
\section3 Using Stashes
@@ -6483,6 +6578,9 @@
Qt Creator exposes this functionality in the \gui{Tools > Git > Stash} menu.
\table
\header
\o Menu Item
\o Description
\row
\i \gui{Stashes...}
\i Display a dialog that shows all known stashes with options to restore,
@@ -6506,9 +6604,14 @@
\section2 Using Additional Mercurial Functionality
Mercurial is a free, distributed source control management tool.
The \gui Mercurial submenu contains the following additional items:
\table
\header
\o Menu Item
\o Description
\row
\i \gui{Import}
\i Apply changes from a patch file.
@@ -6524,12 +6627,15 @@
\i \gui{Pull}
\i Pull changes from the remote repository.
\row
\i \gui{Update}
\i Look at an earlier version of the code.
\endtable
\i \gui{Push}
\i Push changes to the remote repository.
\endtable
\section2 Using Additional Perforce Functions
Perforce is a fast software configuration management system developed by
Perforce Software.
When you start Qt Creator, it looks for the executable specified
in the \gui{P4 command} field in \gui{Tools > Options... > Version
Control > Perforce}. If the file is not found, the following error
@@ -6547,6 +6653,9 @@
The \gui Perforce submenu contains the following additional items:
\table
\header
\o Menu Item
\o Description
\row
\i \gui{Describe...}
\i View information about changelists and the files in them.
@@ -6559,28 +6668,23 @@
\row
\i \gui{Pending Changes...}
\i Group files for commit.
\row
\i \gui{Update All/Update Current Project}
\i Fetch the current version of the current project or all
projects from the repository.
\endtable
\section2 Using Additional Subversion Functions
Subversion is an open source version control system.
The \gui Subversion submenu contains the following additional items:
\table
\header
\o Menu Item
\o Description
\row
\i \gui{Describe...}
\i Display commit log messages for a revision.
\row
\i \gui{Update Project/Update Repository}
\i Update your working copy.
\endtable
*/
@@ -7285,7 +7389,7 @@
\o Retrieves the contents of local variables.
\o Examines \gui Watchers.
\o Updates the \gui Registers, \gui Modules, and \gui Disassembler
views if you are debugging the C++ language.
views if you are debugging the C++ based applications.
\endlist
You can use the \gui Debug mode views to examine the data in more detail.
@@ -7294,10 +7398,12 @@
\list
\o To finish debugging, press \key{Shift+F5}.
\o To finish debugging, press \key{Shift+F5}.
\o To execute a line of code as a whole, press \key{F10}.
\o To step into a function or a subfunction, press \key{F11}.
\o To continue running the program, press \key{F5}.
\o To run to the selected function when you are stepping into a nested
function, press \key{Ctrl+F6}.
\endlist
@@ -7318,21 +7424,35 @@
\image qtcreator-debug-breakpoints.png "Breakpoints view"
Typically, breakpoints are associated with a source code file and line, or
the start of a function -- both are allowed in Qt Creator.
You can associate breakpoints with:
\list
\o Source code files and lines
\o Functions
\o Addresses
\o Throwing and catching exceptions
\o Some system calls, such as \c fork(), \c vfork(), and \c exec()
\endlist
You can also set watchpoints to monitor the changes in a block of memory
at a particular address when a program is running.
The interruption of a program by a breakpoint can be restricted with
certain conditions.
To set a breakpoint:
To set a breakpoint at a particular line you want the program to stop,
click the left margin or press \key F9 (\key F8 for Mac OS X).
\list
\o At a particular line you want the program to stop, click the
left margin or press \key F9 (\key F8 for Mac OS X).
\o At a function that you want the program to interrupt, enter the
function's name in \gui{Set Breakpoint at Function...} located in the
context menu of the \gui{Breakpoints} view.
\endlist
To set breakpoints and watchpoints select \gui {Add Breakpoint...} in
the context menu in the \gui Breakpoints view.
\image qtcreator-add-breakpoint.png "Add Breakpoints" dialog
\note You can remove a breakpoint:
\list
@@ -7347,6 +7467,28 @@
while it is running under the debugger's control. Breakpoints are saved
together with a session.
\section2 Setting Watchpoints
To set a watchpoint at an address:
\list 1
\o Right-click in the \gui Breakpoints view to open the context menu,
and select \gui {Add Breakpoint...}.
\o In the \gui {Breakpoint type} field, select \gui {Address
(Watchpoint)}.
\o In the \gui Address field, specify the address of the memory block.
\o Select \gui OK.
\endlist
If the address is displayed in the \gui {Locals and Watchers} view, you can
select \gui {Add Watchpoint at Object's Address} in the context menu to set
the watchpoint.
\section1 Viewing Call Stack Trace
When the program being debugged is interrupted, Qt Creator displays the
@@ -7436,7 +7578,22 @@
\note The set of watched items is saved in your session.
\section1 Debugging the C++ Language
\section1 Directly Interacting with Native Debuggers
In some cases, it is convenient to directly interact with the command
line of the native debugger. In Qt Creator, you can use the left
pane of the \gui {Debugger Log} view for that purpose. When you press
\key {Ctrl+Return}, the contents of the line under the text cursor
are sent directly to the native debugger. Alternatively, you
can use the line edit at the bottom of the view. Output is displayed in the
right pane of the \gui {Debugger Log} view.
\note Usually, you do not need this feature, because Qt Creator provides
you with better ways to handle the task. For example, instead of using the
gdb \c print command from the command line, you can create a watcher item
in the \gui{Locals and Watchers} view and examine the expression there.
\section1 Debugging C++ Based Applications
The following sections describe additional debugging functions that apply
only to debugging C++.
@@ -7996,7 +8153,7 @@
workspaces that you can use in the compiler environment of your choice.
Since Qt Creator 1.1, CMake configuration files are supported.
Qt Creator 1.3 supports the Microsoft Toolchain if the CMake version
Qt Creator 1.3 supports the Microsoft tool chain if the CMake version
is at least 2.8.
\section1 Setting the Path for CMake
@@ -10238,6 +10395,9 @@
\row
\o Toggle breakpoint
\o F9
\row
\o Run to selected function
\o Ctrl+F6
\endtable
@@ -10562,6 +10722,18 @@
paths may fail. For example, remounting parts of a file system
using the --bind mount option.
\o You must use a workaround to use the DYLD_IMAGE_SUFFIX option in the
\gui Projects tab on Mac OS X Snow Leopard. For more information on
the issue, see
\l{http://wimleers.com/blog/dyld-image-suffix-causing-havoc-on-mac-os-x-snow-leopard}{DYLD_IMAGE_SUFFIX causing havoc on Mac OS X Snow Leopard}.
To use the option, enter the following commands in the Terminal
application:
\code
sudo mv /usr/lib/libSystem.B_debug.dylib /usr/lib/libSystem.B_debug.dylib.backup
sudo cp /usr/lib/libSystem.B.dylib /usr/lib/libSystem.B_debug.dylib.backup
\endcode
\endlist
\section1 Qt Quick Designer Issues

View File

@@ -53,7 +53,7 @@ ToolBarColorBox::ToolBarColorBox(QWidget *parent) :
QLabel(parent)
{
m_copyHexColor = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-hicontrast.png")),
tr("Copy"), this);
tr("Copy Color"), this);
connect(m_copyHexColor, SIGNAL(triggered()), SLOT(copyColorToClipboard()));
setScaledContents(false);
}
@@ -116,12 +116,6 @@ void ToolBarColorBox::contextMenuEvent(QContextMenuEvent *ev)
contextMenu.exec(ev->globalPos());
}
void ToolBarColorBox::mouseDoubleClickEvent(QMouseEvent *)
{
QColorDialog dialog(m_color);
dialog.show();
}
void ToolBarColorBox::copyColorToClipboard()
{
QClipboard *clipboard = QApplication::clipboard();

View File

@@ -52,7 +52,6 @@ public:
protected:
void contextMenuEvent(QContextMenuEvent *ev);
void mouseDoubleClickEvent(QMouseEvent *);
void mousePressEvent(QMouseEvent *ev);
void mouseMoveEvent(QMouseEvent *ev);
private slots:

View File

@@ -541,17 +541,15 @@ bool QDeclarativeViewObserver::showAppOnTop() const
void QDeclarativeViewObserver::setShowAppOnTop(bool appOnTop)
{
if (data->view) {
QWidget *rootWidget = data->view;
while (rootWidget->parentWidget())
rootWidget = rootWidget->parentWidget();
Qt::WindowFlags flags = rootWidget->windowFlags();
QWidget *window = data->view->window();
Qt::WindowFlags flags = window->windowFlags();
if (appOnTop)
flags |= Qt::WindowStaysOnTopHint;
else
flags &= ~Qt::WindowStaysOnTopHint;
rootWidget->setWindowFlags(flags);
rootWidget->show();
window->setWindowFlags(flags);
window->show();
}
data->showAppOnTop = appOnTop;

View File

@@ -4,6 +4,10 @@ folder_01.source = html
DEPLOYMENTFOLDERS = folder_01
# DEPLOYMENTFOLDERS_END #
# Define TOUCH_OPTIMIZED_NAVIGATION for touch optimization and flicking
# TOUCH_OPTIMIZED_NAVIGATION #
DEFINES += TOUCH_OPTIMIZED_NAVIGATION
# TARGETUID3 #
symbian:TARGET.UID3 = 0xE1111234

View File

@@ -3,7 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
body { margin: 0; font-size: 2em; }
body { margin: 0; font-size: 2em; background-color: white; }
h1 { text-align: center; color: red; }
h1 + h1 { color: green; }
h1:last-child { color: blue; }

View File

@@ -18,6 +18,890 @@
#include <QtWebKit/QGraphicsWebView>
#include <QtWebKit/QWebFrame>
#ifdef TOUCH_OPTIMIZED_NAVIGATION
#include <QtCore/QTimer>
#include <QtGui/QGraphicsSceneMouseEvent>
#include <QtWebKit/QWebElement>
const int KCumlativeDistanceThreshold = 40;
const int KDecelerationCount = 4;
const int KDecelerationTimerSpeed = 10;
const int KFlickScrollThreshold = 400;
const int KJitterBufferThreshold = 200;
const qreal KDecelerationSlowdownFactor = 0.975;
const int KTouchDownStartTime = 200;
const int KHoverTimeoutThreshold = 100;
const int KNodeSearchThreshold = 400;
class WebTouchPhysicsInterface : public QObject
{
Q_OBJECT
public:
WebTouchPhysicsInterface(QObject *parent = 0);
virtual ~WebTouchPhysicsInterface();
static WebTouchPhysicsInterface* getSingleton();
virtual bool inMotion() = 0;
virtual void stop() = 0;
virtual void start(const QPointF &pressPoint, const QWebFrame *frame) = 0;
virtual bool move(const QPointF &pressPoint) = 0;
virtual bool release(const QPointF &pressPoint) = 0;
signals:
void positionChanged(const QPointF &point, const QPoint &startPressPoint);
public slots:
virtual void setRange(const QRectF &range) = 0;
private:
static WebTouchPhysicsInterface* s_instance;
};
WebTouchPhysicsInterface* WebTouchPhysicsInterface::s_instance = 0;
WebTouchPhysicsInterface::WebTouchPhysicsInterface(QObject *parent)
: QObject(parent)
{
}
WebTouchPhysicsInterface::~WebTouchPhysicsInterface()
{
if (s_instance == this)
s_instance = 0;
}
class WebTouchPhysics : public WebTouchPhysicsInterface
{
Q_OBJECT
public:
WebTouchPhysics(QObject *parent = 0);
virtual ~WebTouchPhysics();
virtual bool inMotion();
virtual void stop();
virtual void start(const QPointF &pressPoint, const QWebFrame *frame);
virtual bool move(const QPointF &pressPoint);
virtual bool release(const QPointF &pressPoint);
signals:
void setRange(const QRectF &range);
public slots:
void decelerationTimerFired();
void changePosition(const QPointF &point);
bool isFlick(const QPointF &point, int distance) const;
bool isPan(const QPointF &point, int distance) const;
private:
QPointF m_previousPoint;
QPoint m_startPressPoint;
QPointF m_decelerationSpeed;
QList<QPointF> m_decelerationPoints;
QTimer m_decelerationTimer;
QPointF m_cumlativeDistance;
const QWebFrame* m_frame;
bool m_inMotion;
};
WebTouchPhysicsInterface* WebTouchPhysicsInterface::getSingleton()
{
if (!s_instance)
s_instance = new WebTouchPhysics;
return s_instance;
}
int fastDistance(const QPoint &p, const QPoint &q)
{
return (p.x() - q.x()) * (p.x() - q.x()) + (p.y() - q.y()) * (p.y() - q.y());
}
WebTouchPhysics::WebTouchPhysics(QObject *parent)
: WebTouchPhysicsInterface(parent)
, m_frame(0)
, m_inMotion(false)
{
connect(&m_decelerationTimer, SIGNAL(timeout()), this, SLOT(decelerationTimerFired()));
}
WebTouchPhysics::~WebTouchPhysics()
{
}
bool WebTouchPhysics::inMotion()
{
return m_inMotion;
}
void WebTouchPhysics::stop()
{
m_decelerationTimer.stop();
m_cumlativeDistance = QPoint();
m_previousPoint = QPoint();
m_startPressPoint = QPoint();
m_decelerationPoints.clear();
m_inMotion = false;
}
void WebTouchPhysics::start(const QPointF &pressPoint, const QWebFrame *frame)
{
if (!frame)
return;
m_frame = frame;
m_decelerationPoints.push_front(pressPoint);
m_decelerationTimer.setSingleShot(false);
m_decelerationTimer.setInterval(KDecelerationTimerSpeed);
m_previousPoint = pressPoint;
m_startPressPoint = pressPoint.toPoint();
}
bool WebTouchPhysics::move(const QPointF &pressPoint)
{
int distance = fastDistance(pressPoint.toPoint(), m_startPressPoint);
if (isFlick(pressPoint, distance) || isPan(pressPoint, distance)) {
changePosition(pressPoint);
return true;
}
return false;
}
bool WebTouchPhysics::release(const QPointF &pressPoint)
{
// use the cumulative distance in this case because it seems like a positive user experience
if (m_cumlativeDistance.manhattanLength() > KCumlativeDistanceThreshold) {
m_decelerationSpeed = (m_decelerationPoints.back() - pressPoint) / (m_decelerationPoints.count() + 1);
m_decelerationTimer.start();
return true;
} else {
m_inMotion = false;
return false;
}
}
void WebTouchPhysics::changePosition(const QPointF &point)
{
m_inMotion = true;
QPointF diff = m_previousPoint - point;
emit positionChanged(diff, m_startPressPoint);
m_cumlativeDistance += (point - m_previousPoint);
m_previousPoint = point;
m_decelerationPoints.push_front(point);
if (m_decelerationPoints.count() > KDecelerationCount)
m_decelerationPoints.pop_back();
}
void WebTouchPhysics::decelerationTimerFired()
{
if (!m_frame) {
m_decelerationTimer.stop();
return;
}
if (qAbs(m_decelerationSpeed.x()) < KDecelerationSlowdownFactor
&& qAbs(m_decelerationSpeed.y()) < KDecelerationSlowdownFactor) {
m_inMotion = false;
m_decelerationTimer.stop();
return;
}
m_decelerationSpeed *= KDecelerationSlowdownFactor;
emit positionChanged(QPoint(m_decelerationSpeed.x(), m_decelerationSpeed.y()), m_startPressPoint);
}
bool WebTouchPhysics::isFlick(const QPointF &pressPoint, int distance) const
{
Q_UNUSED(pressPoint)
// this mouse move event is far away from the touch down position in
// less than xx sec, the user must want to scroll quickly.
return !m_inMotion && distance > KFlickScrollThreshold;
}
bool WebTouchPhysics::isPan(const QPointF &pressPoint, int distance) const
{
Q_UNUSED(pressPoint)
return distance > KJitterBufferThreshold;
}
class WebTouchEvent
{
public:
QPoint m_pos;
QEvent::Type m_type;
Qt::MouseButton m_button;
Qt::MouseButtons m_buttons;
bool m_graphicsSceneEvent;
bool m_fired;
bool m_editable;
Qt::KeyboardModifiers m_modifier;
//Graphics scene event members
QPointF m_scenePos;
QPoint m_screenPos;
QPointF m_buttonDownPos;
QPointF m_buttonDownScenePos;
QPoint m_buttonDownScreenPos;
QPointF m_lastPos;
QPointF m_lastScenePos;
QPoint m_lastScreenPos;
WebTouchEvent()
: m_type(QEvent::None)
, m_button(Qt::NoButton)
, m_buttons(Qt::NoButton)
, m_graphicsSceneEvent(false)
, m_fired(false)
, m_editable(false)
, m_modifier(Qt::NoModifier)
{}
WebTouchEvent(const QMouseEvent *mouseEvent)
{
Q_ASSERT(mouseEvent != 0);
m_type = mouseEvent->type();
m_pos = mouseEvent->pos();
m_button = mouseEvent->button();
m_buttons = mouseEvent->buttons();
m_modifier = mouseEvent->modifiers();
m_fired = false;
m_editable = false;
m_graphicsSceneEvent = false;
}
WebTouchEvent(const QGraphicsSceneMouseEvent *graphicsSceneMouseEvent)
{
Q_ASSERT(graphicsSceneMouseEvent != 0);
m_type = graphicsSceneMouseEvent->type();
m_pos = graphicsSceneMouseEvent->pos().toPoint();
m_button = graphicsSceneMouseEvent->button();
m_buttons = graphicsSceneMouseEvent->buttons();
m_modifier = graphicsSceneMouseEvent->modifiers();
m_scenePos = graphicsSceneMouseEvent->scenePos();
m_screenPos = graphicsSceneMouseEvent->screenPos();
m_buttonDownPos = graphicsSceneMouseEvent->buttonDownPos(graphicsSceneMouseEvent->button());
m_buttonDownScenePos = graphicsSceneMouseEvent->buttonDownScenePos(graphicsSceneMouseEvent->button());
m_buttonDownScreenPos = graphicsSceneMouseEvent->buttonDownScreenPos(graphicsSceneMouseEvent->button());
m_lastPos = graphicsSceneMouseEvent->lastPos();
m_lastScenePos = graphicsSceneMouseEvent->lastScenePos();
m_lastScreenPos = graphicsSceneMouseEvent->lastScreenPos();
m_fired = false;
m_editable = false;
m_graphicsSceneEvent = true;
}
};
class WebTouchScroller : public QObject
{
Q_OBJECT
public:
WebTouchScroller(QObject *parent = 0);
virtual ~WebTouchScroller();
signals:
void rangeChanged(const QRectF &range);
public slots:
void setFrame(QWebFrame* frame);
void scroll(const QPointF &delta, const QPoint &scrollStartPoint);
private:
QWebFrame* m_webFrame;
QSize m_range;
};
void qtwebkit_webframe_scrollRecursively(QWebFrame* qFrame, int dx, int dy, const QPoint &pos)
{
Q_UNUSED(pos)
if (!qFrame)
return;
bool scrollHorizontal = false;
bool scrollVertical = false;
do {
if (qFrame->scrollBarPolicy(Qt::Horizontal) == Qt::ScrollBarAlwaysOn) {
if (dx > 0) // scroll right
scrollHorizontal = qFrame->scrollBarValue(Qt::Horizontal) < qFrame->scrollBarMaximum(Qt::Horizontal);
else if (dx < 0) // scroll left
scrollHorizontal = qFrame->scrollBarValue(Qt::Horizontal) > qFrame->scrollBarMinimum(Qt::Horizontal);
} else {
scrollHorizontal = true;
}
if (qFrame->scrollBarPolicy(Qt::Vertical) == Qt::ScrollBarAlwaysOn) {
if (dy > 0) // scroll down
scrollVertical = qFrame->scrollBarValue(Qt::Vertical) < qFrame->scrollBarMaximum(Qt::Vertical);
else if (dy < 0) //scroll up
scrollVertical = qFrame->scrollBarValue(Qt::Vertical) > qFrame->scrollBarMinimum(Qt::Vertical);
} else {
scrollVertical = true;
}
if (scrollHorizontal || scrollVertical) {
qFrame->scroll(dx, dy);
return;
}
qFrame = qFrame->parentFrame();
} while (qFrame);
}
WebTouchScroller::WebTouchScroller(QObject *parent)
: QObject(parent)
, m_webFrame(0)
{
}
WebTouchScroller::~WebTouchScroller()
{
}
void WebTouchScroller::setFrame(QWebFrame* frame)
{
m_webFrame = frame;
}
void WebTouchScroller::scroll(const QPointF &delta, const QPoint &scrollStartPoint)
{
if (!m_webFrame)
return;
qtwebkit_webframe_scrollRecursively(m_webFrame, delta.x(), delta.y(),
scrollStartPoint - m_webFrame->scrollPosition());
}
class WebTouchNavigation : public QObject
{
Q_OBJECT
public:
WebTouchNavigation(QObject *object, QWebPage *webPage);
virtual ~WebTouchNavigation();
protected:
bool eventFilter(QObject *object, QEvent *event);
void handleDownEvent(const WebTouchEvent &event);
void handleMoveEvent(const WebTouchEvent &event);
void handleReleaseEvent(const WebTouchEvent &event);
public slots:
void hoverTimerFired();
void downTimerFired();
void quickDownTimerFired();
void quickUpTimerFired();
private:
void invalidateLastTouchDown();
void generateMouseEvent(const WebTouchEvent &touchEvent);
private:
WebTouchPhysicsInterface* m_physics;
WebTouchScroller* m_scroller;
WebTouchEvent m_touchDown;
QObject* m_viewObject;
QWebPage* m_webPage;
QWebFrame* m_webFrame;
QTimer m_downTimer;
QTimer m_hoverTimer;
QTimer m_quickDownTimer;
QTimer m_quickUpTimer;
bool m_suppressMouseEvents;
};
int xInRect(const QRect &r, int x)
{
int x1 = qMin(x, r.right()-2);
return qMax(x1, r.left()+2);
}
int yInRect(const QRect &r, int y)
{
int y1 = qMin(y, r.bottom()-2);
return qMax(y1, r.top()+2);
}
int wtnFastDistance(const QPoint &p, const QPoint &q)
{
return (p.x() - q.x()) * (p.x() - q.x()) + (p.y() - q.y()) * (p.y() - q.y());
}
QPoint frameViewPosition(QWebFrame *frame)
{
QPoint fp;
QWebFrame* f = frame;
while (1) {
fp += f->pos();
f = f->parentFrame();
if (f) {
fp -= f->scrollPosition();
} else
break;
}
return fp;
}
QPoint closestElement(QObject *viewObject, QWebFrame *frame, WebTouchEvent &touchEvent, int searchThreshold)
{
Q_UNUSED(viewObject)
QPoint adjustedPoint(touchEvent.m_pos);
QWebHitTestResult htr = frame->hitTestContent(adjustedPoint);
if (htr.isContentEditable()) {
QString type = htr.element().attribute("type").toLower();
// Don't summon the vkb for a hidden input element.
// This should never happen anyway.
if (type == "hidden") {
touchEvent.m_editable = false;
return adjustedPoint;
}
// Don't summon the vkb for a disabled input; in fact, close the vkbd.
QString disabled = htr.element().attribute("disabled").toLower();
if (disabled == "disabled" || disabled == "true") {
touchEvent.m_editable = false;
return adjustedPoint;
}
// QtWebKit EditorClientQt already enables these input hints. Thus, this should only be
// enabled if QtWebKit happens to be old. Qt::ImhNoPredictiveText is only enalbed for Symbian / Maemo on WebKit side.
touchEvent.m_editable = true;
return adjustedPoint;
}
if (!htr.element().tagName().toLower().compare("select") && htr.element().hasAttribute("multiple")) {
touchEvent.m_modifier = Qt::ControlModifier;
return adjustedPoint;
}
// If clicked element need receive event, do NOT adjust
// like : achor, input, map, button, textarea
QString tagName = htr.element().tagName().toLower();
if (!htr.linkElement().isNull() ||
!tagName.compare("input") ||
!tagName.compare("map") ||
!tagName.compare("button") ||
!tagName.compare("textarea") ||
htr.element().hasAttribute("onClick"))
return adjustedPoint;
// Attempt to find the closest radio button or checkbox. Their areas can be so
// small that we need to adjust the our position to be exactly on them if in the vicinity.
QString selector = "input[type=\"radio\"], input[type=\"checkbox\"]";
QWebElementCollection elementList = frame->findAllElements(selector);
QWebElementCollection::iterator it(elementList.begin());
// find the origin of current frame position in view based coordinate
QPoint originPoint = frameViewPosition(frame);
// transfer the event position from view based coordinate to the current frame's content based coordinate
QPoint frameScrollPoint = frame->scrollPosition();
QPoint framePoint = adjustedPoint - originPoint + frameScrollPoint;
QPoint adjustedFramePoint = framePoint;
// find the closest element
int maxDist = searchThreshold;
while (it != elementList.end()) {
QRect nRect((*it).geometry());
if (nRect.isValid()) {
QPoint pt(xInRect(nRect, framePoint.x()), yInRect(nRect, framePoint.y()));
int dist = wtnFastDistance(pt, framePoint);
if (dist < maxDist) {
adjustedFramePoint = pt;
maxDist = dist;
}
}
++it;
}
// transfer the adjusted position from the current frame's content based coordinate to view based coordinate
adjustedPoint = adjustedFramePoint - frameScrollPoint + originPoint;
return adjustedPoint;
}
WebTouchNavigation::WebTouchNavigation(QObject *parent, QWebPage *webPage)
: m_viewObject(parent)
, m_webPage(webPage)
, m_suppressMouseEvents(false)
{
Q_ASSERT(m_webPage);
connect(&m_downTimer, SIGNAL(timeout()), this, SLOT(downTimerFired()));
connect(&m_hoverTimer, SIGNAL(timeout()), this, SLOT(hoverTimerFired()));
connect(&m_quickDownTimer, SIGNAL(timeout()), this, SLOT(quickDownTimerFired()));
connect(&m_quickUpTimer, SIGNAL(timeout()), this, SLOT(quickUpTimerFired()));
m_physics = WebTouchPhysicsInterface::getSingleton();
m_physics->setParent(this);
m_scroller = new WebTouchScroller(this);
connect(m_physics, SIGNAL(positionChanged(QPointF, QPoint)), m_scroller, SLOT(scroll(QPointF, QPoint)));
connect(m_scroller, SIGNAL(rangeChanged(QRectF)), m_physics, SLOT(setRange(QRectF)));
}
WebTouchNavigation::~WebTouchNavigation()
{
}
bool WebTouchNavigation::eventFilter(QObject *object, QEvent *event)
{
if (object != m_viewObject)
return false;
bool eventHandled = false;
switch (event->type()) {
case QEvent::MouseButtonPress:
if (static_cast<QMouseEvent*>(event)->buttons() & Qt::LeftButton) {
WebTouchEvent e(static_cast<QMouseEvent*>(event));
handleDownEvent(e);
}
eventHandled = true;
break;
case QEvent::MouseMove:
if (static_cast<QMouseEvent*>(event)->buttons() & Qt::LeftButton) {
WebTouchEvent e(static_cast<QMouseEvent*>(event));
handleMoveEvent(e);
}
eventHandled = true;
break;
case QEvent::MouseButtonRelease:
{
WebTouchEvent e(static_cast<QMouseEvent*>(event));
handleReleaseEvent(e);
eventHandled = true;
}
break;
case QEvent::GraphicsSceneMousePress:
if (static_cast<QGraphicsSceneMouseEvent*>(event)->buttons() & Qt::LeftButton) {
WebTouchEvent e(static_cast<QGraphicsSceneMouseEvent*>(event));
handleDownEvent(e);
}
eventHandled = true;
break;
case QEvent::GraphicsSceneMouseMove:
if (static_cast<QGraphicsSceneMouseEvent *>(event)->buttons() & Qt::LeftButton) {
WebTouchEvent e(static_cast<QGraphicsSceneMouseEvent*>(event));
handleMoveEvent(e);
}
eventHandled = true;
break;
case QEvent::GraphicsSceneMouseRelease:
{
WebTouchEvent e(static_cast<QGraphicsSceneMouseEvent*>(event));
handleReleaseEvent(e);
eventHandled = true;
}
break;
case QEvent::MouseButtonDblClick:
case QEvent::ContextMenu:
case QEvent::CursorChange:
case QEvent::DragEnter:
case QEvent::DragLeave:
case QEvent::DragMove:
case QEvent::Drop:
case QEvent::GrabMouse:
case QEvent::GraphicsSceneContextMenu:
case QEvent::GraphicsSceneDragEnter:
case QEvent::GraphicsSceneDragLeave:
case QEvent::GraphicsSceneDragMove:
case QEvent::GraphicsSceneDrop:
case QEvent::GraphicsSceneHelp:
case QEvent::GraphicsSceneHoverEnter:
case QEvent::GraphicsSceneHoverLeave:
case QEvent::GraphicsSceneHoverMove:
case QEvent::HoverEnter:
case QEvent::HoverLeave:
case QEvent::HoverMove:
case QEvent::Gesture:
case QEvent::GestureOverride:
eventHandled = true;
break;
default:
break;
}
return eventHandled;
}
void WebTouchNavigation::quickDownTimerFired()
{
m_touchDown.m_type = (m_touchDown.m_graphicsSceneEvent) ? QEvent::GraphicsSceneMousePress : QEvent::MouseButtonPress;
m_touchDown.m_pos = closestElement(m_viewObject, m_webFrame, m_touchDown, KNodeSearchThreshold);
m_touchDown.m_button = Qt::LeftButton;
m_touchDown.m_buttons = Qt::NoButton;
generateMouseEvent(m_touchDown);
m_quickUpTimer.setSingleShot(true);
m_quickUpTimer.start(0);
}
void WebTouchNavigation::quickUpTimerFired()
{
m_touchDown.m_type = (m_touchDown.m_graphicsSceneEvent) ? QEvent::GraphicsSceneMouseRelease : QEvent::MouseButtonRelease;
m_touchDown.m_button = Qt::LeftButton;
m_touchDown.m_buttons = Qt::NoButton;
generateMouseEvent(m_touchDown);
}
void WebTouchNavigation::downTimerFired()
{
m_touchDown.m_type = (m_touchDown.m_graphicsSceneEvent) ? QEvent::GraphicsSceneMousePress : QEvent::MouseButtonPress;
m_touchDown.m_pos = closestElement(m_viewObject, m_webFrame, m_touchDown, KNodeSearchThreshold);
m_touchDown.m_button = Qt::LeftButton;
m_touchDown.m_buttons = Qt::NoButton;
generateMouseEvent(m_touchDown);
m_touchDown.m_fired = true;
}
void WebTouchNavigation::hoverTimerFired()
{
m_touchDown.m_type = (m_touchDown.m_graphicsSceneEvent) ? QEvent::GraphicsSceneMouseMove : QEvent::MouseMove;
m_touchDown.m_button = Qt::NoButton;
m_touchDown.m_buttons = Qt::NoButton;
generateMouseEvent(m_touchDown);
}
void WebTouchNavigation::invalidateLastTouchDown()
{
if (m_touchDown.m_fired) {
// send mouse up event invalidate click
m_touchDown.m_type = (m_touchDown.m_graphicsSceneEvent) ? QEvent::GraphicsSceneMouseRelease : QEvent::MouseButtonRelease;
m_touchDown.m_pos = QPoint(-1, -1);
m_touchDown.m_button = Qt::LeftButton;
m_touchDown.m_buttons = Qt::NoButton;
m_touchDown.m_editable = false;
generateMouseEvent(m_touchDown);
}
}
void WebTouchNavigation::handleDownEvent(const WebTouchEvent &event)
{
// Stop previously running physics
m_physics->stop();
m_downTimer.stop();
m_hoverTimer.stop();
m_quickDownTimer.stop();
m_quickUpTimer.stop();
m_webFrame = m_webPage->frameAt(event.m_pos);
if (!m_webFrame)
m_webFrame = m_webPage->currentFrame();
m_scroller->setFrame(m_webFrame);
m_touchDown = event;
m_hoverTimer.setSingleShot(true);
m_hoverTimer.start(KHoverTimeoutThreshold);
m_downTimer.setSingleShot(true);
m_downTimer.start(KTouchDownStartTime);
// Start physics again
m_physics->start(event.m_pos, m_webFrame);
}
void WebTouchNavigation::handleMoveEvent(const WebTouchEvent &event)
{
if (m_physics->move(event.m_pos)) {
// don't send mouse down event.
m_downTimer.stop();
m_hoverTimer.stop();
}
}
void WebTouchNavigation::handleReleaseEvent(const WebTouchEvent &event)
{
if (!m_physics->inMotion() && (m_hoverTimer.isActive() || m_downTimer.isActive())) { // Quick tap
if (m_hoverTimer.isActive()) {
m_touchDown.m_type = (m_touchDown.m_graphicsSceneEvent) ? QEvent::GraphicsSceneMouseMove : QEvent::MouseMove;
m_touchDown.m_button = Qt::NoButton;
m_touchDown.m_buttons = Qt::NoButton;
generateMouseEvent(m_touchDown);
}
m_hoverTimer.stop();
m_downTimer.stop();
m_quickDownTimer.setSingleShot(true);
m_quickDownTimer.start(0);
return;
}
m_hoverTimer.stop();
m_downTimer.stop();
if (m_physics->release(event.m_pos)) {
// Going to kinetic motion. Thus, invalidating last touch down.
invalidateLastTouchDown();
return;
}
if (m_touchDown.m_fired) {
// send mouse up event
m_touchDown.m_type = (m_touchDown.m_graphicsSceneEvent) ? QEvent::GraphicsSceneMouseRelease : QEvent::MouseButtonRelease;
m_touchDown.m_button = Qt::LeftButton;
m_touchDown.m_buttons = Qt::NoButton;
generateMouseEvent(m_touchDown);
}
}
void WebTouchNavigation::generateMouseEvent(const WebTouchEvent &touchEvent)
{
if (!touchEvent.m_editable && m_suppressMouseEvents) //do not suppress mouse events for input box, etc.
return;
if (touchEvent.m_type == QEvent::GraphicsSceneMousePress
|| touchEvent.m_type == QEvent::GraphicsSceneMouseMove
|| touchEvent.m_type == QEvent::GraphicsSceneMouseRelease) {
QGraphicsSceneMouseEvent ievmm(touchEvent.m_type);
ievmm.setPos(touchEvent.m_pos);
ievmm.setScenePos(touchEvent.m_scenePos);
ievmm.setScreenPos(touchEvent.m_screenPos);
ievmm.setButtonDownPos(touchEvent.m_button, touchEvent.m_buttonDownPos);
ievmm.setButtonDownScenePos( touchEvent.m_button, touchEvent.m_buttonDownScenePos);
ievmm.setButtonDownScreenPos( touchEvent.m_button, touchEvent.m_buttonDownScreenPos);
ievmm.setLastPos(touchEvent.m_lastPos);
ievmm.setLastScenePos(touchEvent.m_lastScenePos);
ievmm.setLastScreenPos(touchEvent.m_lastScreenPos);
ievmm.setButtons(touchEvent.m_buttons);
ievmm.setButton( touchEvent.m_button);
ievmm.setModifiers(touchEvent.m_modifier);
m_webPage->event(&ievmm);
} else {
bool inputMethodEnabled = static_cast<QWidget*>(m_viewObject)->testAttribute(Qt::WA_InputMethodEnabled);
if (touchEvent.m_type == QEvent::MouseButtonRelease && inputMethodEnabled) {
if (touchEvent.m_editable) {
QEvent rsipevent(QEvent::RequestSoftwareInputPanel);
QCoreApplication::sendEvent(static_cast<QWidget*>(m_viewObject), &rsipevent);
} else {
static_cast<QWidget*>(m_viewObject)->setAttribute(Qt::WA_InputMethodEnabled, false); // disable input methods if user didn't tap on editable area.
}
}
QMouseEvent ievmm(touchEvent.m_type, touchEvent.m_pos, touchEvent.m_button, touchEvent.m_buttons, touchEvent.m_modifier);
m_webPage->event(&ievmm);
if (touchEvent.m_type == QEvent::MouseButtonRelease && inputMethodEnabled)
static_cast<QWidget*>(m_viewObject)->setAttribute(Qt::WA_InputMethodEnabled, inputMethodEnabled); // re-enable input methods if disabled
}
}
class WebNavigation : public QObject
{
Q_OBJECT
public:
WebNavigation(QObject *parent, QWebPage *webPage);
virtual ~WebNavigation();
private:
QObject *m_viewObject;
QWebPage *m_webPage;
WebTouchNavigation *m_webTouchNavigation;
};
WebNavigation::WebNavigation(QObject *parent, QWebPage *webPage)
: m_viewObject(parent)
, m_webPage(webPage)
, m_webTouchNavigation(0)
{
m_webTouchNavigation = new WebTouchNavigation(m_viewObject, m_webPage);
m_viewObject->installEventFilter(m_webTouchNavigation);
}
WebNavigation::~WebNavigation()
{
delete m_webTouchNavigation;
}
class NavigationControllerPrivate
{
public:
NavigationControllerPrivate(QWidget *parent, QGraphicsWebView *webView);
~NavigationControllerPrivate();
QWebPage *m_webPage;
QWidget *m_webWidget;
QGraphicsWebView *m_graphicsWebView;
WebNavigation *m_webNavigation;
};
NavigationControllerPrivate::NavigationControllerPrivate(QWidget *parent, QGraphicsWebView *webView)
: m_webPage(0)
, m_webWidget(0)
, m_graphicsWebView(webView)
, m_webNavigation(0)
{
Q_UNUSED(parent)
m_graphicsWebView->setAcceptTouchEvents(true);
m_webPage = new QWebPage;
m_graphicsWebView->setPage(m_webPage);
m_webNavigation = new WebNavigation(m_graphicsWebView, m_webPage);
m_webNavigation->setParent(m_graphicsWebView);
}
NavigationControllerPrivate::~NavigationControllerPrivate()
{
if (m_webNavigation)
delete m_webNavigation;
if (m_webPage)
delete m_webPage;
if (m_graphicsWebView)
delete m_graphicsWebView;
}
class NavigationController : public QObject
{
Q_OBJECT
public:
NavigationController(QWidget *parent, QGraphicsWebView *webView);
virtual ~NavigationController();
QWidget *webWidget() const;
QWebPage* webPage() const;
QGraphicsWebView* graphicsWebView() const;
signals:
void pauseNavigation();
void resumeNavigation();
private:
class NavigationControllerPrivate *m_d;
};
NavigationController::NavigationController(QWidget *parent, QGraphicsWebView *webView)
: m_d(new NavigationControllerPrivate(parent, webView))
{
}
NavigationController::~NavigationController()
{
delete m_d;
}
QWebPage* NavigationController::webPage() const
{
return m_d->m_webPage;
}
QGraphicsWebView* NavigationController::graphicsWebView() const
{
return m_d->m_graphicsWebView;
}
#endif // TOUCH_OPTIMIZED_NAVIGATION
class Html5ApplicationViewerPrivate : public QGraphicsView
{
Q_OBJECT
@@ -38,6 +922,9 @@ signals:
public:
QGraphicsWebView *m_webView;
#ifdef TOUCH_OPTIMIZED_NAVIGATION
NavigationController *m_controller;
#endif // TOUCH_OPTIMIZED_NAVIGATION
};
Html5ApplicationViewerPrivate::Html5ApplicationViewerPrivate(QWidget *parent)
@@ -50,7 +937,14 @@ Html5ApplicationViewerPrivate::Html5ApplicationViewerPrivate(QWidget *parent)
setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
m_webView = new QGraphicsWebView;
m_webView->setAcceptTouchEvents(true);
m_webView->setAcceptHoverEvents(false);
setAttribute(Qt::WA_AcceptTouchEvents, true);
scene->addItem(m_webView);
scene->setActiveWindow(m_webView);
#ifdef TOUCH_OPTIMIZED_NAVIGATION
m_controller = new NavigationController(parent, m_webView);
#endif // TOUCH_OPTIMIZED_NAVIGATION
connect(m_webView->page()->mainFrame(),
SIGNAL(javaScriptWindowObjectCleared()), SLOT(addToJavaScript()));
}

View File

@@ -362,6 +362,7 @@ bool ContextPaneWidget::setType(const QStringList &types)
}
if (types.contains("Rectangle")) {
m_currentWidget = m_rectangleWidget;
m_rectangleWidget->enabableGradientEditing(!isPropertyChanges());
m_rectangleWidget->show();
resize(sizeHint());
return true;

View File

@@ -99,6 +99,10 @@ public:
bool setType(const QStringList &types);
bool acceptsType(const QStringList &types);
QWidget* currentWidget() const { return m_currentWidget; }
void setIsPropertyChanges(bool b)
{ m_isPropertyChanges = b; }
bool isPropertyChanges() const
{ return m_isPropertyChanges; }
public slots:
void onTogglePane();
@@ -143,6 +147,7 @@ private:
QString m_colorName;
QPoint m_originalPos;
bool m_pinned;
bool m_isPropertyChanges;
};
} //QmlDesigner

View File

@@ -654,11 +654,11 @@ void PreviewLabel::paintEvent(QPaintEvent *event)
if (m_left >= 0)
p.drawLine(m_left * m_zoom, 4, m_left * m_zoom, height() - 4);
if (m_right >= 0)
p.drawLine(width() - m_right * m_zoom, 4, width() - m_right * m_zoom, height() - 4);
p.drawLine(width() - m_right * m_zoom - 1, 4, width() - m_right * m_zoom - 1, height() - 4);
if (m_top >= 0)
p.drawLine(4, m_top * m_zoom, width() - 4, m_top * m_zoom);
if (m_bottom >= 0)
p.drawLine(4, height() - m_bottom * m_zoom, width() - 4, height() - m_bottom * m_zoom);
p.drawLine(4, height() - m_bottom * m_zoom - 1, width() - 4, height() - m_bottom * m_zoom - 1);
}
{
@@ -671,11 +671,11 @@ void PreviewLabel::paintEvent(QPaintEvent *event)
if (m_left >= 0)
p.drawLine(m_left * m_zoom, 4, m_left * m_zoom, height() - 4);
if (m_right >= 0)
p.drawLine(width() - m_right * m_zoom, 4, width() - m_right * m_zoom, height() - 4);
p.drawLine(width() - m_right * m_zoom - 1, 4, width() - m_right * m_zoom - 1, height() - 4);
if (m_top >= 0)
p.drawLine(4, m_top * m_zoom, width() - 4, m_top * m_zoom);
if (m_bottom >= 0)
p.drawLine(4, height() - m_bottom * m_zoom, width() - 4, height() - m_bottom * m_zoom);
p.drawLine(4, height() - m_bottom * m_zoom - 1, width() - 4, height() - m_bottom * m_zoom - 1);
}
}
}
@@ -690,6 +690,8 @@ void PreviewLabel::mousePressEvent(QMouseEvent * event)
if (!m_borderImage)
return QLabel::mouseMoveEvent(event);
bool bottom = false;
if (event->button() == Qt::LeftButton) {
if (QApplication::overrideCursor())
QApplication::restoreOverrideCursor();
@@ -717,11 +719,15 @@ void PreviewLabel::mousePressEvent(QMouseEvent * event)
event->accept();
m_hooverInfo->setText("Bottom " + QString::number(m_bottom));
m_hooverInfo->show();
bottom = true;
} else {
QLabel::mousePressEvent(event);
}
m_startPos = event->pos();
m_hooverInfo->move(mapToParent(event->pos()) + QPoint(0, 40));
if (bottom)
m_hooverInfo->move(mapToParent(m_startPos) + QPoint(0, -10));
else
m_hooverInfo->move(mapToParent(m_startPos) + QPoint(0, 40));
m_hooverInfo->resize(m_hooverInfo->sizeHint());
m_hooverInfo->raise();
}
@@ -809,6 +815,7 @@ void PreviewLabel::mouseMoveEvent(QMouseEvent * event)
return QLabel::mouseMoveEvent(event);
QPoint p = event->pos();
bool bottom = false;
if (m_dragging_left) {
m_left = p.x() / m_zoom;
m_left = limitPositive(m_left);
@@ -832,6 +839,7 @@ void PreviewLabel::mouseMoveEvent(QMouseEvent * event)
m_bottom = limitPositive(m_bottom);
event->accept();
m_hooverInfo->setText("Bottom " + QString::number(m_bottom));
bottom = true;
update();
} else if (rangeCheck(m_left * m_zoom, p.x())) {
QApplication::setOverrideCursor(QCursor(Qt::SizeHorCursor));
@@ -853,6 +861,7 @@ void PreviewLabel::mouseMoveEvent(QMouseEvent * event)
event->accept();
m_hooverInfo->setText("Bottom " + QString::number(m_bottom));
m_hooverInfo->show();
bottom = true;
} else {
if (QApplication::overrideCursor())
QApplication::restoreOverrideCursor();
@@ -860,7 +869,10 @@ void PreviewLabel::mouseMoveEvent(QMouseEvent * event)
m_hooverInfo->hide();
}
m_startPos = p;
m_hooverInfo->move(mapToParent(p) + QPoint(0, 40));
if (bottom)
m_hooverInfo->move(mapToParent(p) + QPoint(0, -10));
else
m_hooverInfo->move(mapToParent(p) + QPoint(0, 40));
m_hooverInfo->resize(m_hooverInfo->sizeHint());
m_hooverInfo->raise();
}
@@ -889,7 +901,7 @@ PreviewDialog::PreviewDialog(QWidget *parent) : DragWidget(parent)
QHBoxLayout *horizontalLayout = new QHBoxLayout();
QHBoxLayout *horizontalLayout2 = new QHBoxLayout();
layout->setMargin(0);
layout->setContentsMargins(2, 2, 2, 6);
layout->setContentsMargins(2, 2, 2, 16);
layout->setSpacing(4);
QToolButton *toolButton = new QToolButton(this);
QIcon icon(style()->standardIcon(QStyle::SP_DockWidgetCloseButton));

View File

@@ -45,7 +45,8 @@ ContextPaneWidgetRectangle::ContextPaneWidgetRectangle(QWidget *parent) :
QWidget(parent),
ui(new Ui::ContextPaneWidgetRectangle),
m_gradientLineDoubleClicked(false),
m_gradientTimer(-1)
m_gradientTimer(-1),
m_enableGradientEditing(true)
{
ui->setupUi(this);
@@ -112,7 +113,7 @@ void ContextPaneWidgetRectangle::setProperties(QmlJS::PropertyReader *propertyRe
ui->gradientLabel->setEnabled(true);
ui->gradientLine->setEnabled(true);
if (m_hasGradient) {
if (m_hasGradient && isGradientEditingEnabled()) {
bool isBound;
ui->colorGradient->setChecked(true);
ui->gradientLine->setGradient(propertyReader->parseGradient("gradient", &isBound));
@@ -122,8 +123,8 @@ void ContextPaneWidgetRectangle::setProperties(QmlJS::PropertyReader *propertyRe
ui->colorColorButton->setColor("invalidColor");
}
} else {
//ui->gradientLine->setEnabled(false);
//ui->gradientLabel->setEnabled(false);
ui->gradientLine->setEnabled(false);
ui->gradientLabel->setEnabled(false);
setColor();
}
@@ -132,6 +133,12 @@ void ContextPaneWidgetRectangle::setProperties(QmlJS::PropertyReader *propertyRe
m_gradientTimer = -1;
}
ui->colorGradient->setEnabled(isGradientEditingEnabled());
}
void ContextPaneWidgetRectangle::enabableGradientEditing(bool b)
{
m_enableGradientEditing = b;
}
void ContextPaneWidgetRectangle::onBorderColorButtonToggled(bool flag)
@@ -194,6 +201,7 @@ void ContextPaneWidgetRectangle::onGradientClicked()
stops.append(QGradientStop(0, ui->colorColorButton->convertedColor()));
stops.append(QGradientStop(1, Qt::white));
gradient.setStops(stops);
ui->gradientLine->setEnabled(true);
ui->gradientLine->setGradient(gradient);
}
}
@@ -201,15 +209,19 @@ void ContextPaneWidgetRectangle::onGradientClicked()
void ContextPaneWidgetRectangle::onColorNoneClicked()
{
if (ui->colorNone->isChecked()) {
ui->colorGradient->setEnabled(isGradientEditingEnabled());
emit removeAndChangeProperty("gradient", "color", "transparent", true);
}
ui->colorGradient->setEnabled(isGradientEditingEnabled());
}
void ContextPaneWidgetRectangle::onColorSolidClicked()
{
if (ui->colorSolid->isChecked()) {
ui->gradientLine->setEnabled(false);
emit removeAndChangeProperty("gradient", "color", "\"black\"", true);
}
ui->colorGradient->setEnabled(isGradientEditingEnabled());
}
void ContextPaneWidgetRectangle::onBorderNoneClicked()

View File

@@ -57,6 +57,7 @@ public:
explicit ContextPaneWidgetRectangle(QWidget *parent = 0);
~ContextPaneWidgetRectangle();
void setProperties(QmlJS::PropertyReader *propertyReader);
void enabableGradientEditing(bool);
public slots:
void onBorderColorButtonToggled(bool);
@@ -82,12 +83,15 @@ protected:
private:
void setColor();
bool isGradientEditingEnabled() const
{ return m_enableGradientEditing; }
Ui::ContextPaneWidgetRectangle *ui;
bool m_hasBorder;
bool m_hasGradient;
bool m_none;
bool m_gradientLineDoubleClicked;
int m_gradientTimer;
bool m_enableGradientEditing;
};
} //QmlDesigner

View File

@@ -56,6 +56,8 @@
+------------+-------------------------+---------------+
+summaryLabel| toolwidget | detailsButton |
+------------+-------------------------+---------------+
+ additional summary |
+------------+-------------------------+---------------+
| widget |
+------------+-------------------------+---------------+
\endcode
@@ -72,6 +74,7 @@ namespace Utils {
QGridLayout *m_grid;
QLabel *m_summaryLabel;
QCheckBox *m_summaryCheckBox;
QLabel *m_additionalSummaryLabel;
Utils::FadingPanel *m_toolWidget;
QWidget *m_widget;
@@ -88,6 +91,7 @@ namespace Utils {
m_grid(new QGridLayout),
m_summaryLabel(new QLabel(parent)),
m_summaryCheckBox(new QCheckBox(parent)),
m_additionalSummaryLabel(new QLabel(parent)),
m_toolWidget(0),
m_widget(0),
m_state(DetailsWidget::Collapsed),
@@ -108,10 +112,16 @@ namespace Utils {
d->m_summaryCheckBox->setContentsMargins(MARGIN, MARGIN, MARGIN, MARGIN);
d->m_summaryCheckBox->setVisible(false);
d->m_additionalSummaryLabel->setTextInteractionFlags(Qt::TextSelectableByMouse);
d->m_additionalSummaryLabel->setContentsMargins(MARGIN, MARGIN, MARGIN, MARGIN);
d->m_additionalSummaryLabel->setWordWrap(true);
d->m_additionalSummaryLabel->setVisible(false);
d->m_grid->setContentsMargins(0, 0, 0, 0);
d->m_grid->setSpacing(0);
d->m_grid->addWidget(d->m_summaryLabel, 0, 0);
d->m_grid->addWidget(d->m_detailsButton, 0, 2);
d->m_grid->addWidget(d->m_additionalSummaryLabel, 1, 0, 1, 3);
setLayout(d->m_grid);
connect(d->m_detailsButton, SIGNAL(toggled(bool)),
@@ -209,6 +219,17 @@ namespace Utils {
return d->m_summaryLabel->text();
}
QString DetailsWidget::additionalSummaryText() const
{
return d->m_additionalSummaryLabel->text();
}
void DetailsWidget::setAdditionalSummaryText(const QString &text)
{
d->m_additionalSummaryLabel->setText(text);
d->m_additionalSummaryLabel->setVisible(!text.isEmpty());
}
DetailsWidget::State DetailsWidget::state() const
{
return d->m_state;
@@ -269,7 +290,7 @@ namespace Utils {
if (d->m_widget) {
d->m_widget->setContentsMargins(MARGIN, MARGIN, MARGIN, MARGIN);
d->m_grid->addWidget(d->m_widget, 1, 0, 1, 3);
d->m_grid->addWidget(d->m_widget, 2, 0, 1, 3);
}
updateControls();
}

View File

@@ -51,6 +51,7 @@ class QTCREATOR_UTILS_EXPORT DetailsWidget : public QWidget
{
Q_OBJECT
Q_PROPERTY(QString summaryText READ summaryText WRITE setSummaryText DESIGNABLE true)
Q_PROPERTY(QString additionalSummaryText READ additionalSummaryText WRITE setAdditionalSummaryText DESIGNABLE true)
Q_PROPERTY(bool useCheckBox READ useCheckBox WRITE setUseCheckBox DESIGNABLE true)
Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE true)
Q_PROPERTY(State state READ state WRITE setState)
@@ -69,6 +70,9 @@ public:
void setSummaryText(const QString &text);
QString summaryText() const;
void setAdditionalSummaryText(const QString &text);
QString additionalSummaryText() const;
void setState(State state);
State state() const;
@@ -87,6 +91,7 @@ public:
void setUseCheckBox(bool b);
/// Sets an icon, only supported if useCheckBox is true
void setIcon(const QIcon &icon);
signals:
void checked(bool);
private slots:
@@ -103,6 +108,7 @@ private:
void changeHoverState(bool hovered);
DetailsWidgetPrivate *d;
QString m_additionalSummaryText;
};
} // namespace Utils

View File

@@ -54,7 +54,7 @@ template <typename T> static void setIfPresent(const QVariantMap &map, const QSt
{
if (!map.contains(key))
return;
*val = map.value(key).value<T>();
*val = map.value(key).template value<T>();
}
/**

View File

@@ -352,7 +352,7 @@ void CMakeRunPage::initializePage()
if (m_cmakeWizard->existsUpToDateXmlFile()) {
m_descriptionLabel->setText(
tr("The directory %1 already contains a cbp file, which is recent enough. "
"You can pass special arguments or change the used toolchain here and rerun CMake. "
"You can pass special arguments or change the used tool chain here and rerun CMake. "
"Or simply finish the wizard directly.").arg(m_buildDirectory));
} else {
m_descriptionLabel->setText(
@@ -409,7 +409,9 @@ void CMakeRunPage::initializePage()
ProjectExplorer::Abi targetAbi = tc->targetAbi();
QVariant tcVariant = qVariantFromValue(static_cast<void *>(tc));
if (targetAbi.os() == ProjectExplorer::Abi::WindowsOS) {
if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvcFlavor)
if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2005Flavor
|| targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2008Flavor
|| targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2010Flavor)
m_generatorComboBox->addItem(tr("NMake Generator (%1)").arg(tc->displayName()), tcVariant);
else if (targetAbi.osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor)
m_generatorComboBox->addItem(tr("MinGW Generator (%1)").arg(tc->displayName()), tcVariant);
@@ -450,10 +452,10 @@ void CMakeRunPage::runCMake()
QString generator = QLatin1String("-GCodeBlocks - Unix Makefiles");
if (tc->targetAbi().os() == ProjectExplorer::Abi::WindowsOS) {
if (tc->targetAbi().osFlavor() == ProjectExplorer::Abi::WindowsMsvcFlavor)
generator = QLatin1String("-GCodeBlocks - NMake Makefiles");
else
if (tc->targetAbi().osFlavor() == ProjectExplorer::Abi::WindowsMSysFlavor)
generator = QLatin1String("-GCodeBlocks - MinGW Makefiles");
else
generator = QLatin1String("-GCodeBlocks - NMake Makefiles");
}

View File

@@ -313,7 +313,7 @@ void MakeStepConfigWidget::updateDetails()
param.setArguments(arguments);
m_summaryText = param.summary(displayName());
} else {
m_summaryText = tr("<b>Unknown Toolchain</b>");
m_summaryText = tr("<b>Unknown tool chain</b>");
}
emit updateSummary();
}

View File

@@ -311,7 +311,7 @@ void ExternalToolModel::revertTool(const QModelIndex &modelIndex)
QModelIndex ExternalToolModel::addCategory()
{
const QString &categoryBase = tr("New category");
const QString &categoryBase = tr("New Category");
QString category = categoryBase;
int count = 0;
while (m_tools.contains(category)) {
@@ -337,7 +337,7 @@ QModelIndex ExternalToolModel::addTool(const QModelIndex &atIndex)
ExternalTool *tool = new ExternalTool;
tool->setDisplayCategory(category);
tool->setDisplayName(tr("New tool"));
tool->setDisplayName(tr("New Tool"));
tool->setDescription(tr("This tool prints a line of useful text"));
#ifdef Q_OS_WIN
tool->setExecutables(QStringList() << "cmd");

View File

@@ -116,7 +116,7 @@
<item row="1" column="1">
<widget class="Utils::PathChooser" name="executable">
<property name="expectedKind">
<enum>Utils::PathChooser::ExistingCommand</enum>
<enum>Utils::PathChooser::Command</enum>
</property>
</widget>
</item>
@@ -138,7 +138,11 @@
</widget>
</item>
<item row="3" column="1">
<widget class="Utils::PathChooser" name="workingDirectory"/>
<widget class="Utils::PathChooser" name="workingDirectory">
<property name="expectedKind">
<enum>Utils::PathChooser::Directory</enum>
</property>
</widget>
</item>
<item row="4" column="0">
<widget class="QLabel" name="outputLabel">
@@ -162,12 +166,12 @@
</item>
<item>
<property name="text">
<string>Show in pane</string>
<string>Show in Pane</string>
</property>
</item>
<item>
<property name="text">
<string>Replace selection</string>
<string>Replace Selection</string>
</property>
</item>
</widget>
@@ -196,12 +200,12 @@
</item>
<item>
<property name="text">
<string>Show in pane</string>
<string>Show in Pane</string>
</property>
</item>
<item>
<property name="text">
<string>Replace selection</string>
<string>Replace Selection</string>
</property>
</item>
</widget>

View File

@@ -155,7 +155,7 @@ void VariableChooser::handleItemActivated(QListWidgetItem *item)
void VariableChooser::insertVariable(const QString &variable)
{
const QString &text = QLatin1String("${") + variable + QLatin1String("}");
const QString &text = QLatin1String("%{") + variable + QLatin1String("}");
if (m_lineEdit) {
m_lineEdit->insert(text);
m_lineEdit->activateWindow();

View File

@@ -230,10 +230,11 @@ void PasteBinDotComProtocol::list()
QTC_ASSERT(!m_listReply, return;)
// fire request
m_listReply = httpGet(QLatin1String("http://") + hostName(true));
const QString url = QLatin1String("http://") + hostName(true) + QLatin1String("/archive");
m_listReply = httpGet(url);
connect(m_listReply, SIGNAL(finished()), this, SLOT(listFinished()));
if (debug)
qDebug() << "list: sending " << m_listReply;
qDebug() << "list: sending " << url << m_listReply;
}
static inline void padString(QString *s, int len)
@@ -243,85 +244,186 @@ static inline void padString(QString *s, int len)
s->append(QString(missing, QLatin1Char(' ')));
}
/* Quick & dirty: Parse the <div>-elements with the "Recent Posts" listing
* out of the page.
/* Quick & dirty: Parse out the 'archive' table as of 16.3.2011:
\code
<div class="content_left_title">Recent Posts</div>
<div class="content_left_box">
<div class="clb_top"><a href="http://pastebin.com/id">User</a></div>
<div class="clb_bottom"><span>Title</div>
<table class="maintable" cellspacing="0">
<tr class="top">
<th scope="col" align="left">Name / Title</th>
<th scope="col" align="left">Posted</th>
<th scope="col" align="left">Expires</th>
<th scope="col" align="left">Size</th>
<th scope="col" align="left">Syntax</th>
<th scope="col" align="left">User</th>
</tr>
<tr class="g">
<td class="icon"><a href="/8ZRqkcaP">Untitled</a></td>
<td>2 sec ago</td>
<td>Never</td>
<td>9.41 KB</td>
<td><a href="/archive/text">None</a></td>
<td>a guest</td>
</tr>
<tr>
\endcode */
enum ParseState
{
OutSideTable, WithinTable, WithinTableRow, WithinTableHeaderElement,
WithinTableElement, WithinTableElementAnchor, ParseError
};
static inline ParseState nextOpeningState(ParseState current, const QStringRef &element)
{
switch (current) {
case OutSideTable:
if (element == QLatin1String("table"))
return WithinTable;
return OutSideTable;
case WithinTable:
if (element == QLatin1String("tr"))
return WithinTableRow;
break;
case WithinTableRow:
if (element == QLatin1String("td"))
return WithinTableElement;
if (element == QLatin1String("th"))
return WithinTableHeaderElement;
break;
case WithinTableElement:
if (element == QLatin1String("a"))
return WithinTableElementAnchor;
break;
case WithinTableHeaderElement:
case WithinTableElementAnchor:
case ParseError:
break;
}
return ParseError;
}
static inline ParseState nextClosingState(ParseState current, const QStringRef &element)
{
switch (current) {
case OutSideTable:
return OutSideTable;
case WithinTable:
if (element == QLatin1String("table"))
return OutSideTable;
break;
case WithinTableRow:
if (element == QLatin1String("tr"))
return WithinTable;
break;
case WithinTableElement:
if (element == QLatin1String("td"))
return WithinTableRow;
break;
case WithinTableHeaderElement:
if (element == QLatin1String("th"))
return WithinTableRow;
break;
case WithinTableElementAnchor:
if (element == QLatin1String("a"))
return WithinTableElement;
break;
case ParseError:
break;
}
return ParseError;
}
static inline QStringList parseLists(QIODevice *io)
{
enum State { OutsideRecentPostList, InsideRecentPostList,
InsideRecentPostBox, InsideRecentPost };
enum { maxEntries = 200 }; // Limit the archive, which can grow quite large.
QStringList rc;
QXmlStreamReader reader(io);
ParseState state = OutSideTable;
int tableRow = 0;
int tableColumn = 0;
const QString hrefAttribute = QLatin1String("href");
QString link;
QString user;
QString description;
const QString classAttribute = QLatin1String("class");
const QString divElement = QLatin1String("div");
const QString anchorElement = QLatin1String("a");
const QString spanElement = QLatin1String("span");
State state = OutsideRecentPostList;
while (!reader.atEnd()) {
switch(reader.readNext()) {
case QXmlStreamReader::StartElement:
// Inside a <div> of an entry: Anchor or description
if (state == InsideRecentPost) {
if (reader.name() == anchorElement) { // Anchor
// Strip host from link
QString link = reader.attributes().value(QLatin1String("href")).toString();
const int slashPos = link.lastIndexOf(QLatin1Char('/'));
if (slashPos != -1)
link.remove(0, slashPos + 1);
const QString user = reader.readElementText();
rc.push_back(link + QLatin1Char(' ') + user);
} else if (reader.name() == spanElement) { // <span> with description
const QString description = reader.readElementText();
QTC_ASSERT(!rc.isEmpty(), return rc; )
padString(&rc.back(), 25);
rc.back() += QLatin1Char(' ');
rc.back() += description;
state = nextOpeningState(state, reader.name());
switch (state) {
case WithinTableRow:
tableColumn = 0;
break;
case OutSideTable:
case WithinTable:
case WithinTableHeaderElement:
case WithinTableElement:
break;
case WithinTableElementAnchor: // 'href="/svb5K8wS"'
if (tableColumn == 0) {
link = reader.attributes().value(hrefAttribute).toString();
if (link.startsWith(QLatin1Char('/')))
link.remove(0, 1);
}
} else if (reader.name() == divElement) { // "<div>" state switching
switch (state) {
// Check on the contents as there are several lists.
case OutsideRecentPostList:
if (reader.attributes().value(classAttribute) == QLatin1String("content_left_title")
&& reader.readElementText() == QLatin1String("Recent Posts"))
state = InsideRecentPostList;
break;
case InsideRecentPostList:
if (reader.attributes().value(classAttribute) == QLatin1String("content_left_box"))
state = InsideRecentPostBox;
break;
case InsideRecentPostBox:
state = InsideRecentPost;
break;
default:
break;
}
} // divElement
break;
case ParseError:
return rc;
} // switch startelement state
break;
case QXmlStreamReader::EndElement:
if (reader.name() == divElement) {
switch (state) {
case InsideRecentPost:
state = InsideRecentPostBox;
break;
case InsideRecentPostBox: // Stop parsing when leaving the box.
state = nextClosingState(state, reader.name());
switch (state) {
case OutSideTable:
if (tableRow) // Seen the table, bye.
return rc;
break;
default:
break;
break;
case WithinTable:
if (tableRow && !user.isEmpty() && !link.isEmpty() && !description.isEmpty()) {
QString entry = link;
entry += QLatin1Char(' ');
entry += user;
entry += QLatin1Char(' ');
entry += description;
rc.push_back(entry);
if (rc.size() >= maxEntries)
return rc;
}
}
tableRow++;
user.clear();
link.clear();
description.clear();
break;
case WithinTableRow:
tableColumn++;
break;
case WithinTableHeaderElement:
case WithinTableElement:
case WithinTableElementAnchor:
break;
case ParseError:
return rc;
} // switch endelement state
break;
case QXmlStreamReader::Characters:
switch (state) {
break;
case WithinTableElement:
if (tableColumn == 5)
user = reader.text().toString();
break;
case WithinTableElementAnchor:
if (tableColumn == 0)
description = reader.text().toString();
break;
default:
break;
} // switch characters read state
break;
default:
break;
}
} // switch reader state
}
return rc;
}

View File

@@ -90,7 +90,8 @@ void CppHighlighter::highlightBlock(const QString &text)
Parentheses parentheses;
parentheses.reserve(20); // assume wizard level ;-)
bool highlightAsPreprocessor = false;
bool expectPreprocessorKeyword = false;
bool onlyHighlightComments = false;
for (int i = 0; i < tokens.size(); ++i) {
const Token &tk = tokens.at(i);
@@ -135,20 +136,28 @@ void CppHighlighter::highlightBlock(const QString &text)
}
}
bool highlightCurrentWordAsPreprocessor = highlightAsPreprocessor;
bool highlightCurrentWordAsPreprocessor = expectPreprocessorKeyword;
if (highlightAsPreprocessor)
highlightAsPreprocessor = false;
if (expectPreprocessorKeyword)
expectPreprocessorKeyword = false;
if (onlyHighlightComments && !tk.isComment())
continue;
if (i == 0 && tk.is(T_POUND)) {
highlightLine(text, tk.begin(), tk.length(), m_formats[CppPreprocessorFormat]);
highlightAsPreprocessor = true;
expectPreprocessorKeyword = true;
} else if (highlightCurrentWordAsPreprocessor &&
(tk.isKeyword() || tk.is(T_IDENTIFIER)) && isPPKeyword(text.midRef(tk.begin(), tk.length())))
(tk.isKeyword() || tk.is(T_IDENTIFIER)) && isPPKeyword(text.midRef(tk.begin(), tk.length()))) {
setFormat(tk.begin(), tk.length(), m_formats[CppPreprocessorFormat]);
const QStringRef ppKeyword = text.midRef(tk.begin(), tk.length());
if (ppKeyword == QLatin1String("error")
|| ppKeyword == QLatin1String("warning")
|| ppKeyword == QLatin1String("pragma")) {
onlyHighlightComments = true;
}
else if (tk.is(T_NUMERIC_LITERAL))
} else if (tk.is(T_NUMERIC_LITERAL))
setFormat(tk.begin(), tk.length(), m_formats[CppNumberFormat]);
else if (tk.is(T_STRING_LITERAL) || tk.is(T_CHAR_LITERAL) || tk.is(T_ANGLE_STRING_LITERAL) ||

View File

@@ -52,7 +52,7 @@
<item row="2" column="0">
<widget class="QLabel" name="toolchainLabel">
<property name="text">
<string>&amp;Toolchain:</string>
<string>&amp;Tool chain:</string>
</property>
<property name="buddy">
<cstring>toolchainComboBox</cstring>

View File

@@ -44,7 +44,7 @@
<item row="1" column="0">
<widget class="QLabel" name="toolchainLabel">
<property name="text">
<string>&amp;Toolchain:</string>
<string>&amp;Tool chain:</string>
</property>
<property name="buddy">
<cstring>toolchainComboBox</cstring>

View File

@@ -442,10 +442,8 @@ MultiBreakPointsDialog::MultiBreakPointsDialog(unsigned engineCapabilities, QWid
///////////////////////////////////////////////////////////////////////
BreakWindow::BreakWindow(QWidget *parent)
: QTreeView(parent)
: QTreeView(parent)
{
m_alwaysResizeColumnsToContents = false;
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
setFrameStyle(QFrame::NoFrame);
setAttribute(Qt::WA_MacShowFocusRect, false);
@@ -463,6 +461,9 @@ BreakWindow::BreakWindow(QWidget *parent)
connect(debuggerCore()->action(UseAddressInBreakpointsView),
SIGNAL(toggled(bool)),
SLOT(showAddressColumn(bool)));
connect(debuggerCore()->action(AlwaysAdjustBreakpointsColumnWidths),
SIGNAL(toggled(bool)),
SLOT(setAlwaysResizeColumnsToContents(bool)));
}
void BreakWindow::showAddressColumn(bool on)
@@ -559,12 +560,6 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction *adjustColumnAction =
new QAction(tr("Adjust Column Widths to Contents"), &menu);
QAction *alwaysAdjustAction =
new QAction(tr("Always Adjust Column Widths to Contents"), &menu);
alwaysAdjustAction->setCheckable(true);
alwaysAdjustAction->setChecked(m_alwaysResizeColumnsToContents);
QAction *editBreakpointAction =
new QAction(tr("Edit Breakpoint..."), &menu);
editBreakpointAction->setEnabled(!selectedIds.isEmpty());
@@ -610,7 +605,7 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addAction(debuggerCore()->action(UseToolTipsInBreakpointsView));
menu.addAction(debuggerCore()->action(UseAddressInBreakpointsView));
menu.addAction(adjustColumnAction);
menu.addAction(alwaysAdjustAction);
menu.addAction(debuggerCore()->action(AlwaysAdjustBreakpointsColumnWidths));
menu.addSeparator();
menu.addAction(debuggerCore()->action(SettingsDialog));
@@ -624,8 +619,6 @@ void BreakWindow::contextMenuEvent(QContextMenuEvent *ev)
deleteBreakpoints(breakpointsInFile);
else if (act == adjustColumnAction)
resizeColumnsToContents();
else if (act == alwaysAdjustAction)
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
else if (act == editBreakpointAction)
editBreakpoints(selectedIds);
else if (act == associateBreakpointAction)
@@ -729,7 +722,6 @@ void BreakWindow::resizeColumnsToContents()
void BreakWindow::setAlwaysResizeColumnsToContents(bool on)
{
m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
for (int i = model()->columnCount(); --i >= 0; )

View File

@@ -70,8 +70,6 @@ private:
void editBreakpoints(const BreakpointIds &ids);
void associateBreakpoint(const BreakpointIds &ids, int thread);
void setBreakpointsEnabled(const BreakpointIds &ids, bool enabled);
bool m_alwaysResizeColumnsToContents;
};
} // namespace Internal

View File

@@ -349,7 +349,9 @@ static QString cdbBinary(const DebuggerStartParameters &sp)
if (!sp.debuggerCommand.isEmpty()) {
// Do not use a GDB binary if we got started for a project with MinGW runtime.
const bool abiMatch = sp.toolChainAbi.os() == ProjectExplorer::Abi::WindowsOS
&& sp.toolChainAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvcFlavor;
&& (sp.toolChainAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2005Flavor
|| sp.toolChainAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2008Flavor
|| sp.toolChainAbi.osFlavor() == ProjectExplorer::Abi::WindowsMsvc2010Flavor);
if (abiMatch)
return sp.debuggerCommand;
}

View File

@@ -54,38 +54,47 @@ using namespace ProjectExplorer;
namespace Debugger {
namespace Internal {
CommonOptionsPageWidget::CommonOptionsPageWidget(const QSharedPointer<Utils::SavedActionSet> &group, QWidget *parent) :
QWidget(parent), m_group(group)
CommonOptionsPageWidget::CommonOptionsPageWidget
(const QSharedPointer<Utils::SavedActionSet> &group, QWidget *parent)
: QWidget(parent), m_group(group)
{
m_ui.setupUi(this);
DebuggerCore *dc = debuggerCore();
m_group->clear();
m_group->insert(debuggerCore()->action(ListSourceFiles),
m_group->insert(dc->action(ListSourceFiles),
m_ui.checkBoxListSourceFiles);
m_group->insert(debuggerCore()->action(UseAlternatingRowColors),
m_group->insert(dc->action(UseAlternatingRowColors),
m_ui.checkBoxUseAlternatingRowColors);
m_group->insert(debuggerCore()->action(UseToolTipsInMainEditor),
m_group->insert(dc->action(UseToolTipsInMainEditor),
m_ui.checkBoxUseToolTipsInMainEditor);
m_group->insert(debuggerCore()->action(CloseBuffersOnExit),
m_group->insert(dc->action(CloseBuffersOnExit),
m_ui.checkBoxCloseBuffersOnExit);
m_group->insert(debuggerCore()->action(SwitchModeOnExit),
m_group->insert(dc->action(SwitchModeOnExit),
m_ui.checkBoxSwitchModeOnExit);
m_group->insert(debuggerCore()->action(AutoDerefPointers), 0);
m_group->insert(debuggerCore()->action(UseToolTipsInLocalsView), 0);
m_group->insert(debuggerCore()->action(UseToolTipsInBreakpointsView), 0);
m_group->insert(debuggerCore()->action(UseAddressInBreakpointsView), 0);
m_group->insert(debuggerCore()->action(UseAddressInStackView), 0);
m_group->insert(debuggerCore()->action(MaximalStackDepth),
m_group->insert(dc->action(AutoDerefPointers), 0);
m_group->insert(dc->action(UseToolTipsInLocalsView), 0);
m_group->insert(dc->action(AlwaysAdjustLocalsColumnWidths), 0);
m_group->insert(dc->action(AlwaysAdjustThreadsColumnWidths), 0);
m_group->insert(dc->action(AlwaysAdjustSnapshotsColumnWidths), 0);
m_group->insert(dc->action(AlwaysAdjustBreakpointsColumnWidths), 0);
m_group->insert(dc->action(AlwaysAdjustModulesColumnWidths), 0);
m_group->insert(dc->action(UseToolTipsInBreakpointsView), 0);
m_group->insert(dc->action(UseAddressInBreakpointsView), 0);
m_group->insert(dc->action(UseAddressInStackView), 0);
m_group->insert(dc->action(AlwaysAdjustStackColumnWidths), 0);
m_group->insert(dc->action(MaximalStackDepth),
m_ui.spinBoxMaximalStackDepth);
m_group->insert(debuggerCore()->action(ShowStdNamespace), 0);
m_group->insert(debuggerCore()->action(ShowQtNamespace), 0);
m_group->insert(debuggerCore()->action(SortStructMembers), 0);
m_group->insert(debuggerCore()->action(LogTimeStamps), 0);
m_group->insert(debuggerCore()->action(VerboseLog), 0);
m_group->insert(debuggerCore()->action(BreakOnThrow), 0);
m_group->insert(debuggerCore()->action(BreakOnCatch), 0);
m_group->insert(dc->action(ShowStdNamespace), 0);
m_group->insert(dc->action(ShowQtNamespace), 0);
m_group->insert(dc->action(SortStructMembers), 0);
m_group->insert(dc->action(LogTimeStamps), 0);
m_group->insert(dc->action(VerboseLog), 0);
m_group->insert(dc->action(BreakOnThrow), 0);
m_group->insert(dc->action(BreakOnCatch), 0);
#ifdef Q_OS_WIN
Utils::SavedAction *registerAction = debuggerCore()->action(RegisterForPostMortem);
Utils::SavedAction *registerAction = dc->action(RegisterForPostMortem);
m_group->insert(registerAction,
m_ui.checkBoxRegisterForPostMortem);
connect(registerAction, SIGNAL(toggled(bool)),
@@ -253,26 +262,28 @@ QWidget *DebuggingHelperOptionPage::createPage(QWidget *parent)
m_ui.setupUi(w);
m_ui.dumperLocationChooser->setExpectedKind(Utils::PathChooser::Command);
m_ui.dumperLocationChooser->setPromptDialogTitle(QCoreApplication::translate("Debugger",
"Choose DebuggingHelper Location"));
m_ui.dumperLocationChooser->setPromptDialogTitle(QCoreApplication::translate
("Debugger", "Choose DebuggingHelper Location"));
m_ui.dumperLocationChooser->setInitialBrowsePathBackup(
ICore::instance()->resourcePath() + "../../lib");
m_group.clear();
m_group.insert(debuggerCore()->action(UseDebuggingHelpers),
DebuggerCore *dc = debuggerCore();
m_group.insert(dc->action(UseDebuggingHelpers),
m_ui.debuggingHelperGroupBox);
m_group.insert(debuggerCore()->action(UseCustomDebuggingHelperLocation),
m_group.insert(dc->action(UseCustomDebuggingHelperLocation),
m_ui.customLocationGroupBox);
// Suppress Oxygen style's giving flat group boxes bold titles.
if (oxygenStyle())
m_ui.customLocationGroupBox->setStyleSheet(_("QGroupBox::title { font: ; }"));
m_group.insert(debuggerCore()->action(CustomDebuggingHelperLocation),
m_group.insert(dc->action(CustomDebuggingHelperLocation),
m_ui.dumperLocationChooser);
m_group.insert(debuggerCore()->action(UseCodeModel),
m_group.insert(dc->action(UseCodeModel),
m_ui.checkBoxUseCodeModel);
m_group.insert(debuggerCore()->action(ShowThreadNames),
m_group.insert(dc->action(ShowThreadNames),
m_ui.checkBoxShowThreadNames);

View File

@@ -107,13 +107,67 @@ DebuggerSettings::DebuggerSettings(QSettings *settings)
// View
//
item = new SavedAction(this);
item->setText(tr("Adjust Column Widths to Contents"));
insertItem(AdjustColumnWidths, item);
item->setText(tr("Always Adjust Column Widths to Contents"));
item->setCheckable(true);
item->setValue(false);
item->setDefaultValue(false);
item->setSettingsKey(debugModeGroup,
QLatin1String("AlwaysAdjustLocalsColumnWidths"));
insertItem(AlwaysAdjustLocalsColumnWidths, item);
item = new SavedAction(this);
item->setText(tr("Always Adjust Column Widths to Contents"));
item->setCheckable(true);
insertItem(AlwaysAdjustColumnWidths, item);
item->setValue(false);
item->setDefaultValue(false);
item->setSettingsKey(debugModeGroup,
QLatin1String("AlwaysAdjustStackColumnWidths"));
insertItem(AlwaysAdjustStackColumnWidths, item);
item = new SavedAction(this);
item->setText(tr("Always Adjust Column Widths to Contents"));
item->setCheckable(true);
item->setValue(false);
item->setDefaultValue(false);
item->setSettingsKey(debugModeGroup,
QLatin1String("AlwaysAdjustThreadsColumnWidths"));
insertItem(AlwaysAdjustThreadsColumnWidths, item);
item = new SavedAction(this);
item->setText(tr("Always Adjust Column Widths to Contents"));
item->setCheckable(true);
item->setValue(false);
item->setDefaultValue(false);
item->setSettingsKey(debugModeGroup,
QLatin1String("AlwaysAdjustRegistersColumnWidths"));
insertItem(AlwaysAdjustRegistersColumnWidths, item);
item = new SavedAction(this);
item->setText(tr("Always Adjust Column Widths to Contents"));
item->setCheckable(true);
item->setValue(false);
item->setDefaultValue(false);
item->setSettingsKey(debugModeGroup,
QLatin1String("AlwaysAdjustSnapshotsColumnWidths"));
insertItem(AlwaysAdjustSnapshotsColumnWidths, item);
item = new SavedAction(this);
item->setText(tr("Always Adjust Column Widths to Contents"));
item->setCheckable(true);
item->setValue(false);
item->setDefaultValue(false);
item->setSettingsKey(debugModeGroup,
QLatin1String("AlwaysAdjustBreakpointsColumnWidths"));
insertItem(AlwaysAdjustBreakpointsColumnWidths, item);
item = new SavedAction(this);
item->setText(tr("Always Adjust Column Widths to Contents"));
item->setCheckable(true);
item->setValue(false);
item->setDefaultValue(false);
item->setSettingsKey(debugModeGroup,
QLatin1String("AlwaysAdjustModulesColumnWidths"));
insertItem(AlwaysAdjustModulesColumnWidths, item);
item = new SavedAction(this);
item->setText(tr("Use Alternating Row Colors"));

View File

@@ -90,8 +90,6 @@ enum DebuggerActionCode
{
// General
SettingsDialog,
AdjustColumnWidths,
AlwaysAdjustColumnWidths,
UseAlternatingRowColors,
UseMessageBoxForSignals,
AutoQuit,
@@ -128,12 +126,14 @@ enum DebuggerActionCode
MaximalStackDepth,
ExpandStack,
CreateFullBacktrace,
AlwaysAdjustStackColumnWidths,
// Watchers & Locals
ShowStdNamespace,
ShowQtNamespace,
SortStructMembers,
AutoDerefPointers,
AlwaysAdjustLocalsColumnWidths,
// Source List
ListSourceFiles,
@@ -147,10 +147,23 @@ enum DebuggerActionCode
AllPluginBreakpoints,
SelectedPluginBreakpoints,
AdjustBreakpointLocations,
AlwaysAdjustBreakpointsColumnWidths,
NoPluginBreakpoints,
SelectedPluginBreakpointsPattern,
BreakOnThrow,
BreakOnCatch
BreakOnCatch,
// Registers
AlwaysAdjustRegistersColumnWidths,
// Snapshots
AlwaysAdjustSnapshotsColumnWidths,
// Threads
AlwaysAdjustThreadsColumnWidths,
// Modules
AlwaysAdjustModulesColumnWidths
};
} // namespace Internal

View File

@@ -214,6 +214,7 @@ enum ModelRoles
LocalsEditTypeRole, // A QVariant::type describing the item
LocalsIntegerBaseRole, // Number base 16, 10, 8, 2
LocalsExpressionRole,
LocalsRawExpressionRole,
LocalsExpandedRole, // The preferred expanded state to the view
LocalsTypeFormatListRole,
LocalsTypeFormatRole, // Used to communicate alternative formats to the view

View File

@@ -223,6 +223,7 @@ public slots:
void scheduleResetLocation()
{
m_stackHandler.scheduleResetLocation();
m_disassemblerAgent.scheduleResetLocation();
m_locationTimer.setSingleShot(true);
m_locationTimer.start(80);
}

View File

@@ -1474,7 +1474,7 @@ void DebuggerPluginPrivate::startRemoteCdbSession()
Abi hostAbi = Abi::hostAbi();
sp.toolChainAbi = ProjectExplorer::Abi(hostAbi.architecture(),
ProjectExplorer::Abi::WindowsOS,
ProjectExplorer::Abi::WindowsMsvcFlavor,
ProjectExplorer::Abi::WindowsMsvc2010Flavor,
ProjectExplorer::Abi::PEFormat,
true);
sp.startMode = AttachToRemote;
@@ -2377,6 +2377,8 @@ static QString formatStartParameters(DebuggerStartParameters &sp)
str << " (built: " << QDir::toNativeSeparators(sp.projectBuildDir) << ')';
str << '\n';
}
if (!sp.qtInstallPath.isEmpty())
str << "Qt: " << QDir::toNativeSeparators(sp.qtInstallPath) << '\n';
if (!sp.qmlServerAddress.isEmpty())
str << "QML server: " << sp.qmlServerAddress << ':' << sp.qmlServerPort << '\n';
if (!sp.remoteChannel.isEmpty()) {
@@ -2454,12 +2456,12 @@ QString DebuggerPluginPrivate::debuggerForAbi(const Abi &abi, DebuggerEngineType
{
enum { debug = 0 };
Abi searchAbi = abi;
// Pick the right toolchain in case cdb/gdb were started with other toolchains.
// Pick the right tool chain in case cdb/gdb were started with other tool chains.
// Also, lldb should be preferred over gdb.
if (searchAbi.os() == ProjectExplorer::Abi::WindowsOS) {
switch (et) {
case CdbEngineType:
searchAbi = Abi(abi.architecture(), abi.os(), Abi::WindowsMsvcFlavor,
searchAbi = Abi(abi.architecture(), abi.os(), Abi::WindowsMsvc2010Flavor,
abi.binaryFormat(), abi.wordWidth());
break;
case GdbEngineType:

View File

@@ -64,6 +64,7 @@
#include <utils/fancymainwindow.h>
#include <utils/qtcprocess.h>
#include <coreplugin/icore.h>
#include <utils/buildablehelperlibrary.h>
#include <QtCore/QDir>
#include <QtCore/QDebug>
@@ -325,7 +326,7 @@ RunConfiguration *DebuggerRunControl::runConfiguration() const
////////////////////////////////////////////////////////////////////////
//
// Engine detection logic: Detection functions depending on toolchain, binary,
// Engine detection logic: Detection functions depending on tool chain, binary,
// etc. Return a list of possible engines (order of prefererence) without
// consideration of configuration, etc.
//
@@ -684,6 +685,11 @@ static DebuggerStartParameters localStartParameters(RunConfiguration *runConfigu
sp.dumperLibraryLocations = rc->dumperLibraryLocations();
if (const ProjectExplorer::Target *target = runConfiguration->target()) {
if (QByteArray(target->metaObject()->className()).contains("Qt4")) {
const QString qmake = Utils::BuildableHelperLibrary::findSystemQt(sp.environment);
if (!qmake.isEmpty())
sp.qtInstallPath = findQtInstallPath(qmake);
}
if (const ProjectExplorer::Project *project = target->project()) {
sp.projectDir = project->projectDirectory();
if (const ProjectExplorer::BuildConfiguration *buildConfig = target->activeBuildConfiguration()) {

View File

@@ -393,5 +393,24 @@ void DebuggerSourcePathMappingWidget::slotEditTargetFieldChanged()
}
}
/* Merge settings for an installed Qt (unless another setting
* is already in the map. */
DebuggerSourcePathMappingWidget::SourcePathMap
DebuggerSourcePathMappingWidget::mergePlatformQtPath(const QString &qtInstallPath,
const SourcePathMap &in)
{
SourcePathMap rc = in;
const size_t buildPathCount = sizeof(qtBuildPaths)/sizeof(const char *);
if (qtInstallPath.isEmpty() || buildPathCount == 0)
return rc;
for (size_t i = 0; i < buildPathCount; i++) {
const QString buildPath = QString::fromLatin1(qtBuildPaths[i]);
if (!rc.contains(buildPath)) // Do not overwrite user settings.
rc.insert(buildPath, qtInstallPath);
}
return rc;
}
} // namespace Internal
} // namespace Debugger

View File

@@ -66,6 +66,11 @@ public:
SourcePathMap sourcePathMap() const;
void setSourcePathMap(const SourcePathMap &);
/* Merge settings for an installed Qt (unless another setting
* is already in the map. */
static SourcePathMap mergePlatformQtPath(const QString &qtInstallPath,
const SourcePathMap &in);
signals:
private slots:

View File

@@ -96,6 +96,7 @@ public:
QString projectBuildDir;
QString projectDir;
QString qtInstallPath;
// Used by remote debugging.
QString remoteChannel;
QString remoteArchitecture;

View File

@@ -43,7 +43,7 @@ class Abi;
namespace Debugger {
namespace Internal {
// Let the user pick a toolchain/ABI associated with a debugger.
// Let the user pick a tool chain/ABI associated with a debugger.
class DebuggerToolChainComboBox : public QComboBox
{
Q_OBJECT

View File

@@ -86,12 +86,14 @@ public:
QHash<QString, DisassemblerLines> cache;
QString mimeType;
bool m_resetLocationScheduled;
};
DisassemblerAgentPrivate::DisassemblerAgentPrivate()
: editor(0),
tryMixed(true),
mimeType(_("text/x-qtcreator-generic-asm"))
mimeType(_("text/x-qtcreator-generic-asm")),
m_resetLocationScheduled(false)
{
locationMark = new ITextMark;
locationMark->setIcon(debuggerCore()->locationMarkIcon());
@@ -133,11 +135,19 @@ void DisassemblerAgent::cleanup()
d->cache.clear();
}
void DisassemblerAgent::scheduleResetLocation()
{
d->m_resetLocationScheduled = true;
}
void DisassemblerAgent::resetLocation()
{
if (!d->editor)
return;
d->editor->markableInterface()->removeMark(d->locationMark);
if (d->m_resetLocationScheduled) {
d->m_resetLocationScheduled = false;
d->editor->markableInterface()->removeMark(d->locationMark);
}
}
static QString frameKey(const Location &loc)

View File

@@ -57,6 +57,7 @@ public:
void setTryMixed(bool on);
void setLocation(const Location &location);
const Location &location() const;
void scheduleResetLocation();
void resetLocation();
void setContents(const DisassemblerLines &contents);
void updateLocationMarker();

View File

@@ -92,36 +92,6 @@ void AbstractPlainGdbAdapter::handleFileExecAndSymbols(const GdbResponse &respon
}
void AbstractPlainGdbAdapter::runEngine()
{
QTC_ASSERT(state() == EngineRunRequested, qDebug() << state());
QString fileName;
{
QTemporaryFile symbols(QDir::tempPath() + "/gdb_ns_");
symbols.open();
fileName = symbols.fileName();
}
m_engine->postCommand("maint print msymbols " + fileName.toLocal8Bit(),
CB(handleNamespaceExtraction), fileName);
}
void AbstractPlainGdbAdapter::handleNamespaceExtraction(const GdbResponse &response)
{
QFile file(response.cookie.toString());
file.open(QIODevice::ReadOnly);
QByteArray ba = file.readAll();
file.remove();
int pos = ba.indexOf("7QString9fromAscii");
int pos1 = pos - 1;
while (pos1 > 0 && ba.at(pos1) != 'N' && ba.at(pos1) > '@')
--pos1;
++pos1;
const QByteArray ns = ba.mid(pos1, pos - pos1);
if (!ns.isEmpty())
m_engine->setQtNamespace(ns + "::");
doRunEngine();
}
void AbstractPlainGdbAdapter::doRunEngine()
{
m_engine->postCommand("-exec-run", GdbEngine::RunRequest, CB(handleExecRun));
}

View File

@@ -52,7 +52,6 @@ public:
protected:
void handleInfoTarget(const GdbResponse &response);
void handleNamespaceExtraction(const GdbResponse &response);
private:
virtual QByteArray execFilePath() const = 0;
@@ -61,7 +60,6 @@ private:
virtual QString fromLocalEncoding(const QByteArray &ba) const = 0;
void handleExecRun(const GdbResponse &response);
void handleFileExecAndSymbols(const GdbResponse &response);
void doRunEngine();
};
} // namespace Debugger

View File

@@ -72,7 +72,7 @@
enum { debug = 0 };
/* Libraries we want to be notified about (pending introduction of a 'notify all'
* setting in TCF TRK, Bug #11842 */
* setting in Coda, Bug #11842 */
static const char *librariesC[] = {
"pipelib.ldd", "rpipe.dll", "libc.dll",
"libdl.dll", "libm.dll", "libpthread.dll",
@@ -115,7 +115,7 @@ static inline QString startMsg(const trk::Session &session)
* When continuing in sendTrkContinue(), we delete this thread, since we cannot
* know whether it will exist at the next stop.
* Also note that threads continue running in Symbian even if one crashes.
* TODO: - Maybe thread reporting will be improved in TCF TRK?
* TODO: - Maybe thread reporting will be improved in Coda?
* - Stop all threads once one stops?
* - Breakpoints do not trigger in threads other than the main thread. */
@@ -154,9 +154,11 @@ void CodaGdbAdapter::setupTrkDeviceSignals()
connect(m_codaDevice.data(), SIGNAL(error(QString)),
this, SLOT(codaDeviceError(QString)));
connect(m_codaDevice.data(), SIGNAL(logMessage(QString)),
this, SLOT(trkLogMessage(QString)));
this, SLOT(codaLogMessage(QString)));
connect(m_codaDevice.data(), SIGNAL(tcfEvent(Coda::CodaEvent)),
this, SLOT(codaEvent(Coda::CodaEvent)));
connect(SymbianUtils::SymbianDeviceManager::instance(), SIGNAL(deviceRemoved(const SymbianUtils::SymbianDevice)),
this, SLOT(codaDeviceRemoved(SymbianUtils::SymbianDevice)));
}
CodaGdbAdapter::~CodaGdbAdapter()
@@ -179,7 +181,7 @@ void CodaGdbAdapter::setVerbose(int verbose)
m_codaDevice->setVerbose(m_verbose);
}
void CodaGdbAdapter::trkLogMessage(const QString &msg)
void CodaGdbAdapter::codaLogMessage(const QString &msg)
{
logMessage(_("TRK ") + msg);
}
@@ -240,7 +242,7 @@ void CodaGdbAdapter::handleCodaRunControlModuleLoadContextSuspendedEvent(const C
m_session.modules.removeAt(index);
m_session.libraries.removeAt(index);
} else {
// Might happen with preliminary version of TCF TRK.
// Might happen with preliminary version of Coda.
qWarning("Received unload for module '%s' for which no load was received.",
qPrintable(moduleName));
}
@@ -295,6 +297,17 @@ void CodaGdbAdapter::handleTargetRemote(const GdbResponse &record)
}
}
void CodaGdbAdapter::codaDeviceRemoved(const SymbianUtils::SymbianDevice &dev)
{
const DebuggerStartParameters &parameters = startParameters();
if (state() != DebuggerNotReady && !m_codaDevice.isNull() && parameters.remoteChannel == dev.portName()) {
const QString message = QString::fromLatin1("Device '%1' has been disconnected.").arg(dev.friendlyName());
logMessage(message);
m_engine->handleAdapterCrashed(message);
cleanup();
}
}
void CodaGdbAdapter::codaEvent(const CodaEvent &e)
{
if (debug)
@@ -968,7 +981,7 @@ void CodaGdbAdapter::handleGdbServerCommand(const QByteArray &cmd)
void CodaGdbAdapter::sendRunControlTerminateCommand()
{
// Requires id of main thread to terminate.
// Note that calling 'Settings|set|removeExecutable' crashes TCF TRK,
// Note that calling 'Settings|set|removeExecutable' crashes Coda,
// so, it is apparently not required.
m_codaDevice->sendRunControlTerminateCommand(
CodaCallback(this, &CodaGdbAdapter::handleRunControlTerminate),
@@ -1085,7 +1098,7 @@ void CodaGdbAdapter::startAdapter()
if (parameters.communicationChannel ==
DebuggerStartParameters::CommunicationChannelTcpIp) {
logMessage(_("Connecting to TCF TRK on %1:%2")
logMessage(_("Connecting to Coda on %1:%2")
.arg(codaServerAddress).arg(codaServerPort));
codaSocket->connectToHost(codaServerAddress, codaServerPort);
} else {
@@ -1121,7 +1134,7 @@ void CodaGdbAdapter::addThread(unsigned id)
m_session.mainTid = id;
}
// We cannot retrieve register values unless the registers of that
// thread have been retrieved (TCF TRK oddity).
// thread have been retrieved (Coda oddity).
const QByteArray contextId = RunControlContext::tcfId(m_session.pid, id);
m_codaDevice->sendRegistersGetChildrenCommand(
CodaCallback(this, &CodaGdbAdapter::handleRegisterChildren),

View File

@@ -58,6 +58,10 @@ namespace Coda {
class CodaRunControlModuleLoadContextSuspendedEvent;
}
namespace SymbianUtils {
class SymbianDevice;
}
namespace Debugger {
namespace Internal {
@@ -153,7 +157,9 @@ private:
//
Q_SLOT void handleGdbConnection();
Q_SLOT void readGdbServerCommand();
Q_SLOT void codaDeviceError(const QString &);
Q_SLOT void codaDeviceError(const QString &);
Q_SLOT void codaDeviceRemoved(const SymbianUtils::SymbianDevice &dev);
void startGdb();
Q_SLOT void codaEvent(const Coda::CodaEvent &knownEvent);
void handleCodaRunControlModuleLoadContextSuspendedEvent(const Coda::CodaRunControlModuleLoadContextSuspendedEvent &e);
@@ -171,7 +177,7 @@ private:
void gdbSetCurrentThread(const QByteArray &cmd, const char *why);
void logMessage(const QString &msg, int channel = LogDebug); // triggers output() if m_verbose
Q_SLOT void trkLogMessage(const QString &msg);
Q_SLOT void codaLogMessage(const QString &msg);
QPointer<QTcpServer> m_gdbServer;
QPointer<QTcpSocket> m_gdbConnection;

View File

@@ -67,6 +67,7 @@
#include "stackhandler.h"
#include "threadshandler.h"
#include "watchhandler.h"
#include "debuggersourcepathmappingwidget.h"
#ifdef Q_OS_WIN
# include "dbgwinutils.h"
@@ -214,6 +215,7 @@ GdbEngine::GdbEngine(const DebuggerStartParameters &startParameters,
m_stackNeeded = false;
m_preparedForQmlBreak = false;
m_disassembleUsesComma = false;
m_qFatalBreakpointNumber = 0;
invalidateSourcesList();
@@ -1245,7 +1247,8 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
if (bkptno && frame.isValid()
&& !isQmlStepBreakpoint1(bkptno)
&& !isQmlStepBreakpoint2(bkptno)) {
&& !isQmlStepBreakpoint2(bkptno)
&& !isQFatalBreakpoint(bkptno)) {
// Use opportunity to update the breakpoint marker position.
BreakHandler *handler = breakHandler();
//qDebug() << " PROBLEM: " << m_qmlBreakpointNumbers << bkptno
@@ -1267,7 +1270,8 @@ void GdbEngine::handleStopResponse(const GdbMi &data)
if (lineNumber && !debuggerCore()->boolSetting(OperateByInstruction)
&& QFileInfo(fullName).exists()
&& !isQmlStepBreakpoint1(bkptno)
&& !isQmlStepBreakpoint2(bkptno))
&& !isQmlStepBreakpoint2(bkptno)
&& !isQFatalBreakpoint(bkptno))
gotoLocation(Location(fullName, lineNumber));
if (!m_commandsToRunOnTemporaryBreak.isEmpty()) {
@@ -2437,6 +2441,8 @@ void GdbEngine::handleBreakList(const GdbMi &table)
needle.number = bkpt.findChild("number").data().toInt();
if (isQmlStepBreakpoint2(needle.number))
continue;
if (isQFatalBreakpoint(needle.number))
continue;
BreakpointId id = breakHandler()->findSimilarBreakpoint(needle);
if (id != BreakpointId(-1)) {
updateBreakpointDataFromOutput(id, bkpt);
@@ -4313,7 +4319,7 @@ static QString gdbBinary(const DebuggerStartParameters &sp)
if (abiMatch)
return sp.debuggerCommand;
}
// 3) Find one from toolchains.
// 3) Find one from tool chains.
return debuggerCore()->debuggerForAbi(sp.toolChainAbi, GdbEngineType);
}
@@ -4614,14 +4620,20 @@ void GdbEngine::notifyInferiorSetupFailed()
void GdbEngine::handleInferiorPrepared()
{
typedef GlobalDebuggerOptions::SourcePathMap SourcePathMap;
typedef SourcePathMap::const_iterator SourcePathMapIterator;
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
// Apply source path mappings from global options.
const QSharedPointer<GlobalDebuggerOptions> globalOptions = debuggerCore()->globalDebuggerOptions();
if (!globalOptions->sourcePathMap.isEmpty()) {
typedef GlobalDebuggerOptions::SourcePathMap::const_iterator SourcePathMapIterator;
const SourcePathMapIterator cend = globalOptions->sourcePathMap.constEnd();
for (SourcePathMapIterator it = globalOptions->sourcePathMap.constBegin(); it != cend; ++it) {
const SourcePathMap sourcePathMap =
DebuggerSourcePathMappingWidget::mergePlatformQtPath(
startParameters().qtInstallPath,
debuggerCore()->globalDebuggerOptions()->sourcePathMap);
if (!sourcePathMap.isEmpty()) {
const SourcePathMapIterator cend = sourcePathMap.constEnd();
for (SourcePathMapIterator it = sourcePathMap.constBegin(); it != cend; ++it) {
QByteArray command = "set substitute-path ";
command += it.key().toLocal8Bit();
command += ' ';
@@ -4648,6 +4660,52 @@ void GdbEngine::handleInferiorPrepared()
void GdbEngine::finishInferiorSetup()
{
QTC_ASSERT(state() == InferiorSetupRequested, qDebug() << state());
// Extract Qt namespace.
QString fileName;
{
QTemporaryFile symbols(QDir::tempPath() + _("/gdb_ns_"));
symbols.open();
fileName = symbols.fileName();
}
postCommand("maint print msymbols " + fileName.toLocal8Bit(),
CB(handleNamespaceExtraction), fileName);
}
void GdbEngine::handleNamespaceExtraction(const GdbResponse &response)
{
QFile file(response.cookie.toString());
file.open(QIODevice::ReadOnly);
QByteArray ba = file.readAll();
//file.remove();
int pos = ba.indexOf("7QString9fromAscii");
int pos1 = pos - 1;
while (pos1 > 0 && ba.at(pos1) != 'N' && ba.at(pos1) > '@')
--pos1;
++pos1;
const QByteArray ns = ba.mid(pos1, pos - pos1);
if (ns.isEmpty()) {
showMessage(_("FOUND NON-NAMESPACED QT"));
} else {
showMessage(_("FOUND NAMESPACED QT: " + ns));
setQtNamespace(ns + "::");
}
postCommand("-break-insert -f '" + qtNamespace() + "qFatal'",
CB(handleBreakOnQFatal));
}
void GdbEngine::handleBreakOnQFatal(const GdbResponse &response)
{
if (response.resultClass == GdbResultDone) {
GdbMi bkpt = response.data.findChild("bkpt");
GdbMi number = bkpt.findChild("number");
int bpnr = number.data().toInt();
if (bpnr) {
m_qFatalBreakpointNumber = bpnr;
postCommand("-break-commands " + number.data() + " return");
}
}
// Continue setup.
notifyInferiorSetupOk();
}
@@ -4678,7 +4736,10 @@ void GdbEngine::handleAdapterCrashed(const QString &msg)
// Don't bother with state transitions - this can happen in any state and
// the end result is always the same, so it makes little sense to find a
// "path" which does not assert.
notifyEngineSetupFailed();
if (state() == EngineSetupRequested)
notifyEngineSetupFailed();
else
notifyEngineIll();
// No point in being friendly here ...
gdbProc()->kill();
@@ -4781,6 +4842,11 @@ bool GdbEngine::isQmlStepBreakpoint2(int bpnr) const
return bpnr && m_qmlBreakpointNumbers[2] == bpnr;
}
bool GdbEngine::isQFatalBreakpoint(int bpnr) const
{
return bpnr && m_qFatalBreakpointNumber == bpnr;
}
//
// Factory
//

View File

@@ -137,6 +137,7 @@ private: ////////// Gdb Process Management //////////
void handleGdbExit(const GdbResponse &response);
void handleRemoteSetupDone(int gdbServerPort, int qmlPort);
void handleRemoteSetupFailed(const QString &message);
void handleNamespaceExtraction(const GdbResponse &response);
void handleAdapterStarted();
void defaultInferiorShutdown(const char *cmd);
@@ -432,6 +433,7 @@ private: ////////// View & Data Stuff //////////
//void handleFetchDisassemblerByMiRangeMixed(const GdbResponse &response);
//void handleFetchDisassemblerByMiRangePlain(const GdbResponse &response);
void handleDisassemblerCheck(const GdbResponse &response);
void handleBreakOnQFatal(const GdbResponse &response);
DisassemblerLines parseDisassembler(const GdbMi &data);
DisassemblerLines parseCliDisassembler(const GdbMi &lines);
DisassemblerLines parseMiDisassembler(const GdbMi &lines);
@@ -581,11 +583,13 @@ private: ////////// View & Data Stuff //////////
void handleSetQmlStepBreakpoint(const GdbResponse &response);
bool isQmlStepBreakpoint1(int bpnr) const;
bool isQmlStepBreakpoint2(int bpnr) const;
bool isQFatalBreakpoint(int bpnr) const;
// HACK:
StackFrame m_targetFrame;
QByteArray m_currentThread;
QString m_lastWinException;
int m_qFatalBreakpointNumber;
};
} // namespace Internal

View File

@@ -59,7 +59,7 @@ namespace Debugger {
namespace Internal {
ModulesWindow::ModulesWindow(QWidget *parent)
: QTreeView(parent), m_alwaysResizeColumnsToContents(false)
: QTreeView(parent)
{
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
setWindowTitle(tr("Modules"));
@@ -73,6 +73,9 @@ ModulesWindow::ModulesWindow(QWidget *parent)
SLOT(moduleActivated(QModelIndex)));
connect(act, SIGNAL(toggled(bool)),
SLOT(setAlternatingRowColorsHelper(bool)));
connect(debuggerCore()->action(AlwaysAdjustModulesColumnWidths),
SIGNAL(toggled(bool)),
SLOT(setAlwaysResizeColumnsToContents(bool)));
}
void ModulesWindow::moduleActivated(const QModelIndex &index)
@@ -165,10 +168,7 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addSeparator();
QAction *actAdjustColumnWidths =
menu.addAction(tr("Adjust Column Widths to Contents"));
QAction *actAlwaysAdjustColumnWidth =
menu.addAction(tr("Always Adjust Column Widths to Contents"));
actAlwaysAdjustColumnWidth->setCheckable(true);
actAlwaysAdjustColumnWidth->setChecked(m_alwaysResizeColumnsToContents);
menu.addAction(debuggerCore()->action(AlwaysAdjustModulesColumnWidths));
menu.addSeparator();
menu.addAction(debuggerCore()->action(SettingsDialog));
@@ -177,21 +177,19 @@ void ModulesWindow::contextMenuEvent(QContextMenuEvent *ev)
if (act == actUpdateModuleList)
engine->reloadModules();
else if (act == actAdjustColumnWidths)
resizeColumnsToContents();
else if (act == actAlwaysAdjustColumnWidth)
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
resizeColumnsToContents();
else if (act == actShowModuleSources)
engine->loadSymbols(name);
engine->loadSymbols(name);
else if (act == actLoadSymbolsForAllModules)
engine->loadAllSymbols();
engine->loadAllSymbols();
else if (act == actExamineAllModules)
engine->examineModules();
engine->examineModules();
else if (act == actLoadSymbolsForModule)
engine->loadSymbols(name);
engine->loadSymbols(name);
else if (act == actEditFile)
engine->gotoLocation(name);
engine->gotoLocation(name);
else if (act == actShowModuleSymbols)
engine->requestModuleSymbols(name);
engine->requestModuleSymbols(name);
else if (actShowDependencies && act == actShowDependencies)
QProcess::startDetached(QLatin1String("depends"), QStringList(fileName));
}
@@ -206,7 +204,6 @@ void ModulesWindow::resizeColumnsToContents()
void ModulesWindow::setAlwaysResizeColumnsToContents(bool on)
{
m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);

View File

@@ -55,8 +55,6 @@ private slots:
private:
void contextMenuEvent(QContextMenuEvent *ev);
void setModel(QAbstractItemModel *model);
bool m_alwaysResizeColumnsToContents;
};
} // namespace Internal

View File

@@ -577,6 +577,7 @@ void QmlCppEngine::slaveEngineStateChanged
notifyInferiorStopOk();
} else if (state() == EngineRunRequested) {
EDEBUG("... AN INFERIOR FAILED STARTUP, OTHER STOPPED EXPECTEDLY");
notifyEngineRunAndInferiorStopOk();
} else {
EDEBUG("... AN INFERIOR STOPPED SPONTANEOUSLY");
notifyInferiorSpontaneousStop();

View File

@@ -158,7 +158,7 @@ public:
///////////////////////////////////////////////////////////////////////
RegisterWindow::RegisterWindow(QWidget *parent)
: QTreeView(parent), m_alwaysResizeColumnsToContents(true)
: QTreeView(parent)
{
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
setFrameStyle(QFrame::NoFrame);
@@ -170,6 +170,9 @@ RegisterWindow::RegisterWindow(QWidget *parent)
connect(act, SIGNAL(toggled(bool)),
SLOT(setAlternatingRowColorsHelper(bool)));
connect(debuggerCore()->action(AlwaysAdjustRegistersColumnWidths),
SIGNAL(toggled(bool)),
SLOT(setAlwaysResizeColumnsToContents(bool)));
}
void RegisterWindow::resizeEvent(QResizeEvent *ev)
@@ -223,10 +226,7 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addSeparator();
QAction *actAdjust = menu.addAction(tr("Adjust Column Widths to Contents"));
QAction *actAlwaysAdjust =
menu.addAction(tr("Always Adjust Column Widths to Contents"));
actAlwaysAdjust->setCheckable(true);
actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents);
menu.addAction(debuggerCore()->action(AlwaysAdjustRegistersColumnWidths));
menu.addSeparator();
menu.addAction(debuggerCore()->action(SettingsDialog));
@@ -235,8 +235,6 @@ void RegisterWindow::contextMenuEvent(QContextMenuEvent *ev)
if (act == actAdjust)
resizeColumnsToContents();
else if (act == actAlwaysAdjust)
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
else if (act == actReload)
engine->reloadRegisters();
else if (act == actShowMemory)
@@ -259,7 +257,6 @@ void RegisterWindow::resizeColumnsToContents()
void RegisterWindow::setAlwaysResizeColumnsToContents(bool on)
{
m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);

View File

@@ -56,8 +56,6 @@ public slots:
private:
void resizeEvent(QResizeEvent *ev);
void contextMenuEvent(QContextMenuEvent *ev);
bool m_alwaysResizeColumnsToContents;
};
} // namespace Internal

View File

@@ -58,7 +58,6 @@ namespace Internal {
///////////////////////////////////////////////////////////////////////
SnapshotWindow::SnapshotWindow(SnapshotHandler *handler)
: m_alwaysResizeColumnsToContents(false)
{
m_snapshotHandler = handler;
@@ -76,6 +75,9 @@ SnapshotWindow::SnapshotWindow(SnapshotHandler *handler)
SLOT(rowActivated(QModelIndex)));
connect(act, SIGNAL(toggled(bool)),
SLOT(setAlternatingRowColorsHelper(bool)));
connect(debuggerCore()->action(AlwaysAdjustSnapshotsColumnWidths),
SIGNAL(toggled(bool)),
SLOT(setAlwaysResizeColumnsToContents(bool)));
}
void SnapshotWindow::rowActivated(const QModelIndex &index)
@@ -107,21 +109,14 @@ void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction *actCreate = menu.addAction(tr("Create Snapshot"));
actCreate->setEnabled(idx.data(SnapshotCapabilityRole).toBool());
menu.addSeparator();
QAction *actRemove = menu.addAction(tr("Remove Snapshot"));
actRemove->setEnabled(idx.isValid());
menu.addSeparator();
QAction *actAdjust = menu.addAction(tr("Adjust Column Widths to Contents"));
QAction *actAlwaysAdjust =
menu.addAction(tr("Always Adjust Column Widths to Contents"));
actAlwaysAdjust->setCheckable(true);
actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents);
menu.addAction(debuggerCore()->action(AlwaysAdjustSnapshotsColumnWidths));
menu.addSeparator();
menu.addAction(debuggerCore()->action(SettingsDialog));
@@ -134,8 +129,6 @@ void SnapshotWindow::contextMenuEvent(QContextMenuEvent *ev)
removeSnapshot(idx.row());
else if (act == actAdjust)
resizeColumnsToContents();
else if (act == actAlwaysAdjust)
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
}
void SnapshotWindow::removeSnapshot(int i)
@@ -151,7 +144,6 @@ void SnapshotWindow::resizeColumnsToContents()
void SnapshotWindow::setAlwaysResizeColumnsToContents(bool on)
{
m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode =
on ? QHeaderView::ResizeToContents : QHeaderView::Interactive;
for (int i = model()->columnCount(); --i >= 0; )

View File

@@ -61,7 +61,6 @@ private:
void keyPressEvent(QKeyEvent *ev);
void contextMenuEvent(QContextMenuEvent *ev);
bool m_alwaysResizeColumnsToContents;
SnapshotHandler *m_snapshotHandler;
};

View File

@@ -59,7 +59,7 @@ static DebuggerEngine *currentEngine()
}
StackWindow::StackWindow(QWidget *parent)
: QTreeView(parent), m_alwaysResizeColumnsToContents(false)
: QTreeView(parent)
{
setAttribute(Qt::WA_MacShowFocusRect, false);
setFrameStyle(QFrame::NoFrame);
@@ -83,6 +83,9 @@ StackWindow::StackWindow(QWidget *parent)
SLOT(reloadFullStack()));
connect(debuggerCore()->action(MaximalStackDepth), SIGNAL(triggered()),
SLOT(reloadFullStack()));
connect(debuggerCore()->action(AlwaysAdjustStackColumnWidths),
SIGNAL(triggered(bool)),
SLOT(setAlwaysResizeColumnsToContents(bool)));
showAddressColumn(false);
}
@@ -154,12 +157,7 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
menu.addAction(debuggerCore()->action(UseAddressInStackView));
QAction *actAdjust = menu.addAction(tr("Adjust Column Widths to Contents"));
QAction *actAlwaysAdjust =
menu.addAction(tr("Always Adjust Column Widths to Contents"));
actAlwaysAdjust->setCheckable(true);
actAlwaysAdjust->setChecked(m_alwaysResizeColumnsToContents);
menu.addAction(debuggerCore()->action(AlwaysAdjustStackColumnWidths));
menu.addSeparator();
menu.addAction(debuggerCore()->action(SettingsDialog));
@@ -172,8 +170,6 @@ void StackWindow::contextMenuEvent(QContextMenuEvent *ev)
copyContentsToClipboard();
else if (act == actAdjust)
resizeColumnsToContents();
else if (act == actAlwaysAdjust)
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
else if (act == actShowMemory)
engine->openMemoryView(address);
else if (act == actShowDisassembler)
@@ -215,7 +211,6 @@ void StackWindow::resizeColumnsToContents()
void StackWindow::setAlwaysResizeColumnsToContents(bool on)
{
m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode =
on ? QHeaderView::ResizeToContents : QHeaderView::Interactive;
for (int i = model()->columnCount(); --i >= 0; )

View File

@@ -60,8 +60,6 @@ private:
void setModel(QAbstractItemModel *model);
void contextMenuEvent(QContextMenuEvent *ev);
void copyContentsToClipboard();
bool m_alwaysResizeColumnsToContents;
};
} // namespace Internal

View File

@@ -87,7 +87,7 @@
<item row="3" column="0">
<widget class="QLabel" name="toolChainLabel">
<property name="text">
<string>&amp;ToolChain:</string>
<string>&amp;Tool chain:</string>
</property>
<property name="buddy">
<cstring>toolChainComboBox</cstring>

View File

@@ -50,7 +50,7 @@ namespace Debugger {
namespace Internal {
ThreadsWindow::ThreadsWindow(QWidget *parent)
: QTreeView(parent), m_alwaysResizeColumnsToContents(false)
: QTreeView(parent)
{
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
@@ -64,9 +64,12 @@ ThreadsWindow::ThreadsWindow(QWidget *parent)
header()->setDefaultAlignment(Qt::AlignLeft);
connect(this, SIGNAL(activated(QModelIndex)),
this, SLOT(rowActivated(QModelIndex)));
SLOT(rowActivated(QModelIndex)));
connect(act, SIGNAL(toggled(bool)),
this, SLOT(setAlternatingRowColorsHelper(bool)));
SLOT(setAlternatingRowColorsHelper(bool)));
connect(debuggerCore()->action(AlwaysAdjustThreadsColumnWidths),
SIGNAL(toggled(bool)),
SLOT(setAlwaysResizeColumnsToContents(bool)));
}
void ThreadsWindow::rowActivated(const QModelIndex &index)
@@ -87,10 +90,7 @@ void ThreadsWindow::contextMenuEvent(QContextMenuEvent *ev)
QMenu menu;
QAction *adjustColumnAction =
menu.addAction(tr("Adjust Column Widths to Contents"));
QAction *alwaysAdjustColumnAction =
menu.addAction(tr("Always Adjust Column Widths to Contents"));
alwaysAdjustColumnAction->setCheckable(true);
alwaysAdjustColumnAction->setChecked(m_alwaysResizeColumnsToContents);
menu.addAction(debuggerCore()->action(AlwaysAdjustThreadsColumnWidths));
menu.addSeparator();
menu.addAction(debuggerCore()->action(SettingsDialog));
@@ -99,11 +99,8 @@ void ThreadsWindow::contextMenuEvent(QContextMenuEvent *ev)
if (!act)
return;
if (act == adjustColumnAction) {
if (act == adjustColumnAction)
resizeColumnsToContents();
} else if (act == alwaysAdjustColumnAction) {
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
}
}
void ThreadsWindow::resizeColumnsToContents()
@@ -115,7 +112,6 @@ void ThreadsWindow::resizeColumnsToContents()
void ThreadsWindow::setAlwaysResizeColumnsToContents(bool on)
{
m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);

View File

@@ -57,8 +57,6 @@ private slots:
private:
void setModel(QAbstractItemModel *model);
void contextMenuEvent(QContextMenuEvent *ev);
bool m_alwaysResizeColumnsToContents;
};
} // namespace Internal

View File

@@ -682,6 +682,9 @@ QVariant WatchModel::data(const QModelIndex &idx, int role) const
case LocalsExpressionRole:
return QVariant(expression(item));
case LocalsRawExpressionRole:
return data.exp;
case LocalsINameRole:
return data.iname;

View File

@@ -147,16 +147,13 @@ private:
WatchWindow::WatchWindow(Type type, QWidget *parent)
: QTreeView(parent),
m_alwaysResizeColumnsToContents(true),
m_type(type)
{
m_grabbing = false;
QAction *act = debuggerCore()->action(UseAlternatingRowColors);
setFrameStyle(QFrame::NoFrame);
setAttribute(Qt::WA_MacShowFocusRect, false);
setWindowTitle(tr("Locals and Watchers"));
setAlternatingRowColors(act->isChecked());
setIndentation(indentation() * 9/10);
setUniformRowHeights(true);
setItemDelegate(new WatchDelegate(this));
@@ -164,12 +161,19 @@ WatchWindow::WatchWindow(Type type, QWidget *parent)
setAcceptDrops(true);
setDropIndicatorShown(true);
connect(act, SIGNAL(toggled(bool)),
this, SLOT(setAlternatingRowColorsHelper(bool)));
QAction *useColors = debuggerCore()->action(UseAlternatingRowColors);
setAlternatingRowColors(useColors->isChecked());
QAction *adjustColumns = debuggerCore()->action(AlwaysAdjustLocalsColumnWidths);
connect(useColors, SIGNAL(toggled(bool)),
SLOT(setAlternatingRowColorsHelper(bool)));
connect(adjustColumns, SIGNAL(triggered(bool)),
SLOT(setAlwaysResizeColumnsToContents(bool)));
connect(this, SIGNAL(expanded(QModelIndex)),
this, SLOT(expandNode(QModelIndex)));
SLOT(expandNode(QModelIndex)));
connect(this, SIGNAL(collapsed(QModelIndex)),
this, SLOT(collapseNode(QModelIndex)));
SLOT(collapseNode(QModelIndex)));
}
void WatchWindow::expandNode(const QModelIndex &idx)
@@ -187,7 +191,7 @@ void WatchWindow::keyPressEvent(QKeyEvent *ev)
if (ev->key() == Qt::Key_Delete && m_type == WatchersType) {
QModelIndex idx = currentIndex();
QModelIndex idx1 = idx.sibling(idx.row(), 0);
QString exp = idx1.data().toString();
QString exp = idx1.data(LocalsRawExpressionRole).toString();
removeWatchExpression(exp);
} else if (ev->key() == Qt::Key_Return
&& ev->modifiers() == Qt::ControlModifier
@@ -468,12 +472,9 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
QAction *actAdjustColumnWidths =
menu.addAction(tr("Adjust Column Widths to Contents"));
QAction *actAlwaysAdjustColumnWidth =
menu.addAction(tr("Always Adjust Column Widths to Contents"));
actAlwaysAdjustColumnWidth->setCheckable(true);
actAlwaysAdjustColumnWidth->setChecked(m_alwaysResizeColumnsToContents);
menu.addAction(debuggerCore()->action(AlwaysAdjustLocalsColumnWidths));
menu.addSeparator();
QAction *actClearCodeModelSnapshot
= new QAction(tr("Refresh Code Model Snapshot"), &menu);
actClearCodeModelSnapshot->setEnabled(actionsEnabled
@@ -495,8 +496,6 @@ void WatchWindow::contextMenuEvent(QContextMenuEvent *ev)
if (act == actAdjustColumnWidths) {
resizeColumnsToContents();
} else if (act == actAlwaysAdjustColumnWidth) {
setAlwaysResizeColumnsToContents(!m_alwaysResizeColumnsToContents);
} else if (act == actInsertNewWatchItem) {
watchExpression(QString());
} else if (act == actOpenMemoryEditAtVariableAddress) {
@@ -566,7 +565,6 @@ void WatchWindow::setAlwaysResizeColumnsToContents(bool on)
{
if (!header())
return;
m_alwaysResizeColumnsToContents = on;
QHeaderView::ResizeMode mode = on
? QHeaderView::ResizeToContents : QHeaderView::Interactive;
header()->setResizeMode(0, mode);
@@ -594,10 +592,13 @@ void WatchWindow::setModel(QAbstractItemModel *model)
QTreeView::setModel(model);
setRootIsDecorated(true);
header()->setDefaultAlignment(Qt::AlignLeft);
header()->setResizeMode(QHeaderView::ResizeToContents);
if (m_type != LocalsType)
header()->hide();
if (header()) {
setAlwaysResizeColumnsToContents(
debuggerCore()->boolSetting(AlwaysAdjustLocalsColumnWidths));
header()->setDefaultAlignment(Qt::AlignLeft);
if (m_type != LocalsType)
header()->hide();
}
connect(model, SIGNAL(layoutChanged()), SLOT(resetHelper()));
connect(model, SIGNAL(enableUpdates(bool)), SLOT(setUpdatesEnabled(bool)));

View File

@@ -57,7 +57,6 @@ public:
public slots:
void resizeColumnsToContents();
void setAlwaysResizeColumnsToContents(bool on = true);
void setModel(QAbstractItemModel *model);
void setAlternatingRowColorsHelper(bool on) { setAlternatingRowColors(on); }
void watchExpression(const QString &exp);
@@ -68,6 +67,7 @@ private:
Q_SLOT void expandNode(const QModelIndex &idx);
Q_SLOT void collapseNode(const QModelIndex &idx);
Q_SLOT void setUpdatesEnabled(bool enable);
Q_SLOT void setAlwaysResizeColumnsToContents(bool on);
void keyPressEvent(QKeyEvent *ev);
void contextMenuEvent(QContextMenuEvent *ev);
@@ -84,7 +84,6 @@ private:
void setModelData(int role, const QVariant &value = QVariant(),
const QModelIndex &index = QModelIndex());
bool m_alwaysResizeColumnsToContents;
Type m_type;
bool m_grabbing;
};

View File

@@ -277,21 +277,7 @@ bool FakeVimOptionPage::matches(const QString &s) const
//
///////////////////////////////////////////////////////////////////////
struct CommandItem
{
Command *m_cmd;
QString m_regex;
QTreeWidgetItem *m_item;
};
} // namespace Internal
} // namespace FakeVim
Q_DECLARE_METATYPE(FakeVim::Internal::CommandItem *)
namespace FakeVim {
namespace Internal {
enum { CommandRole = Qt::UserRole };
class FakeVimExCommandsPage : public Core::CommandMappings
{
@@ -299,7 +285,7 @@ class FakeVimExCommandsPage : public Core::CommandMappings
public:
FakeVimExCommandsPage(FakeVimPluginPrivate *q) : m_q(q) {}
~FakeVimExCommandsPage() { qDeleteAll(m_citems); }
~FakeVimExCommandsPage() {}
// IOptionsPage
QString id() const { return _(Constants::SETTINGS_EX_CMDS_ID); }
@@ -321,8 +307,7 @@ public slots:
void defaultAction();
private:
void setRegex(const QString &regex);
QList<CommandItem *> m_citems;
//QList<QTreeWidgetItem *> m_citems;
FakeVimPluginPrivate *m_q;
};
@@ -350,11 +335,9 @@ void FakeVimExCommandsPage::initialize()
if (c->action() && c->action()->isSeparator())
continue;
CommandItem *ci = new CommandItem;
QTreeWidgetItem *item = new QTreeWidgetItem;
ci->m_cmd = c;
ci->m_item = item;
m_citems.append(ci);
item->setData(0, CommandRole, int(c->id()));
//m_citems.append(item);
const QString name = uidm->stringForUniqueIdentifier(c->id());
const int pos = name.indexOf(QLatin1Char('.'));
@@ -383,16 +366,13 @@ void FakeVimExCommandsPage::initialize()
} else {
item->setText(1, c->shortcut()->whatsThis());
}
if (exCommandMap().contains(name)) {
ci->m_regex = exCommandMap()[name].pattern();
} else {
ci->m_regex.clear();
}
item->setText(2, ci->m_regex);
item->setData(0, Qt::UserRole, qVariantFromValue(ci));
QString regex;
if (exCommandMap().contains(name))
regex = exCommandMap()[name].pattern();
item->setText(2, regex);
if (ci->m_regex != defaultExCommandMap()[name].pattern())
if (regex != defaultExCommandMap()[name].pattern())
setModified(item, true);
}
@@ -402,12 +382,8 @@ void FakeVimExCommandsPage::initialize()
void FakeVimExCommandsPage::commandChanged(QTreeWidgetItem *current)
{
CommandMappings::commandChanged(current);
if (!current || !current->data(0, Qt::UserRole).isValid())
return;
CommandItem *citem = qVariantValue<CommandItem *>(current->data(0, Qt::UserRole));
targetEdit()->setText(citem->m_regex);
if (current)
targetEdit()->setText(current->text(2));
}
void FakeVimExCommandsPage::targetIdentifierChanged()
@@ -417,39 +393,34 @@ void FakeVimExCommandsPage::targetIdentifierChanged()
return;
UniqueIDManager *uidm = UniqueIDManager::instance();
CommandItem *citem = qVariantValue<CommandItem *>(current->data(0, Qt::UserRole));
const QString name = uidm->stringForUniqueIdentifier(citem->m_cmd->id());
int id = current->data(0, CommandRole).toInt();
const QString name = uidm->stringForUniqueIdentifier(id);
const QString regex = targetEdit()->text();
if (current->data(0, Qt::UserRole).isValid()) {
citem->m_regex = targetEdit()->text();
current->setText(2, citem->m_regex);
exCommandMap()[name] = QRegExp(citem->m_regex);
current->setText(2, regex);
exCommandMap()[name] = QRegExp(regex);
}
if (citem->m_regex != defaultExCommandMap()[name].pattern())
if (regex != defaultExCommandMap()[name].pattern())
setModified(current, true);
else
setModified(current, false);
}
void FakeVimExCommandsPage::setRegex(const QString &regex)
{
targetEdit()->setText(regex);
}
void FakeVimExCommandsPage::resetTargetIdentifier()
{
UniqueIDManager *uidm = UniqueIDManager::instance();
QTreeWidgetItem *current = commandList()->currentItem();
if (current && current->data(0, Qt::UserRole).isValid()) {
CommandItem *citem = qVariantValue<CommandItem *>(current->data(0, Qt::UserRole));
const QString &name = uidm->stringForUniqueIdentifier(citem->m_cmd->id());
if (defaultExCommandMap().contains(name))
setRegex(defaultExCommandMap()[name].pattern());
else
setRegex(QString());
}
if (!current)
return;
UniqueIDManager *uidm = UniqueIDManager::instance();
int id = current->data(0, CommandRole).toInt();
const QString name = uidm->stringForUniqueIdentifier(id);
QString regex;
if (defaultExCommandMap().contains(name))
regex = defaultExCommandMap()[name].pattern();
targetEdit()->setText(regex);
}
void FakeVimExCommandsPage::removeTargetIdentifier()
@@ -460,17 +431,22 @@ void FakeVimExCommandsPage::removeTargetIdentifier()
void FakeVimExCommandsPage::defaultAction()
{
UniqueIDManager *uidm = UniqueIDManager::instance();
foreach (CommandItem *item, m_citems) {
const QString &name = uidm->stringForUniqueIdentifier(item->m_cmd->id());
if (defaultExCommandMap().contains(name)) {
item->m_regex = defaultExCommandMap()[name].pattern();
} else {
item->m_regex.clear();
int n = commandList()->topLevelItemCount();
for (int i = 0; i != n; ++i) {
QTreeWidgetItem *section = commandList()->topLevelItem(i);
int m = section->childCount();
for (int j = 0; j != m; ++j) {
QTreeWidgetItem *item = section->child(j);
const int id = item->data(0, CommandRole).toInt();
const QString name = uidm->stringForUniqueIdentifier(id);
QString regex;
if (defaultExCommandMap().contains(name))
regex = defaultExCommandMap()[name].pattern();
setModified(item, false);
item->setText(2, regex);
if (item == commandList()->currentItem())
commandChanged(item);
}
setModified(item->m_item, false);
item->m_item->setText(2, item->m_regex);
if (item->m_item == commandList()->currentItem())
commandChanged(item->m_item);
}
}

View File

@@ -516,7 +516,7 @@ void GenericBuildSettingsWidget::updateToolChainList()
QList<ToolChain *> tcs = ToolChainManager::instance()->toolChains();
if (!m_target->genericProject()->toolChain()) {
m_toolChainChooser->addItem(tr("<Invalid Toolchain>"), qVariantFromValue(static_cast<void *>(0)));
m_toolChainChooser->addItem(tr("<Invalid tool chain>"), qVariantFromValue(static_cast<void *>(0)));
m_toolChainChooser->setCurrentIndex(0);
}
foreach (ToolChain *tc, tcs) {

View File

@@ -124,9 +124,9 @@ void ImageViewerActionHandler::createActions()
d_ptr->context, QKeySequence(tr("Ctrl+0")));
registerNewAction(FitToScreen, Constants::ACTION_FIT_TO_SCREEN, tr("Fit To Screen"),
d_ptr->context, QKeySequence(tr("Ctrl+=")));
registerNewAction(Background, Constants::ACTION_BACKGROUND, tr("Switch background"),
registerNewAction(Background, Constants::ACTION_BACKGROUND, tr("Switch Background"),
d_ptr->context, QKeySequence(tr("Ctrl+[")));
registerNewAction(Outline, Constants::ACTION_OUTLINE, tr("Switch outline"),
registerNewAction(Outline, Constants::ACTION_OUTLINE, tr("Switch Outline"),
d_ptr->context, QKeySequence(tr("Ctrl+]")));
}

View File

@@ -93,10 +93,24 @@ static QList<Abi> parseCoffHeader(const QByteArray &data)
if (data.size() >= 68) {
// Get Major and Minor Image Version from optional header fields
quint32 image = (data.at(67) << 24) + (data.at(66) << 16) + (data.at(65) << 8) + data.at(64);
if (image == 1) // Image is 1 for mingw and higher for MSVC (4.something in some encoding)
if (image == 1) { // Image is 1 for mingw and higher for MSVC (4.something in some encoding)
flavor = Abi::WindowsMSysFlavor;
else
flavor = Abi::WindowsMsvcFlavor;
} else {
switch (data.at(22)) {
case 8:
flavor = Abi::WindowsMsvc2005Flavor;
break;
case 9:
flavor = Abi::WindowsMsvc2008Flavor;
break;
case 10:
flavor = Abi::WindowsMsvc2010Flavor;
break;
default:
// Keep unknown flavor
break;
}
}
}
if (arch != Abi::UnknownArchitecture && width != 0)
@@ -196,7 +210,7 @@ Abi::Abi(const Architecture &a, const OS &o,
m_osFlavor = UnknownFlavor;
break;
case ProjectExplorer::Abi::WindowsOS:
if (m_osFlavor < WindowsMsvcFlavor || m_osFlavor > WindowsCEFlavor)
if (m_osFlavor < WindowsMsvc2005Flavor || m_osFlavor > WindowsCEFlavor)
m_osFlavor = UnknownFlavor;
break;
}
@@ -258,8 +272,12 @@ Abi::Abi(const QString &abiString) :
m_osFlavor = SymbianEmulatorFlavor;
else if (abiParts.at(2) == QLatin1String("generic") && m_os == UnixOS)
m_osFlavor = GenericUnixFlavor;
else if (abiParts.at(2) == QLatin1String("msvc") && m_os == WindowsOS)
m_osFlavor = WindowsMsvcFlavor;
else if (abiParts.at(2) == QLatin1String("msvc2005") && m_os == WindowsOS)
m_osFlavor = WindowsMsvc2005Flavor;
else if (abiParts.at(2) == QLatin1String("msvc2008") && m_os == WindowsOS)
m_osFlavor = WindowsMsvc2008Flavor;
else if (abiParts.at(2) == QLatin1String("msvc2010") && m_os == WindowsOS)
m_osFlavor = WindowsMsvc2010Flavor;
else if (abiParts.at(2) == QLatin1String("msys") && m_os == WindowsOS)
m_osFlavor = WindowsMSysFlavor;
else if (abiParts.at(2) == QLatin1String("ce") && m_os == WindowsOS)
@@ -399,8 +417,12 @@ QString Abi::toString(const OSFlavor &of)
return QLatin1String("emulator");
case ProjectExplorer::Abi::GenericUnixFlavor:
return QLatin1String("generic");
case ProjectExplorer::Abi::WindowsMsvcFlavor:
return QLatin1String("msvc");
case ProjectExplorer::Abi::WindowsMsvc2005Flavor:
return QLatin1String("msvc2005");
case ProjectExplorer::Abi::WindowsMsvc2008Flavor:
return QLatin1String("msvc2008");
case ProjectExplorer::Abi::WindowsMsvc2010Flavor:
return QLatin1String("msvc2010");
case ProjectExplorer::Abi::WindowsMSysFlavor:
return QLatin1String("msys");
case ProjectExplorer::Abi::WindowsCEFlavor:
@@ -445,7 +467,15 @@ Abi Abi::hostAbi()
#if defined (Q_OS_WIN)
os = WindowsOS;
subos = WindowsMsvcFlavor;
#if _MSC_VER == 1600
subos = WindowsMsvc2010Flavor;
#elif _MSC_VER == 1500
subos = WindowsMsvc2008Flavor;
#elif _MSC_VER == 1400
subos = WindowsMsvc2005Flavor;
#elif defined (mingw32)
subos = WindowsMSysFlavor;
#endif
format = PEFormat;
#elif defined (Q_OS_LINUX)
os = LinuxOS;

View File

@@ -85,7 +85,9 @@ public:
GenericUnixFlavor,
// Windows
WindowsMsvcFlavor,
WindowsMsvc2005Flavor,
WindowsMsvc2008Flavor,
WindowsMsvc2010Flavor,
WindowsMSysFlavor,
WindowsCEFlavor
};

View File

@@ -84,7 +84,7 @@ public:
virtual QVariantMap toMap() const;
// Creates a suitable outputparser for custom build steps
// (based on the toolchain)
// (based on the tool chain)
// TODO this is not great API
// it's mainly so that custom build systems are better integrated
// with the generic project manager

View File

@@ -477,7 +477,7 @@ QList<ToolChain *> Internal::GccToolChainFactory::autoDetect()
return autoDetectToolchains(QLatin1String("g++"), debuggers, Abi::hostAbi());
}
// Used by the ToolChainManager to restore user-generated ToolChains
// Used by the ToolChainManager to restore user-generated tool chains
bool Internal::GccToolChainFactory::canRestore(const QVariantMap &data)
{
return idFromMap(data).startsWith(QLatin1String(Constants::GCC_TOOLCHAIN_ID) + QLatin1Char(':'));
@@ -672,7 +672,9 @@ QString Internal::MingwToolChainFactory::id() const
QList<ToolChain *> Internal::MingwToolChainFactory::autoDetect()
{
return autoDetectToolchains(QLatin1String("gcc"), QStringList(), Abi::hostAbi());
Abi ha = Abi::hostAbi();
return autoDetectToolchains(QLatin1String("g++"), QStringList(),
Abi(ha.architecture(), Abi::WindowsOS, Abi::WindowsMSysFlavor, Abi::PEFormat, ha.wordWidth()));
}
bool Internal::MingwToolChainFactory::canCreate()

View File

@@ -58,7 +58,7 @@ class GccToolChainFactory : public ToolChainFactory
Q_OBJECT
public:
// Name used to display the name of the toolchain that will be created.
// Name used to display the name of the tool chain that will be created.
QString displayName() const;
QString id() const;
@@ -67,7 +67,7 @@ public:
bool canCreate();
ToolChain *create();
// Used by the ToolChainManager to restore user-generated ToolChains
// Used by the ToolChainManager to restore user-generated tool chains
bool canRestore(const QVariantMap &data);
ToolChain *restore(const QVariantMap &data);
@@ -115,7 +115,7 @@ class MingwToolChainFactory : public GccToolChainFactory
Q_OBJECT
public:
// Name used to display the name of the toolchain that will be created.
// Name used to display the name of the tool chain that will be created.
QString displayName() const;
QString id() const;
@@ -124,7 +124,7 @@ public:
bool canCreate();
ToolChain *create();
// Used by the ToolChainManager to restore user-generated ToolChains
// Used by the ToolChainManager to restore user-generated tool chains
bool canRestore(const QVariantMap &data);
ToolChain *restore(const QVariantMap &data);
@@ -141,7 +141,7 @@ class LinuxIccToolChainFactory : public GccToolChainFactory
Q_OBJECT
public:
// Name used to display the name of the toolchain that will be created.
// Name used to display the name of the tool chain that will be created.
QString displayName() const;
QString id() const;
@@ -149,7 +149,7 @@ public:
ToolChain *create();
// Used by the ToolChainManager to restore user-generated ToolChains
// Used by the ToolChainManager to restore user-generated tool chains
bool canRestore(const QVariantMap &data);
ToolChain *restore(const QVariantMap &data);

View File

@@ -82,6 +82,44 @@ static QString platformName(MsvcToolChain::Platform t)
return QString();
}
static Abi findAbiOfMsvc(MsvcToolChain::Type type, MsvcToolChain::Platform platform, const QString &version)
{
Abi::Architecture arch = Abi::X86Architecture;
Abi::OSFlavor flavor = Abi::UnknownFlavor;
int wordWidth = 64;
switch (platform)
{
case ProjectExplorer::Internal::MsvcToolChain::s32:
wordWidth = 32;
break;
case ProjectExplorer::Internal::MsvcToolChain::ia64:
arch = Abi::ItaniumArchitecture;
break;
case ProjectExplorer::Internal::MsvcToolChain::s64:
case ProjectExplorer::Internal::MsvcToolChain::amd64:
break;
};
QString msvcVersionString = version;
if (type == MsvcToolChain::WindowsSDK) {
if (version.startsWith("7."))
msvcVersionString = "10.0";
else if (version.startsWith("6.1"))
msvcVersionString = "9.0";
else
msvcVersionString = "8.0";
}
if (msvcVersionString.startsWith("10."))
flavor = Abi::WindowsMsvc2010Flavor;
else if (msvcVersionString.startsWith("9."))
flavor = Abi::WindowsMsvc2008Flavor;
else
flavor = Abi::WindowsMsvc2005Flavor;
return Abi(arch, Abi::WindowsOS, flavor, Abi::PEFormat, wordWidth);
}
static QString generateDisplayName(const QString &name,
MsvcToolChain::Type t,
MsvcToolChain::Platform p)
@@ -309,36 +347,25 @@ static Utils::Environment msvcReadEnvironmentSetting(const QString &varsBat,
// MsvcToolChain
// --------------------------------------------------------------------------
MsvcToolChain::MsvcToolChain(Type type, const QString &name, Platform platform,
MsvcToolChain::MsvcToolChain(const QString &name, const Abi &abi,
const QString &varsBat, const QString &varsBatArg, bool autodetect) :
ToolChain(QLatin1String(Constants::MSVC_TOOLCHAIN_ID), autodetect),
m_varsBat(varsBat),
m_varsBatArg(varsBatArg),
m_lastEnvironment(Utils::Environment::systemEnvironment()),
m_is64bit(true),
m_architecture(Abi::X86Architecture)
m_abi(abi)
{
Q_ASSERT(!name.isEmpty());
Q_ASSERT(!m_varsBat.isEmpty());
Q_ASSERT(QFileInfo(m_varsBat).exists());
switch (platform)
{
case ProjectExplorer::Internal::MsvcToolChain::s32:
m_is64bit = false;
break;
case ProjectExplorer::Internal::MsvcToolChain::ia64:
m_architecture = Abi::ItaniumArchitecture;
break;
case ProjectExplorer::Internal::MsvcToolChain::s64:
case ProjectExplorer::Internal::MsvcToolChain::amd64:
break;
};
Q_ASSERT(abi.os() == Abi::WindowsOS);
Q_ASSERT(abi.binaryFormat() == Abi::PEFormat);
Q_ASSERT(abi.osFlavor() != Abi::WindowsMSysFlavor);
setId(QString::fromLatin1("%1:%2.%3").arg(Constants::MSVC_TOOLCHAIN_ID).arg(m_varsBat)
.arg(m_varsBatArg));
setDisplayName(generateDisplayName(name, type, platform));
setDisplayName(name);
}
QString MsvcToolChain::typeName() const
@@ -348,7 +375,7 @@ QString MsvcToolChain::typeName() const
Abi MsvcToolChain::targetAbi() const
{
return Abi(m_architecture, Abi::WindowsOS, Abi::WindowsMsvcFlavor, Abi::PEFormat, m_is64bit ? 64 : 32);
return m_abi;
}
bool MsvcToolChain::isValid() const
@@ -566,6 +593,7 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect()
if (!defaultSdkPath.isEmpty()) {
foreach (const QString &sdkKey, sdkRegistry.childGroups()) {
const QString name = sdkRegistry.value(sdkKey + QLatin1String("/ProductName")).toString();
const QString version = sdkRegistry.value(sdkKey + QLatin1String("/ProductVersion")).toString();
const QString folder = sdkRegistry.value(sdkKey + QLatin1String("/InstallationFolder")).toString();
if (folder.isEmpty())
continue;
@@ -574,13 +602,17 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect()
if (!QFileInfo(sdkVcVarsBat).exists())
continue;
QList<ToolChain *> tmp;
tmp.append(new MsvcToolChain(MsvcToolChain::WindowsSDK, name,MsvcToolChain::s32,
tmp.append(new MsvcToolChain(generateDisplayName(name, MsvcToolChain::WindowsSDK, MsvcToolChain::s32),
findAbiOfMsvc(MsvcToolChain::WindowsSDK, MsvcToolChain::s32, version),
sdkVcVarsBat, QLatin1String("/x86"), true));
#ifdef Q_OS_WIN64
// Add all platforms
tmp.append(new MsvcToolChain(MsvcToolChain::WindowsSDK, name, MsvcToolChain::s64,
tmp.append(new MsvcToolChain(generateDisplayName(name, MsvcToolChain::WindowsSDK, MsvcToolChain::s64),
findAbiOfMsvc(MsvcToolChain::WindowsSDK, MsvcToolChain::s64, version),
sdkVcVarsBat, QLatin1String("/x64"), true));
tmp.append(new MsvcToolChain(MsvcToolChain::WindowsSDK, name, MsvcToolChain::ia64,
tmp.append(new MsvcToolChain(generateDisplayName(name, MsvcToolChain::WindowsSDK, MsvcToolChain::ia64),
findAbiOfMsvc(MsvcToolChain::WindowsSDK, MsvcToolChain::ia64, version),
sdkVcVarsBat, QLatin1String("/ia64"), true));
#endif
// Make sure the default is front.
@@ -610,19 +642,24 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect()
// Check existence of various install scripts
const QString vcvars32bat = path + QLatin1String("bin\\vcvars32.bat");
if (QFileInfo(vcvars32bat).isFile())
results.append(new MsvcToolChain(MsvcToolChain::VS, vsName, MsvcToolChain::s32,
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::s32),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::s32, vsName),
vcvars32bat, QString(), true));
if (version >= 10) {
// Just one common file
const QString vcvarsAllbat = path + QLatin1String("vcvarsall.bat");
if (QFileInfo(vcvarsAllbat).isFile()) {
results.append(new MsvcToolChain(MsvcToolChain::VS, vsName, MsvcToolChain::s32,
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::s32),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::s32, vsName),
vcvarsAllbat, QLatin1String("x86"), true));
results.append(new MsvcToolChain(MsvcToolChain::VS, vsName, MsvcToolChain::amd64,
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::amd64),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::amd64, vsName),
vcvarsAllbat, QLatin1String("amd64"), true));
results.append(new MsvcToolChain(MsvcToolChain::VS, vsName, MsvcToolChain::s64,
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::s64),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::s64, vsName),
vcvarsAllbat, QLatin1String("x64"), true));
results.append(new MsvcToolChain(MsvcToolChain::VS, vsName, MsvcToolChain::ia64,
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::ia64),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::ia64, vsName),
vcvarsAllbat, QLatin1String("ia64"), true));
} else {
qWarning("Unable to find MSVC setup script %s in version %d", qPrintable(vcvarsAllbat), version);
@@ -631,19 +668,23 @@ QList<ToolChain *> MsvcToolChainFactory::autoDetect()
// Amd 64 is the preferred 64bit platform
const QString vcvarsAmd64bat = path + QLatin1String("bin\\amd64\\vcvarsamd64.bat");
if (QFileInfo(vcvarsAmd64bat).isFile())
results.append(new MsvcToolChain(MsvcToolChain::VS, vsName, MsvcToolChain::amd64,
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::amd64),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::amd64, vsName),
vcvarsAmd64bat, QString(), true));
const QString vcvarsAmd64bat2 = path + QLatin1String("bin\\vcvarsx86_amd64.bat");
if (QFileInfo(vcvarsAmd64bat2).isFile())
results.append(new MsvcToolChain(MsvcToolChain::VS, vsName, MsvcToolChain::amd64,
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::amd64),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::amd64, vsName),
vcvarsAmd64bat2, QString(), true));
const QString vcvars64bat = path + QLatin1String("bin\\vcvars64.bat");
if (QFileInfo(vcvars64bat).isFile())
results.append(new MsvcToolChain(MsvcToolChain::VS, vsName, MsvcToolChain::s64,
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::s64),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::s64, vsName),
vcvars64bat, QString(), true));
const QString vcvarsIA64bat = path + QLatin1String("bin\\vcvarsx86_ia64.bat");
if (QFileInfo(vcvarsIA64bat).isFile())
results.append(new MsvcToolChain(MsvcToolChain::VS, vsName, MsvcToolChain::ia64,
results.append(new MsvcToolChain(generateDisplayName(vsName, MsvcToolChain::VS, MsvcToolChain::ia64),
findAbiOfMsvc(MsvcToolChain::VS, MsvcToolChain::ia64, vsName),
vcvarsIA64bat, QString(), true));
}
}

View File

@@ -55,8 +55,8 @@ public:
enum Type { WindowsSDK, VS };
enum Platform { s32, s64, ia64, amd64 };
MsvcToolChain(Type type, const QString &name, Platform platform, const QString &varsBat,
const QString &varsBatArg, bool autodetect = false);
MsvcToolChain(const QString &name, const Abi &abi,
const QString &varsBat, const QString &varsBatArg, bool autodetect = false);
QString typeName() const;
Abi targetAbi() const;
@@ -89,8 +89,7 @@ private:
mutable Utils::Environment m_lastEnvironment; // Last checked 'incoming' environment.
mutable Utils::Environment m_resultEnvironment; // Resulting environment for VC
mutable QList<HeaderPath> m_headerPaths;
bool m_is64bit;
Abi::Architecture m_architecture;
Abi m_abi;
};
// --------------------------------------------------------------------------

View File

@@ -1749,25 +1749,25 @@ void ProjectExplorerPlugin::deploySession()
void ProjectExplorerPlugin::cleanProjectOnly()
{
queue(QList<Project *>() << session()->startupProject(),
QStringList() << Constants::BUILDSTEPS_CLEAN << Constants::BUILDSTEPS_CLEAN);
QStringList() << Constants::BUILDSTEPS_CLEAN);
}
void ProjectExplorerPlugin::cleanProject()
{
queue(d->m_session->projectOrder(session()->startupProject()),
QStringList() << Constants::BUILDSTEPS_CLEAN << Constants::BUILDSTEPS_CLEAN);
QStringList() << Constants::BUILDSTEPS_CLEAN);
}
void ProjectExplorerPlugin::cleanProjectContextMenu()
{
queue(d->m_session->projectOrder(d->m_currentProject),
QStringList() << Constants::BUILDSTEPS_CLEAN << Constants::BUILDSTEPS_CLEAN);
QStringList() << Constants::BUILDSTEPS_CLEAN);
}
void ProjectExplorerPlugin::cleanSession()
{
queue(d->m_session->projectOrder(),
QStringList() << Constants::BUILDSTEPS_CLEAN << Constants::BUILDSTEPS_CLEAN);
QStringList() << Constants::BUILDSTEPS_CLEAN);
}
void ProjectExplorerPlugin::runProject()
@@ -2268,8 +2268,13 @@ void ProjectExplorerPlugin::addExistingFiles()
void ProjectExplorerPlugin::addExistingFiles(const QStringList &filePaths)
{
ProjectNode *projectNode = qobject_cast<ProjectNode*>(d->m_currentNode->projectNode());
addExistingFiles(projectNode, filePaths);
}
void ProjectExplorerPlugin::addExistingFiles(ProjectNode *projectNode, const QStringList &filePaths)
{
Core::ICore *core = Core::ICore::instance();
const QString dir = directoryFor(d->m_currentNode);
const QString dir = directoryFor(projectNode);
QStringList fileNames = filePaths;
QHash<FileType, QString> fileTypeToFiles;
foreach (const QString &fileName, fileNames) {

View File

@@ -61,6 +61,7 @@ class IRunControlFactory;
class Project;
class Node;
class BuildConfiguration;
class ProjectNode;
namespace Internal {
class ProjectFileFactory;
@@ -120,6 +121,7 @@ public:
void runProject(Project *pro, const QString &mode);
void runRunConfiguration(ProjectExplorer::RunConfiguration *rc, const QString &mode);
void addExistingFiles(ProjectExplorer::ProjectNode *projectNode, const QStringList &filePaths);
void addExistingFiles(const QStringList &filePaths);
signals:

View File

@@ -77,7 +77,7 @@ public:
virtual bool isValid() const = 0;
/// Returns a list of target ids that this ToolChain is restricted to.
/// Returns a list of target ids that this tool chain is restricted to.
/// An empty list is shows that the toolchain is compatible with all targets.
virtual QStringList restrictedToTargets() const;
@@ -96,7 +96,7 @@ public:
virtual bool canClone() const;
virtual ToolChain *clone() const = 0;
// Used by the toolchainmanager to save user-generated ToolChains.
// Used by the toolchainmanager to save user-generated tool chains.
// Make sure to call this method when deriving!
virtual QVariantMap toMap() const;
@@ -127,7 +127,7 @@ class PROJECTEXPLORER_EXPORT ToolChainFactory : public QObject
Q_OBJECT
public:
// Name used to display the name of the toolchain that will be created.
// Name used to display the name of the tool chain that will be created.
virtual QString displayName() const = 0;
virtual QString id() const = 0;
@@ -136,7 +136,7 @@ public:
virtual bool canCreate();
virtual ToolChain *create();
// Used by the ToolChainManager to restore user-generated ToolChains
// Used by the ToolChainManager to restore user-generated tool chains
virtual bool canRestore(const QVariantMap &data);
virtual ToolChain *restore(const QVariantMap &data);

View File

@@ -98,7 +98,7 @@ void ToolChainManager::restoreToolChains()
{
ExtensionSystem::PluginManager *pm = ExtensionSystem::PluginManager::instance();
QList<ToolChainFactory *> factories = pm->getObjects<ToolChainFactory>();
// Autodetect ToolChains:
// Autodetect tool chains:
foreach (ToolChainFactory *f, factories) {
QList<ToolChain *> tcs = f->autoDetect();
foreach (ToolChain *tc, tcs)
@@ -112,7 +112,7 @@ void ToolChainManager::restoreToolChains()
ToolChainManager::~ToolChainManager()
{
// Deregister toolchains
// Deregister tool chains
QList<ToolChain *> copy = m_d->m_toolChains;
foreach (ToolChain *tc, copy)
deregisterToolChain(tc);
@@ -176,7 +176,7 @@ void ToolChainManager::restoreToolChains(const QString &fileName, bool autoDetec
}
}
if (!restored)
qWarning("Warning: Unable to restore manual toolchain '%s' stored in %s.",
qWarning("Warning: Unable to restore manual tool chain '%s' stored in %s.",
qPrintable(ToolChainFactory::idFromMap(tcMap)),
qPrintable(QDir::toNativeSeparators(fileName)));
}

View File

@@ -76,14 +76,14 @@ public slots:
signals:
void toolChainAdded(ProjectExplorer::ToolChain *);
// ToolChain is still valid when this call happens!
// Tool chain is still valid when this call happens!
void toolChainRemoved(ProjectExplorer::ToolChain *);
private:
explicit ToolChainManager(QObject *parent = 0);
// Make sure the this is only called after all
// ToolChain Factories are registered!
// Tool chain Factories are registered!
void restoreToolChains();
void restoreToolChains(const QString &fileName, bool autoDetected = false);

View File

@@ -74,7 +74,7 @@ public:
parent->childNodes.removeOne(this);
qDeleteAll(childNodes);
// Do not delete toolchain, we do not own it.
// Do not delete tool chain, we do not own it.
Q_ASSERT(childNodes.isEmpty());
}
@@ -280,7 +280,7 @@ void ToolChainModel::setDirty(ToolChain *tc)
void ToolChainModel::apply()
{
// Remove unused ToolChains:
// Remove unused tool chains:
QList<ToolChainNode *> nodes = m_toRemoveList;
foreach (ToolChainNode *n, nodes) {
Q_ASSERT(!n->parent);
@@ -288,7 +288,7 @@ void ToolChainModel::apply()
}
Q_ASSERT(m_toRemoveList.isEmpty());
// Update toolchains:
// Update tool chains:
foreach (ToolChainNode *n, m_manualRoot->childNodes) {
Q_ASSERT(n);
if (n->changed) {
@@ -305,7 +305,7 @@ void ToolChainModel::apply()
}
}
// Add new (and already updated) toolchains
// Add new (and already updated) tool chains
nodes = m_toAddList;
foreach (ToolChainNode *n, nodes) {
ToolChainManager::instance()->registerToolChain(n->toolChain);
@@ -442,7 +442,7 @@ QString ToolChainOptionsPage::id() const
QString ToolChainOptionsPage::displayName() const
{
return tr("Toolchains");
return tr("Tool Chains");
}
QString ToolChainOptionsPage::category() const
@@ -452,7 +452,7 @@ QString ToolChainOptionsPage::category() const
QString ToolChainOptionsPage::displayCategory() const
{
return tr("Toolchains");
return tr("Tool Chains");
}
QIcon ToolChainOptionsPage::categoryIcon() const
@@ -517,7 +517,7 @@ QWidget *ToolChainOptionsPage::createPage(QWidget *parent)
if (m_searchKeywords.isEmpty()) {
QLatin1Char sep(' ');
QTextStream stream(&m_searchKeywords);
stream << tr("Toolchains");
stream << tr("Tool Chains");
foreach (ToolChainFactory *f, m_factories)
stream << sep << f->displayName();

View File

@@ -40,6 +40,7 @@
#include <QtDebug>
#include <QGraphicsSceneDragDropEvent>
#include <nodemetainfo.h>
#include <nodeproperty.h>
namespace QmlDesigner {
@@ -194,6 +195,14 @@ void AbstractFormEditorTool::dragMoveEvent(QGraphicsSceneDragDropEvent * /* even
Q_ASSERT(false);
}
static inline bool checkIfNodeIsAView(const ModelNode &node)
{
return node.metaInfo().isValid() &&
(node.metaInfo().isSubclassOf("QtQuick.ListView", -1, -1) ||
node.metaInfo().isSubclassOf("QtQuick.GridView", -1, -1) ||
node.metaInfo().isSubclassOf("QtQuick.PathView", -1, -1));
}
void AbstractFormEditorTool::mouseDoubleClickEvent(const QList<QGraphicsItem*> &itemList, QGraphicsSceneMouseEvent *event)
{
FormEditorItem *formEditorItem = topFormEditorItem(itemList);
@@ -202,6 +211,11 @@ void AbstractFormEditorTool::mouseDoubleClickEvent(const QList<QGraphicsItem*> &
if (doubleClickNode.metaInfo().isComponent()) {
Core::EditorManager::instance()->openEditor(doubleClickNode.metaInfo().componentFileName());
event->accept();
} else if (checkIfNodeIsAView(doubleClickNode) &&
doubleClickNode.hasNodeProperty("delegate") &&
doubleClickNode.nodeProperty("delegate").modelNode().metaInfo().isComponent()) {
Core::EditorManager::instance()->openEditor(doubleClickNode.nodeProperty("delegate").modelNode().metaInfo().componentFileName());
event->accept();
}
}
}

View File

@@ -15,4 +15,7 @@
<qresource prefix="/icon/selection">
<file>selectonlycontentitems.png</file>
</qresource>
<qresource prefix="/icon">
<file>reset.png</file>
</qresource>
</RCC>

View File

@@ -166,6 +166,15 @@ FormEditorWidget::FormEditorWidget(FormEditorView *view)
addAction(m_zoomAction.data());
upperActions.append(m_zoomAction.data());
m_toolBox->addRightSideAction(m_zoomAction.data());
m_resetAction = new QAction(tr("Reset view (R)"), this);
m_resetAction->setShortcut(Qt::Key_R);
m_resetAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
m_resetAction->setIcon(QPixmap(":/icon/reset.png"));
connect(m_resetAction.data(), SIGNAL(triggered(bool)), this, SLOT(resetNodeInstanceView()));
addAction(m_resetAction.data());
upperActions.append(m_resetAction.data());
m_toolBox->addRightSideAction(m_resetAction.data());
}
void FormEditorWidget::enterEvent(QEvent *event)
@@ -203,6 +212,12 @@ void FormEditorWidget::changeRootItemHeight(const QString &heighText)
}
}
void FormEditorWidget::resetNodeInstanceView()
{
m_formEditorView->setCurrentState(m_formEditorView->baseState());
m_formEditorView->emitCustomNotification(QLatin1String("reset QmlPuppet"));
}
void FormEditorWidget::changeAnchorTool(bool checked)
{
if (checked && m_formEditorView->currentState().isBaseState())

View File

@@ -95,6 +95,7 @@ private slots:
void setZoomLevel(double zoomLevel);
void changeRootItemWidth(const QString &widthText);
void changeRootItemHeight(const QString &heightText);
void resetNodeInstanceView();
private:
QWeakPointer<FormEditorView> m_formEditorView;
@@ -111,6 +112,7 @@ private:
QWeakPointer<QAction> m_selectOnlyContentItemsAction;
QWeakPointer<LineEditAction> m_rootWidthAction;
QWeakPointer<LineEditAction> m_rootHeightAction;
QWeakPointer<QAction> m_resetAction;
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 515 B

View File

@@ -290,6 +290,9 @@ void ItemLibraryWidget::updateImports()
QList<QToolButton *> ItemLibraryWidget::createToolBarWidgets()
{
QList<QToolButton *> buttons;
return buttons; //import managment gets disabled for now (TODO ###)
buttons << new QToolButton();
buttons.first()->setText("I ");
buttons.first()->setIcon(QIcon(QLatin1String(Core::Constants::ICON_FILTER)));

View File

@@ -373,6 +373,7 @@ void PropertyEditor::changeValue(const QString &propertyName)
try {
m_selectedNode.setId(newId);
} catch (InvalidIdException &e) { //better save then sorry
value->setValue(m_selectedNode.id());
QMessageBox::warning(0, tr("Invalid Id"), e.description());
}
} else { //there is already an id, so we refactor
@@ -531,6 +532,8 @@ void PropertyEditor::otherPropertyChanged(const QmlObjectNode &fxObjectNode, con
if (!m_selectedNode.isValid())
return;
m_locked = true;
if (fxObjectNode.isValid() && m_currentType && fxObjectNode == m_selectedNode && fxObjectNode.currentState().isValid()) {
AbstractProperty property = fxObjectNode.modelNode().property(propertyName);
if (fxObjectNode == m_selectedNode || QmlObjectNode(m_selectedNode).propertyChangeForCurrentState() == fxObjectNode) {
@@ -540,6 +543,8 @@ void PropertyEditor::otherPropertyChanged(const QmlObjectNode &fxObjectNode, con
setValue(m_selectedNode, property.name(), QmlObjectNode(m_selectedNode).modelValue(property.name()));
}
}
m_locked = false;
}
void PropertyEditor::transformChanged(const QmlObjectNode &fxObjectNode, const QString &propertyName)
@@ -836,8 +841,10 @@ void PropertyEditor::instanceInformationsChange(const QVector<ModelNode> &nodeLi
if (!m_selectedNode.isValid())
return;
m_locked = true;
if (nodeList.contains(m_selectedNode))
m_currentType->m_backendAnchorBinding.setup(QmlItemNode(m_selectedNode));
m_locked = false;
}
void PropertyEditor::nodeIdChanged(const ModelNode& node, const QString& newId, const QString& oldId)

View File

@@ -91,6 +91,7 @@ StatesEditorWidget::StatesEditorWidget(StatesEditorView *statesEditorView, State
m_declarativeView->setAcceptDrops(false);
QVBoxLayout *layout = new QVBoxLayout(this);
setMinimumHeight(160);
layout->setMargin(0);
layout->setSpacing(0);
layout->addWidget(m_declarativeView.data());

View File

@@ -109,6 +109,7 @@ public:
void instancesPreviewImageChanged(const QVector<ModelNode> &nodeList);
void instancesChildrenChanged(const QVector<ModelNode> &nodeList);
void auxiliaryDataChanged(const ModelNode &node, const QString &name, const QVariant &data);
void customNotification(const AbstractView *view, const QString &identifier, const QList<ModelNode> &nodeList, const QList<QVariant> &data);
void rewriterBeginTransaction();
void rewriterEndTransaction();

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