Merge "Merge remote-tracking branch 'origin/4.0'"

This commit is contained in:
Eike Ziller
2016-05-03 10:25:01 +00:00
committed by The Qt Project
169 changed files with 4156 additions and 1867 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.7 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 5.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.6 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.0 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 85 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 KiB

After

Width:  |  Height:  |  Size: 54 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.3 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

After

Width:  |  Height:  |  Size: 29 KiB

BIN
doc/images/samegame.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 29 KiB

View File

@@ -245,13 +245,21 @@
functions that spend the most CPU time most prominently. functions that spend the most CPU time most prominently.
If a function without debug information is encountered, further unwinding If a function without debug information is encountered, further unwinding
of the stack may fail. Unwinding will also fail if a QML or JavaScript of the stack may fail. Unwinding will also fail for some symbols
function is encountered, and for some symbols implemented in assembler. If implemented in assembly language. If unwinding fails, only a part of the
unwinding fails, only part of the call chain is displayed, and the call chain is displayed, and the surrounding functions may seem to be
surrounding functions may seem to be interrupted. This does not necessarily interrupted. This does not necessarily mean they were actually interrupted
mean they were actually interrupted during the execution of the during the execution of the application, but only that they could not be
application, but only that they could not be found in the stacks where the found in the stacks where the unwinding failed.
unwinding failed.
JavaScript functions from the QML engine running in the JIT mode can be
unwound. However, their names will only be displayed when
\c QV4_PROFILE_WRITE_PERF_MAP is set. Compiled JavaScript generated by the
\l{http://doc.qt.io/QtQuickCompiler/}{Qt Quick Compiler} can also be
unwound. In this case the C++ names generated by the compiler are shown for
JavaScript functions, rather than their JavaScript names. When running in
interpreted mode, stack frames involving QML can also be unwound, showing
the interpreter itself, rather than the interpreted JavaScript.
Kernel functions included in call chains are shown on the third row of each Kernel functions included in call chains are shown on the third row of each
thread. All kernel functions are summarized and not differentiated any thread. All kernel functions are summarized and not differentiated any

View File

@@ -59,9 +59,6 @@
For more information about analyzing applications for which you do not have For more information about analyzing applications for which you do not have
a project, see \l{Running Valgrind Tools on External Applications}. a project, see \l{Running Valgrind Tools on External Applications}.
To stop the currently running analyzer, select \uicontrol {Analyze
> Stop}.
To select options for the Valgrind tools, select \uicontrol {Tools > Options > To select options for the Valgrind tools, select \uicontrol {Tools > Options >
Analyzer}. You can override the general settings for each project in the Analyzer}. You can override the general settings for each project in the
\uicontrol {Run Settings} for the project. \uicontrol {Run Settings} for the project.

View File

@@ -54,9 +54,8 @@
\li In the \uicontrol Projects mode, select a debug build configuration. \li In the \uicontrol Projects mode, select a debug build configuration.
\li Select \uicontrol Analyze > \uicontrol {Valgrind Memory Analyzer}, \li Select \uicontrol Debug to open the \uicontrol Debug mode, and then
or \uicontrol {Valgrind Memory Analyzer with GDB} if you want to select \uicontrol Memcheck on the toolbar.
debug the found problems.
\li Select the \li Select the
\inlineimage qtcreator-analyze-start-button.png "Start button" \inlineimage qtcreator-analyze-start-button.png "Start button"
@@ -73,11 +72,11 @@
While the application is running, Memcheck checks all reads and writes of While the application is running, Memcheck checks all reads and writes of
memory and intercepts calls that allocate or free memory or create or memory and intercepts calls that allocate or free memory or create or
delete memory blocks. When you stop Memcheck, it displays the results in delete memory blocks. The results are displayed when you stop Memcheck.
the \uicontrol Analysis view. Click a line to view where a memory leak Click a line to view where a memory leak
occurred and a stack trace that shows what caused it. occurred and a stack trace that shows what caused it.
\image analyzer-issues.png "Analysis view" \image qtcreator-valgrind-memcheck.png "Memcheck view"
Move the mouse on a row to view more information about the function. Move the mouse on a row to view more information about the function.
@@ -93,9 +92,8 @@
Stack traces can get quite large and confusing, and therefore, reading them Stack traces can get quite large and confusing, and therefore, reading them
from the bottom up can help. If the stack trace is not big enough or it is from the bottom up can help. If the stack trace is not big enough or it is
too big, select \uicontrol {Tools > Options > Analyzer}. too big, select \uicontrol {Tools > Options > Analyzer} and define the
Define the length of the stack trace in the \uicontrol {Backtrace frame count} length of the stack trace in the \uicontrol {Backtrace frame count} field.
field.
\image qtcreator-valgrind-memcheck-options.png "Memory Analysis options" \image qtcreator-valgrind-memcheck-options.png "Memory Analysis options"
@@ -164,7 +162,8 @@
\li In the \uicontrol Projects mode, select a release build configuration. \li In the \uicontrol Projects mode, select a release build configuration.
\li Select \uicontrol Analyze > \uicontrol {Valgrind Function Profiler}. \li Select \uicontrol Debug to open the \uicontrol Debug mode, and then
select \uicontrol Callgrind on the toolbar.
\li Select the \li Select the
\inlineimage qtcreator-analyze-start-button.png "Start button" \inlineimage qtcreator-analyze-start-button.png "Start button"
@@ -192,17 +191,17 @@
Since the run-time characteristics of debug and release Since the run-time characteristics of debug and release
\l{glossary-build-config}{build configurations} \l{glossary-build-config}{build configurations}
differ significantly, analytical findings for one build configuration may or differ significantly, analytical findings for one build configuration may
not be relevant for the other. Profiling a debug build not be relevant for the other. Profiling a debug build
often finds a major part of the time being spent in low-level often finds a major part of the time being spent in low-level
code like container implementations, while the same code code, such as container implementations, while the same code
does not show up in the profile of a release build of the does not show up in the profile of a release build of the
same application due to inlining and other optimizations same application due to inlining and other optimizations
typically done there. typically done there.
Many recent compilers allow you to build an optimized application Many recent compilers allow you to build an optimized application
with debug information present at the same time. Typical with debug information present at the same time. For example, typical
options for GCC are for instance \c{-g -O2}. It is options for GCC are: \c{-g -O2}. It is
advisable to use such a setup for Callgrind profiling. advisable to use such a setup for Callgrind profiling.
@@ -279,7 +278,7 @@
\li Select \uicontrol Analyze > \uicontrol {Valgrind Memory Analyzer (External \li Select \uicontrol Analyze > \uicontrol {Valgrind Memory Analyzer (External
Application)} or \uicontrol {Valgrind Function Profiler (External Application)}. Application)} or \uicontrol {Valgrind Function Profiler (External Application)}.
\image qtcreator-valgrind-remote-settings.png "Start Analyzer dialog" \image qtcreator-valgrind-remote-settings.png "Start Remote Analysis dialog"
\li Specify the application to run and analyze, and the \l{glossary-buildandrun-kit}{kit} \li Specify the application to run and analyze, and the \l{glossary-buildandrun-kit}{kit}
to use. to use.

View File

@@ -128,9 +128,9 @@
select \uicontrol Tools > \uicontrol Options > \uicontrol Analyzer. select \uicontrol Tools > \uicontrol Options > \uicontrol Analyzer.
To specify custom QML Profiler settings for a particular project, select To specify custom QML Profiler settings for a particular project, select
\uicontrol Projects and then select \uicontrol Custom in \uicontrol \uicontrol Projects > \uicontrol Run and then select \uicontrol Custom in
{QML Profiler Settings}. To restore the global settings for the project, \uicontrol {QML Profiler Settings}. To restore the global settings for the
select \uicontrol {Restore Global}. project, select \uicontrol {Restore Global}.
\image qml-profiler-settings.png "QML Profiler Settings" \image qml-profiler-settings.png "QML Profiler Settings"
@@ -145,6 +145,11 @@
application, potentially wasting memory. However, the flushing itself takes application, potentially wasting memory. However, the flushing itself takes
time, which can distort the profiling results. time, which can distort the profiling results.
If you have multiple QML engines and you want to aggregate the data produced
by all of them into one trace, select the \uicontrol {Process data only when
process ends} check box. Otherwise, the profiling stops when one of the
engines stops.
\section1 Attaching to Running Qt Quick Applications \section1 Attaching to Running Qt Quick Applications
To profile Qt Quick applications that are not launched by \QC, select To profile Qt Quick applications that are not launched by \QC, select

View File

@@ -63,8 +63,10 @@
\li Select \uicontrol {Debug > Start Debugging > Start Debugging} or press \li Select \uicontrol {Debug > Start Debugging > Start Debugging} or press
\key{F5}. \key{F5}.
\li Once the Same Game application starts, click the \uicontrol {New Game} \li Once the Same Game application starts, select \uicontrol {1 Player}
button to start a new game. to start a new game.
\image samegame.png
\li When the debugger hits the breakpoint, it interrupts the \li When the debugger hits the breakpoint, it interrupts the
application. \QC displays the nested function calls leading to the application. \QC displays the nested function calls leading to the
@@ -93,10 +95,7 @@
\li To execute JavaScript commands in the current context, open the \li To execute JavaScript commands in the current context, open the
\uicontrol {Debugger Console} output pane. \uicontrol {Debugger Console} output pane.
\li To change the score to 1000, enter \c{gameCanvas.score = 1000} \image qml-script-console.png
in the console.
\image qtquick-example-script-console.png
\li To remove a breakpoint, right-click it and select \li To remove a breakpoint, right-click it and select
\uicontrol {Delete Breakpoint}. \uicontrol {Delete Breakpoint}.
@@ -106,25 +105,16 @@
\image qtquick-example-qml-inspector.png \image qtquick-example-qml-inspector.png
\li Click \li Select \uicontrol Debug > \uicontrol {Show Application on Top} to
\inlineimage qml-inspector-app-on-top.png keep the application visible while you interact with the debugger.
(\uicontrol {Show Application on Top}) to keep the application visible
while you interact with the debugger.
\li Click \li Select \uicontrol Debug > \uicontrol Select to activate selection
\inlineimage qml-inspector-select-button.png mode and then click the \uicontrol Menu button to move into the
(\uicontrol Select) to activate selection mode and then click the \uicontrol menuButton component in the
\uicontrol {Quit} button to move into the \uicontrol ButtonLabel component \uicontrol {Locals and Expressions} view and the code editor.
in the \uicontrol {Locals and Expressions} and the code editor.
\li In the \uicontrol {Locals and Expressions} view, double-click the value of \li In the \uicontrol {Locals and Expressions} view, double-click the
the \c text property to change it temporarily from \uicontrol {Quit} to value of a property to change it.
\uicontrol {End Game}.
\image qtquick-example-property-values.png
When you select an element, the cursor moves to it in the code
editor, where you can change the value permanently.
\endlist \endlist

View File

@@ -186,9 +186,8 @@
\image qml-observer-view.png "QML item tree" \image qml-observer-view.png "QML item tree"
To keep the application visible while you interact with the debugger, click To keep the application visible while you interact with the debugger, select
\inlineimage qml-inspector-app-on-top.png \uicontrol Debug > \uicontrol {Show Application on Top}.
(\uicontrol {Show Application on Top}).
You can view a QML item in \uicontrol {Locals and Expressions} in the following You can view a QML item in \uicontrol {Locals and Expressions} in the following
ways: ways:
@@ -199,10 +198,8 @@
\li Select the item in the code editor. \li Select the item in the code editor.
\li Click \li Select \uicontrol Debug > \uicontrol Select to activate selection
\inlineimage qml-inspector-select-button.png mode and then click an item in the running application.
(\uicontrol Select) to activate selection mode and then click an item
in the running application.
\endlist \endlist
@@ -215,7 +212,7 @@
When you debug complex applications, you can jump to the position in code When you debug complex applications, you can jump to the position in code
where an item is defined or you can zoom into the user interface. where an item is defined or you can zoom into the user interface.
When the \uicontrol Select tool is enabled, you can click items in the running In the selection mode, you can click items in the running
application to jump to their definitions in the code. The properties of the application to jump to their definitions in the code. The properties of the
selected item are displayed in the \uicontrol {Locals and Expressions} view. selected item are displayed in the \uicontrol {Locals and Expressions} view.
@@ -238,14 +235,9 @@
\endlist \endlist
To switch to the zoom mode, click the \uicontrol Zoom button. Click in the To switch out of the selection mode, toggle the \uicontrol Select menu item.
running application to zoom in. Right-click to open a context menu that
contains zoom controls.
To switch out of the selection or zoom mode, deselect the \uicontrol Select or To move the application running in \QQV to the front, select
\uicontrol Zoom button. \uicontrol Debug > \uicontrol {Show Application on Top}.
To move the application running in \QQV to the front, select the
\uicontrol {Show Application on Top} button.
*/ */

View File

@@ -197,15 +197,17 @@
space, the help opens in the full-screen help mode. space, the help opens in the full-screen help mode.
You can specify that the help always opens in full-screen mode or You can specify that the help always opens in full-screen mode or
is detached to an external window. Select \uicontrol {Tools > Options > Help > is detached to an external window. Select \uicontrol Tools >
General Settings} and specify settings for displaying context-sensitive help \uicontrol Options > \uicontrol Help > \uicontrol General and specify
settings for displaying context-sensitive help
in the \uicontrol {On context help} field. To detach the help window, select in the \uicontrol {On context help} field. To detach the help window, select
\uicontrol {Always Show Help in External Window}. \uicontrol {Always Show in External Window}.
\section1 Selecting the Start Page \section1 Selecting the Start Page
You can select the page to display when you open the \uicontrol Help mode in the You can select the page to display when you open the \uicontrol Help mode in the
\uicontrol {Tools > Options > Help > General Settings > On help start} field. \uicontrol Tools > \uicontrol Options > \uicontrol Help > \uicontrol General
> \uicontrol {On help start} field.
To display the page and help panes that were open when you exited the mode, To display the page and help panes that were open when you exited the mode,
select the \uicontrol {Show My Tabs from Last Session} option. However, Web pages select the \uicontrol {Show My Tabs from Last Session} option. However, Web pages
are not opened, because loading them would slow down opening the \uicontrol Help are not opened, because loading them would slow down opening the \uicontrol Help
@@ -221,8 +223,8 @@
\section1 Using Documentation Filters \section1 Using Documentation Filters
You can filter the documents displayed in the \uicontrol Help mode to find You can filter the documents displayed in the \uicontrol Help mode to find
relevant information faster. Select from a list of filters in the relevant information faster. Select a filter from a list of filters (1). The
\uicontrol {Filtered by} field (1). The contents of the \uicontrol Index and \uicontrol Contents contents of the \uicontrol Index and \uicontrol Contents
pane in the sidebar change accordingly. pane in the sidebar change accordingly.
\image qtcreator-help-filters.png "Help filters" \image qtcreator-help-filters.png "Help filters"
@@ -249,8 +251,8 @@
\li Click \uicontrol OK. \li Click \uicontrol OK.
\li In the \uicontrol Help mode, select the filter in the \uicontrol {Filtered by} \li In the \uicontrol Help mode, select the filter in the list of
field to see the filtered documentation in the sidebar. filters to see the filtered documentation in the sidebar.
\endlist \endlist

View File

@@ -40,6 +40,9 @@
with the build and run kit. \QC automatically creates a Qbs profile for each with the build and run kit. \QC automatically creates a Qbs profile for each
kit. You can edit the build profiles by adding new keys and values. kit. You can edit the build profiles by adding new keys and values.
To check which Qbs version is being used, select \uicontrol Tools >
\uicontrol Options > \uicontrol Qbs > \uicontrol {Version Info}.
\section1 Building Qbs \section1 Building Qbs
If you build \QC yourself from the \QC Git repository, you also need to If you build \QC yourself from the \QC Git repository, you also need to
@@ -60,10 +63,22 @@
\list 1 \list 1
\li Select \uicontrol File > \uicontrol {New File or Project} > \uicontrol {Plain C \li Select \uicontrol File > \uicontrol {New File or Project} >
Project (Qbs Build)} or \uicontrol {Plain C++ Project (Qbs Build)} > \uicontrol {Non-Qt Project} > \uicontrol {Plain C Project} or
\uicontrol Choose, and follow the instructions of the wizard to create a \uicontrol {Plain C++ Project} > \uicontrol Choose.
Qbs project.
\li In the \uicontrol {Project Location} dialog, specify the name and
location for the project and select \uicontrol Next.
\li In the \uicontrol {Define Build System} dialog, select
\uicontrol Qbs in the \uicontrol {Build system} field, and then
select \uicontrol Next.
\li In the \uicontrol {Kit Selection} dialog, select a build and run kit
for the project, and then select \uicontrol Next.
\li In the \uicontrol {Project Management} dialog, select
\uicontrol Finish to create a Qbs project.
\image creator-qbs-project.png \image creator-qbs-project.png
@@ -133,9 +148,6 @@
\list \list
\li Select \uicontrol {Clean all artifacts} to remove all build
artifacts.
\li Select \uicontrol {Dry run} to test cleaning without executing \li Select \uicontrol {Dry run} to test cleaning without executing
commands or making permanent changes to the build graph. commands or making permanent changes to the build graph.
@@ -165,6 +177,13 @@
\li Select \uicontrol Tools > \uicontrol Options > \uicontrol Qbs. \li Select \uicontrol Tools > \uicontrol Options > \uicontrol Qbs.
\li By default, Qbs profiles are stored in the \c qbs directory in the
\QC settings directory to ensure that different \QC instances do not
overwrite each other's profiles. If you only run one \QC instance,
you can store the profiles in the Qbs settings directory instead,
by deselecting the \uicontrol {Store profiles in Qt Creator settings
directory} check box.
\li In the \uicontrol Kit field, select a build and run kit. \li In the \uicontrol Kit field, select a build and run kit.
\li Select \uicontrol Edit to edit the profile associated with the kit. \li Select \uicontrol Edit to edit the profile associated with the kit.

View File

@@ -173,7 +173,7 @@ unix {
UI_DIR = $${OUT_PWD}/.uic UI_DIR = $${OUT_PWD}/.uic
} }
win32-msvc* { msvc {
#Don't warn about sprintf, fopen etc being 'unsafe' #Don't warn about sprintf, fopen etc being 'unsafe'
DEFINES += _CRT_SECURE_NO_WARNINGS DEFINES += _CRT_SECURE_NO_WARNINGS
QMAKE_CXXFLAGS_WARN_ON *= -w44996 QMAKE_CXXFLAGS_WARN_ON *= -w44996

View File

@@ -101,10 +101,10 @@ def qdump__QChar(d, value):
d.putNumChild(0) d.putNumChild(0)
def qform__QAbstractItemModel(): def qform_X_QAbstractItemModel():
return [SimpleFormat, EnhancedFormat] return [SimpleFormat, EnhancedFormat]
def qdump__QAbstractItemModel(d, value): def qdump_X_QAbstractItemModel(d, value):
displayFormat = d.currentItemFormat() displayFormat = d.currentItemFormat()
if displayFormat == SimpleFormat: if displayFormat == SimpleFormat:
d.putPlainChildren(value) d.putPlainChildren(value)

View File

@@ -42,6 +42,7 @@
"QtQuick.Controls 1.2", "QtQuick.Controls 1.2",
"QtQuick.Controls 1.3", "QtQuick.Controls 1.3",
"QtQuick.Controls 1.4", "QtQuick.Controls 1.4",
"QtQuick.Controls 2.0",
"QtQuick.Controls.Styles 1.0", "QtQuick.Controls.Styles 1.0",
"QtQuick.Controls.Styles 1.1", "QtQuick.Controls.Styles 1.1",
"QtQuick.Controls.Styles 1.2", "QtQuick.Controls.Styles 1.2",
@@ -55,6 +56,7 @@
"QtQuick.Layouts 1.1", "QtQuick.Layouts 1.1",
"QtQuick.LocalStorage 2.0", "QtQuick.LocalStorage 2.0",
"QtQuick.Particles 2.0", "QtQuick.Particles 2.0",
"QtQuick.Templates 2.0",
"QtQuick.Window 2.0", "QtQuick.Window 2.0",
"QtQuick.XmlListModel 2.0", "QtQuick.XmlListModel 2.0",
"QtSensors 5.3", "QtSensors 5.3",

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 116 KiB

After

Width:  |  Height:  |  Size: 112 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 787 B

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 27 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 192 KiB

After

Width:  |  Height:  |  Size: 63 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 787 B

After

Width:  |  Height:  |  Size: 527 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 29 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 68 KiB

After

Width:  |  Height:  |  Size: 29 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 719 B

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 129 KiB

After

Width:  |  Height:  |  Size: 62 KiB

View File

@@ -34,7 +34,7 @@ win32 {
BOTAN_HAS_DYNAMIC_LOADER BOTAN_HAS_ENTROPY_SRC_CAPI BOTAN_HAS_ENTROPY_SRC_WIN32 \ BOTAN_HAS_DYNAMIC_LOADER BOTAN_HAS_ENTROPY_SRC_CAPI BOTAN_HAS_ENTROPY_SRC_WIN32 \
BOTAN_HAS_MUTEX_WIN32 BOTAN_HAS_MUTEX_WIN32
win32-msvc* { msvc {
QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHs QMAKE_CXXFLAGS_EXCEPTIONS_ON = -EHs
QMAKE_CXXFLAGS += -wd4251 -wd4290 -wd4250 -wd4297 -wd4267 -wd4334 QMAKE_CXXFLAGS += -wd4251 -wd4290 -wd4250 -wd4297 -wd4267 -wd4334
DEFINES += BOTAN_BUILD_COMPILER_IS_MSVC BOTAN_TARGET_OS_HAS_GMTIME_S _SCL_SECURE_NO_WARNINGS DEFINES += BOTAN_BUILD_COMPILER_IS_MSVC BOTAN_TARGET_OS_HAS_GMTIME_S _SCL_SECURE_NO_WARNINGS

View File

@@ -26,6 +26,7 @@
#pragma once #pragma once
#include "clangbackendipc_global.h" #include "clangbackendipc_global.h"
#include <ostream>
namespace ClangBackEnd { namespace ClangBackEnd {

View File

@@ -26,6 +26,7 @@
#pragma once #pragma once
#include "clangbackendipc_global.h" #include "clangbackendipc_global.h"
#include <ostream>
namespace ClangBackEnd { namespace ClangBackEnd {

View File

@@ -88,10 +88,10 @@ static bool isNestedInstantiationEnclosingTemplate(
ClassOrNamespace *nestedClassOrNamespaceInstantiation, ClassOrNamespace *nestedClassOrNamespaceInstantiation,
ClassOrNamespace *enclosingTemplateClassInstantiation) ClassOrNamespace *enclosingTemplateClassInstantiation)
{ {
QList<ClassOrNamespace *> processed; QSet<ClassOrNamespace *> processed;
while (enclosingTemplateClassInstantiation while (enclosingTemplateClassInstantiation
&& !processed.contains(enclosingTemplateClassInstantiation)) { && !processed.contains(enclosingTemplateClassInstantiation)) {
processed.append(enclosingTemplateClassInstantiation); processed.insert(enclosingTemplateClassInstantiation);
if (enclosingTemplateClassInstantiation == nestedClassOrNamespaceInstantiation) if (enclosingTemplateClassInstantiation == nestedClassOrNamespaceInstantiation)
return false; return false;
enclosingTemplateClassInstantiation = enclosingTemplateClassInstantiation->parent(); enclosingTemplateClassInstantiation = enclosingTemplateClassInstantiation->parent();
@@ -454,8 +454,13 @@ QList<LookupItem> LookupContext::lookup(const Name *name, Scope *scope) const
candidates = binding->find(name); candidates = binding->find(name);
// try find this name in parent class // try find this name in parent class
while (candidates.isEmpty() && (binding = binding->parent())) QSet<ClassOrNamespace *> processed;
while (candidates.isEmpty() && (binding = binding->parent())) {
if (processed.contains(binding))
break;
processed.insert(binding);
candidates = binding->find(name); candidates = binding->find(name);
}
if (! candidates.isEmpty()) if (! candidates.isEmpty())
return candidates; return candidates;
@@ -1143,8 +1148,13 @@ ClassOrNamespace *ClassOrNamespace::nestedType(const Name *name, ClassOrNamespac
instantiation->_name = templId; instantiation->_name = templId;
instantiation->_templateId = templId; instantiation->_templateId = templId;
while (!origin->_symbols.isEmpty() && origin->_symbols[0]->isBlock()) QSet<ClassOrNamespace *> processed;
while (!origin->_symbols.isEmpty() && origin->_symbols[0]->isBlock()) {
if (processed.contains(origin))
break;
processed.insert(origin);
origin = origin->parent(); origin = origin->parent();
}
instantiation->_instantiationOrigin = origin; instantiation->_instantiationOrigin = origin;

View File

@@ -140,6 +140,9 @@ int OverviewModel::columnCount(const QModelIndex &) const
QVariant OverviewModel::data(const QModelIndex &index, int role) const QVariant OverviewModel::data(const QModelIndex &index, int role) const
{ {
if (!index.isValid())
return QVariant();
// account for no symbol item // account for no symbol item
if (!index.parent().isValid() && index.row() == 0) { if (!index.parent().isValid() && index.row() == 0) {
switch (role) { switch (role) {
@@ -243,7 +246,9 @@ void OverviewModel::rebuild(Document::Ptr doc)
Qt::ItemFlags OverviewModel::flags(const QModelIndex &index) const Qt::ItemFlags OverviewModel::flags(const QModelIndex &index) const
{ {
Q_UNUSED(index) if (!index.isValid())
return 0;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled; return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDragEnabled;
} }

View File

@@ -62,10 +62,12 @@ void AssociationItem::update(const Style *style)
QMT_CHECK(m_arrow); QMT_CHECK(m_arrow);
QGraphicsItem *endAItem = m_diagramSceneModel->graphicsItem(m_association->endAUid()); QGraphicsItem *endAItem = m_diagramSceneModel->graphicsItem(m_association->endAUid());
QMT_CHECK(endAItem); if (!endAItem)
return;
placeEndLabels(m_arrow->firstLineSegment(), m_endAName, m_endACardinality, endAItem, m_arrow->startHeadLength()); placeEndLabels(m_arrow->firstLineSegment(), m_endAName, m_endACardinality, endAItem, m_arrow->startHeadLength());
QGraphicsItem *endBItem = m_diagramSceneModel->graphicsItem(m_association->endBUid()); QGraphicsItem *endBItem = m_diagramSceneModel->graphicsItem(m_association->endBUid());
QMT_CHECK(endBItem); if (!endBItem)
return;
placeEndLabels(m_arrow->lastLineSegment(), m_endBName, m_endBCardinality, endBItem, m_arrow->endHeadLength()); placeEndLabels(m_arrow->lastLineSegment(), m_endBName, m_endBCardinality, endBItem, m_arrow->endHeadLength());
} }

View File

@@ -492,7 +492,8 @@ QPointF RelationItem::calcEndPoint(const Uid &end, const Uid &otherEnd, int near
QPointF RelationItem::calcEndPoint(const Uid &end, const QPointF &otherEndPos, int nearestIntermediatePointIndex) QPointF RelationItem::calcEndPoint(const Uid &end, const QPointF &otherEndPos, int nearestIntermediatePointIndex)
{ {
QGraphicsItem *endItem = m_diagramSceneModel->graphicsItem(end); QGraphicsItem *endItem = m_diagramSceneModel->graphicsItem(end);
QMT_CHECK(endItem); if (!endItem)
return QPointF(0, 0);
auto endObjectItem = dynamic_cast<IIntersectionable *>(endItem); auto endObjectItem = dynamic_cast<IIntersectionable *>(endItem);
QPointF endPos; QPointF endPos;
if (endObjectItem) { if (endObjectItem) {

View File

@@ -2,7 +2,7 @@
# in case MS VS compilers are used. # in case MS VS compilers are used.
CDB_PATH="" CDB_PATH=""
win32-msvc*|winrt { msvc {
CDB_PATH="$$(CDB_PATH)" CDB_PATH="$$(CDB_PATH)"
isEmpty(CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows/sdk" isEmpty(CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows/sdk"
!exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x86)/sdk" !exists($$CDB_PATH):CDB_PATH="$$(ProgramFiles)/Debugging Tools For Windows (x86)/sdk"

View File

@@ -6,7 +6,7 @@ contains(CONFIG, dll) {
INCLUDEPATH += $$PWD INCLUDEPATH += $$PWD
unix:!openbsd: LIBS += -ldl unix:!bsd: LIBS += -ldl
include(../3rdparty/sqlite/sqlite.pri) include(../3rdparty/sqlite/sqlite.pri)

View File

@@ -13,7 +13,7 @@ QtcLibrary {
"SQLITE_ENABLE_COLUMN_METADATA" "SQLITE_ENABLE_COLUMN_METADATA"
]) ])
cpp.optimization: "fast" cpp.optimization: "fast"
cpp.dynamicLibraries: base.concat((qbs.targetOS.contains("unix") && !qbs.targetOS.contains("openbsd")) cpp.dynamicLibraries: base.concat((qbs.targetOS.contains("unix") && !qbs.targetOS.contains("bsd"))
? ["dl", "pthread"] : []) ? ["dl", "pthread"] : [])

View File

@@ -7,6 +7,7 @@ QtcLibrary {
cpp.defines: base.concat(["QSSH_LIBRARY"]).concat(botanDefines) cpp.defines: base.concat(["QSSH_LIBRARY"]).concat(botanDefines)
cpp.includePaths: botanIncludes cpp.includePaths: botanIncludes
cpp.dynamicLibraries: botanLibs cpp.dynamicLibraries: botanLibs
cpp.enableExceptions: true
Depends { name: "Qt"; submodules: ["widgets", "network" ] } Depends { name: "Qt"; submodules: ["widgets", "network" ] }

View File

@@ -23,6 +23,7 @@
** **
****************************************************************************/ ****************************************************************************/
#undef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 /* WinXP, needed for DebugActiveProcessStop() */ #define _WIN32_WINNT 0x0501 /* WinXP, needed for DebugActiveProcessStop() */
#include <windows.h> #include <windows.h>

View File

@@ -246,7 +246,7 @@ class QTCREATOR_UTILS_EXPORT TreeModel : public QAbstractItemModel
public: public:
explicit TreeModel(QObject *parent = 0); explicit TreeModel(QObject *parent = 0);
explicit TreeModel(TreeItem *root, QObject *parent = 0); explicit TreeModel(TreeItem *root, QObject *parent = 0);
~TreeModel(); ~TreeModel() override;
void setHeader(const QStringList &displays); void setHeader(const QStringList &displays);
void setHeaderToolTip(const QStringList &tips); void setHeaderToolTip(const QStringList &tips);
@@ -258,19 +258,19 @@ public:
QModelIndex indexForItem(const TreeItem *needle) const; QModelIndex indexForItem(const TreeItem *needle) const;
int topLevelItemCount() const; int topLevelItemCount() const;
int rowCount(const QModelIndex &idx = QModelIndex()) const; int rowCount(const QModelIndex &idx = QModelIndex()) const override;
int columnCount(const QModelIndex &idx) const; int columnCount(const QModelIndex &idx) const override;
bool setData(const QModelIndex &idx, const QVariant &data, int role); bool setData(const QModelIndex &idx, const QVariant &data, int role) override;
QVariant data(const QModelIndex &idx, int role) const; QVariant data(const QModelIndex &idx, int role) const override;
QModelIndex index(int, int, const QModelIndex &idx = QModelIndex()) const; QModelIndex index(int, int, const QModelIndex &idx = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &idx) const; QModelIndex parent(const QModelIndex &idx) const override;
Qt::ItemFlags flags(const QModelIndex &idx) const; Qt::ItemFlags flags(const QModelIndex &idx) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const; QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
bool hasChildren(const QModelIndex &idx) const; bool hasChildren(const QModelIndex &idx) const override;
bool canFetchMore(const QModelIndex &idx) const; bool canFetchMore(const QModelIndex &idx) const override;
void fetchMore(const QModelIndex &idx); void fetchMore(const QModelIndex &idx) override;
template <class T> template <class T>
TreeLevelItems<T> itemsAtLevel(int level, TreeItem *start = 0) const TreeLevelItems<T> itemsAtLevel(int level, TreeItem *start = 0) const

View File

@@ -22,6 +22,8 @@ QtcLibrary {
return libs; return libs;
} }
cpp.enableExceptions: true
Properties { Properties {
condition: qbs.targetOS.contains("osx") condition: qbs.targetOS.contains("osx")
cpp.frameworks: ["Foundation"] cpp.frameworks: ["Foundation"]

View File

@@ -917,7 +917,7 @@ QString AndroidConfig::getAvdName(const QString &serialnumber)
if (!ok) if (!ok)
return QString(); return QString();
QByteArray avdName = "avd name\n"; const QByteArray avdName = "avd name\n";
QTcpSocket tcpSocket; QTcpSocket tcpSocket;
tcpSocket.connectToHost(QHostAddress(QHostAddress::LocalHost), port); tcpSocket.connectToHost(QHostAddress(QHostAddress::LocalHost), port);
@@ -925,16 +925,15 @@ QString AndroidConfig::getAvdName(const QString &serialnumber)
tcpSocket.write(avdName + "exit\n"); tcpSocket.write(avdName + "exit\n");
tcpSocket.waitForDisconnected(); tcpSocket.waitForDisconnected();
QByteArray response = tcpSocket.readAll(); QByteArray name;
int start = response.indexOf("OK\r\n"); const QByteArrayList response = tcpSocket.readAll().split('\n');
if (start == -1) // The input "avd name" might not be echoed as-is, but contain ASCII
return QString(); // control sequences.
start = start + 4; for (int i = response.size() - 1; i > 1; --i) {
if (response.at(i).startsWith("OK"))
int end = response.indexOf("\r\n", start); name = response.at(i - 1);
if (end == -1) }
return QString(); return QString::fromLatin1(name).trimmed();
return QString::fromLatin1(response.mid(start, end - start));
} }
AndroidConfig::OpenGl AndroidConfig::getOpenGLEnabled(const QString &emulator) const AndroidConfig::OpenGl AndroidConfig::getOpenGLEnabled(const QString &emulator) const
@@ -1288,6 +1287,7 @@ void AndroidConfigurations::updateAutomaticKitList()
debugger.setUnexpandedDisplayName(tr("Android Debugger for %1").arg(tc->displayName())); debugger.setUnexpandedDisplayName(tr("Android Debugger for %1").arg(tc->displayName()));
debugger.setAutoDetected(true); debugger.setAutoDetected(true);
debugger.setAbi(tc->targetAbi()); debugger.setAbi(tc->targetAbi());
debugger.reinitializeFromFile();
QVariant id = Debugger::DebuggerItemManager::registerDebugger(debugger); QVariant id = Debugger::DebuggerItemManager::registerDebugger(debugger);
Debugger::DebuggerKitInformation::setDebugger(k, id); Debugger::DebuggerKitInformation::setDebugger(k, id);
} }
@@ -1334,6 +1334,7 @@ void AndroidConfigurations::updateAutomaticKitList()
debugger.setUnexpandedDisplayName(tr("Android Debugger for %1").arg(tc->displayName())); debugger.setUnexpandedDisplayName(tr("Android Debugger for %1").arg(tc->displayName()));
debugger.setAutoDetected(true); debugger.setAutoDetected(true);
debugger.setAbi(tc->targetAbi()); debugger.setAbi(tc->targetAbi());
debugger.reinitializeFromFile();
QVariant id = Debugger::DebuggerItemManager::registerDebugger(debugger); QVariant id = Debugger::DebuggerItemManager::registerDebugger(debugger);
Debugger::DebuggerKitInformation::setDebugger(newKit, id); Debugger::DebuggerKitInformation::setDebugger(newKit, id);

View File

@@ -92,11 +92,12 @@ RunControl *AndroidDebugSupport::createDebugRunControl(AndroidRunConfiguration *
params.startMode = AttachToRemoteServer; params.startMode = AttachToRemoteServer;
params.displayName = AndroidManager::packageName(target); params.displayName = AndroidManager::packageName(target);
params.remoteSetupNeeded = true; params.remoteSetupNeeded = true;
params.useContinueInsteadOfRun = true;
auto aspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>(); auto aspect = runConfig->extraAspect<DebuggerRunConfigurationAspect>();
if (aspect->useCppDebugger()) { if (aspect->useCppDebugger()) {
Kit *kit = target->kit(); Kit *kit = target->kit();
params.inferior.executable = target->activeBuildConfiguration()->buildDirectory().toString() params.symbolFile = target->activeBuildConfiguration()->buildDirectory().toString()
+ QLatin1String("/app_process"); + QLatin1String("/app_process");
params.skipExecutableValidation = true; params.skipExecutableValidation = true;
params.remoteChannel = runConfig->remoteChannel(); params.remoteChannel = runConfig->remoteChannel();

View File

@@ -354,7 +354,7 @@ AndroidDeployQtStep::DeployResult AndroidDeployQtStep::runDeploy(QFutureInterfac
.arg(QDir::toNativeSeparators(m_command), args), .arg(QDir::toNativeSeparators(m_command), args),
BuildStep::MessageOutput); BuildStep::MessageOutput);
while (!m_process->waitForFinished(200)) { while (m_process->state() != QProcess::NotRunning && !m_process->waitForFinished(200)) {
if (fi.isCanceled()) { if (fi.isCanceled()) {
m_process->kill(); m_process->kill();
m_process->waitForFinished(); m_process->waitForFinished();

View File

@@ -249,13 +249,19 @@ static int extractPid(const QString &exeName, const QByteArray &psOutput)
QByteArray AndroidRunner::runPs() QByteArray AndroidRunner::runPs()
{ {
QByteArray psLine("ps"); if (QThread::currentThread() != thread()) {
if (m_isBusyBox) QByteArray ret;
psLine += " -w"; QMetaObject::invokeMethod(this, "runPs", Qt::BlockingQueuedConnection, Q_RETURN_ARG(QByteArray, ret));
psLine += '\n'; return ret;
m_psProc.write(psLine); } else {
m_psProc.waitForBytesWritten(psLine.size()); QByteArray psLine("ps");
return m_psProc.readAllStandardOutput(); if (m_isBusyBox)
psLine += " -w";
psLine += '\n';
m_psProc.write(psLine);
m_psProc.waitForBytesWritten(psLine.size());
return m_psProc.readAllStandardOutput();
}
} }
void AndroidRunner::checkPID() void AndroidRunner::checkPID()

View File

@@ -79,12 +79,12 @@ private slots:
void logcatReadStandardError(); void logcatReadStandardError();
void logcatReadStandardOutput(); void logcatReadStandardOutput();
void asyncStart(); void asyncStart();
QByteArray runPs();
private: private:
void adbKill(qint64 pid); void adbKill(qint64 pid);
QStringList selector() const { return m_selector; } QStringList selector() const { return m_selector; }
void forceStop(); void forceStop();
QByteArray runPs();
void findPs(); void findPs();
void logcatProcess(const QByteArray &text, QByteArray &buffer, bool onlyError); void logcatProcess(const QByteArray &text, QByteArray &buffer, bool onlyError);
bool adbShellAmNeedsQuotes(); bool adbShellAmNeedsQuotes();

View File

@@ -63,6 +63,7 @@ bool TestVisitor::visit(CPlusPlus::Class *symbol)
{ {
const CPlusPlus::Overview o; const CPlusPlus::Overview o;
CPlusPlus::LookupContext lc; CPlusPlus::LookupContext lc;
const CPlusPlus::Snapshot snapshot = CppTools::CppModelManager::instance()->snapshot();
unsigned count = symbol->memberCount(); unsigned count = symbol->memberCount();
for (unsigned i = 0; i < count; ++i) { for (unsigned i = 0; i < count; ++i) {
@@ -81,7 +82,7 @@ bool TestVisitor::visit(CPlusPlus::Class *symbol)
TestCodeLocationAndType locationAndType; TestCodeLocationAndType locationAndType;
CPlusPlus::Function *functionDefinition = m_symbolFinder.findMatchingDefinition( CPlusPlus::Function *functionDefinition = m_symbolFinder.findMatchingDefinition(
func, CppTools::CppModelManager::instance()->snapshot(), true); func, snapshot, true);
if (functionDefinition && functionDefinition->fileId()) { if (functionDefinition && functionDefinition->fileId()) {
locationAndType.m_name = QString::fromUtf8(functionDefinition->fileName()); locationAndType.m_name = QString::fromUtf8(functionDefinition->fileName());
locationAndType.m_line = functionDefinition->line(); locationAndType.m_line = functionDefinition->line();
@@ -203,6 +204,26 @@ bool TestDataFunctionVisitor::visit(CPlusPlus::FunctionDefinitionAST *ast)
return false; return false;
} }
QString TestDataFunctionVisitor::extractNameFromAST(CPlusPlus::StringLiteralAST *ast, bool *ok) const
{
auto token = m_currentDoc->translationUnit()->tokenAt(ast->literal_token);
if (!token.isStringLiteral()) {
*ok = false;
return QString();
}
*ok = true;
QString name = QString::fromUtf8(token.spell());
if (ast->next) {
CPlusPlus::StringLiteralAST *current = ast;
do {
auto nextToken = m_currentDoc->translationUnit()->tokenAt(current->next->literal_token);
name.append(QString::fromUtf8(nextToken.spell()));
current = current->next;
} while (current->next);
}
return name;
}
bool TestDataFunctionVisitor::visit(CPlusPlus::CallAST *ast) bool TestDataFunctionVisitor::visit(CPlusPlus::CallAST *ast)
{ {
if (m_currentFunction.isEmpty()) if (m_currentFunction.isEmpty())
@@ -214,15 +235,15 @@ bool TestDataFunctionVisitor::visit(CPlusPlus::CallAST *ast)
// first argument is the one we need // first argument is the one we need
if (const auto argumentExpressionAST = expressionListAST->value) { if (const auto argumentExpressionAST = expressionListAST->value) {
if (const auto stringLiteral = argumentExpressionAST->asStringLiteral()) { if (const auto stringLiteral = argumentExpressionAST->asStringLiteral()) {
auto token = m_currentDoc->translationUnit()->tokenAt( bool ok = false;
stringLiteral->literal_token); QString name = extractNameFromAST(stringLiteral, &ok);
if (token.isStringLiteral()) { if (ok) {
unsigned line = 0; unsigned line = 0;
unsigned column = 0; unsigned column = 0;
m_currentDoc->translationUnit()->getTokenStartPosition( m_currentDoc->translationUnit()->getTokenStartPosition(
firstToken, &line, &column); firstToken, &line, &column);
TestCodeLocationAndType locationAndType; TestCodeLocationAndType locationAndType;
locationAndType.m_name = QString::fromUtf8(token.spell()); locationAndType.m_name = name;
locationAndType.m_column = column - 1; locationAndType.m_column = column - 1;
locationAndType.m_line = line; locationAndType.m_line = line;
locationAndType.m_type = TestTreeItem::TestDataTag; locationAndType.m_type = TestTreeItem::TestDataTag;

View File

@@ -94,6 +94,7 @@ public:
QMap<QString, TestCodeLocationList> dataTags() const { return m_dataTags; } QMap<QString, TestCodeLocationList> dataTags() const { return m_dataTags; }
private: private:
QString extractNameFromAST(CPlusPlus::StringLiteralAST *ast, bool *ok) const;
bool newRowCallFound(CPlusPlus::CallAST *ast, unsigned *firstToken) const; bool newRowCallFound(CPlusPlus::CallAST *ast, unsigned *firstToken) const;
CPlusPlus::Document::Ptr m_currentDoc; CPlusPlus::Document::Ptr m_currentDoc;

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