Commit Graph

55184 Commits

Author SHA1 Message Date
Robert Loehning
9636de7cd4 EditorToolBar: Replace optional::value by non-throwing alternative
...to calm down static checker which
fears throwing exceptions into dtors

Change-Id: I7f1a298e8391735d503332a7bce67e10895fbc85
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-16 10:27:59 +00:00
Nikolai Kosjar
7be7d26814 Clang: Show current editor diagnostics in issues pane
This helps to deal with many diagnostics.

Error diagnostics precede warning diagnostis to have them on top.
If no CppEditor is active, no diagnostics are displayed.

Previously one had to scroll the document up and down to locate the
diagnostics. Now they are in a list and can be easily navigated with
F6/Shift-F6. Also, at least for some diagnostics "Get Help Online" from
the context menu seems to provide useful results. For example,
triggering the action on clang tidy issues will open the web browser
with some good hits explaining the issues.

Change-Id: Idabe30b0961d893bee39ccee431e92aeeda1cc26
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-04-16 09:37:06 +00:00
Nikolai Kosjar
dd231fa754 ProjectExplorer: Make Task accept a QIcon
...instead of a FileName.

If requiring a file name, one has to use Utils::Icon::imageFileName(),
which is discouraged according to the comment there. I've tried that and
ended up with a black/white icon. With Utils::Icon::icon() the icon
retains its color.

Change-Id: Id84f514f7408f4b24b74d68b4e9096ceaa0851dd
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-16 09:35:03 +00:00
Nikolai Kosjar
a1e3360236 ProjectExplorer: Allow to add Tasks without TextMarks
This is needed for the Clang Code Model that will also put the
diagnostics into the issues pane. Because the Clang Code Model sets its
own TextMarks, duplications are avoided.

Change-Id: I668a271096cbcad44f03ad49c007ca1a18abc53c
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-16 09:34:55 +00:00
Ulf Hermann
7f2912b036 QmlProfiler: Rename method in statistics model
dataChanged() was too generic and easily confused with other methods.

Change-Id: I68b8bcb609599e56a1a2d3c6cf53d878281f7818
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-16 09:19:28 +00:00
Christian Stenger
7943dfb5a6 AutoTest: Use constant for repeated string
Change-Id: I72b21c4976cabbcd454b2e9ca5cce93e57af0f20
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-04-16 08:39:25 +00:00
Christian Stenger
54f024dba4 AutoTest: Fix handling exceptions while environment setup
If setting up the environment for gtest fails due to an exception
we might end up having no reportable result but we get a return
code of 1 for the test application.
Inform the results pane instead of just ignoring the return code
and explicitly send a fatal result for this.

Task-number: QTCREATORBUG-20280
Change-Id: I05e522764d6302c5b0760c4bc10e01a2248a4494
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-04-16 08:39:06 +00:00
Christian Stenger
96ccb95e6f AutoTest: Avoid unneeded duplication on rebuild
When the rebuild of the tree model has been triggered
due to switching between grouping by filter or directory
it could happen that some children did not get merged
into others due to (insignificant) differences.
Avoid this visual duplication by finding items similar
to the one to be added and if there is one re-use this
instead.

Change-Id: Ife49593638e0af23ffc7353e305be4ea25eb2180
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-04-16 07:47:36 +00:00
Alessandro Portale
db2e962a2f Autotest: Silence Msvc warning
gtestsettingspage.cpp:38: warning: C4138: '*/' found outside of comment

Change-Id: Id68e5e163623684d21d5d7e93652ef0804a46bd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-16 07:47:05 +00:00
Eike Ziller
ab7d8a8fc1 Fix potential nullptr access in editor manager
Introduced recently in f1e02c0826

Change-Id: I9cae829c6c58ed30021b7c29fcde7487bf2ff625
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-04-16 07:36:24 +00:00
Orgad Shaneh
16cf54f6e9 Qbs: Re-add a connection that was lost on merge
Change-Id: I74484fef775da269f7444e2ebb22435d32da9a26
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-16 07:34:44 +00:00
Orgad Shaneh
05125cf146 Qbs: Use project from input target
Changed in recent merge.

Change-Id: I06457929072c1a8937ba702e093a3dff1ce7f2ff
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-16 07:32:29 +00:00
Ulf Hermann
87c12c4e1b QmlProfiler: Store statistics data in a saner way
We don't need to retain the durations after finalize(), and we can use
vectors instead of hashes, as we will cover almost all types anyway.

Vectors allow us to potentially use the position of an item in the data
as its row.

Change-Id: I2c09406f0e0a42f5f517f8444755b1664efb8f3b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-04-16 07:16:35 +00:00
Andre Hartmann
a7cda9a54b ExternalToolsConfig: Fix tab order for path choosers
Change-Id: I6d0d596eddea1c94f92d39f7cc827f54260d8aab
Reviewed-by: Nazar Gerasymchuk <troyan3@gmail.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-04-15 15:24:52 +00:00
Antonio Di Monaco
5784fce244 Fix UI freeze while building with multiple cores / distributed build
When parallelizing the build, and a verbose compiler error/warning
is printed (i.e. a template overload error), the IDE wastes a lot
of time parsing always the same file patterns, and that freezes
completely the UI. The only workaround is to kill the build process
using a terminal.

Implement a file cache, thus mitigating the freeze issue.

Change-Id: Ibcbdb6e6161af7cef424e90f7cfdc2fc34f6d7c1
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Antonio Di Monaco <tony@becrux.com>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-04-13 16:04:08 +00:00
Nikolai Kosjar
a8eeb10630 ProjextExplorer: Update a comment
Change-Id: Idfd5a91c4033f7f0a290e73c9d11592bd01dd11d
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-13 14:20:44 +00:00
BogDan Vatra
429c596395 Android: Fix debugging on Android 8+
The new way is much reliable and now we can debug all the libs from very
first start, including static constructors, JNI_OnLoad, etc.

The downside is that the startup is a little bit slower then before.
On a Ryzen 1700X is 2 to 5 seconds slower.

Task-number: QTCREATORBUG-19081
Change-Id: Iacedf7b8aa84de5026f9c81eeca35dd377cf4640
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2018-04-13 14:05:40 +00:00
Alessandro Portale
f748a5b593 TextEditor: Move the fixit light bulb to Utils
Change-Id: I3128c0363737980a77fa780601f0b245d01540ad
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-13 13:58:57 +00:00
Robert Loehning
5c8844d8f7 CppTools: Don't deref null pointer
Change-Id: I92eade63b4fdc7039ce9b4e0a7db1091fb34d692
Reviewed-by: hjk <hjk@qt.io>
2018-04-13 13:04:15 +00:00
hjk
d21a43d9a8 ProjectExplorer: Introduce runconfig aspects for some bool values
And use it to handle adding extra library path for qbs and qmake and
and the DYLD debug suffix for qmake.

Could possibly be used more uniformly at some stage e.g. for CMake.

Change-Id: I0c4581b4e36960fc76d056c65c487d7c43a1be08
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-13 13:02:59 +00:00
Ivan Donchevskii
c3275c935c Clang: Fix paths in clang patch and its number
Change-Id: I27ab7d3c88cf057ad9505f817e2f211d734e23d4
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-13 12:49:45 +00:00
Ivan Donchevskii
e9c462391e ClangTools: Split generic part from static analyzer tool
To reuse it for other clang-based tools.

Change-Id: I6c0d8e9eee543fa08faf3bf93c9fac33e43c6820
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-13 12:34:53 +00:00
Ivan Donchevskii
8936e51033 ClangTools: Always use CompilerOptionsBuilder for clang tools
We do not ship clang-cl anymore which makes it impossible
to run clang with MSVC options.
Secondly we used to we tweak compiler options quite a bit so
why not to switch to CompilerOptionsBuilder totally?

Change-Id: Id323cb554587afaea7d9aa530e947a45a03922d1
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-13 12:34:35 +00:00
Thomas Hartmann
1bd967badb Avoid parsing the commandline arguments twice
We parse the arguments independently from QApplication
and initialize the settings before we create QApplication.

Therefore we can parse any setting before creating
QApplication which is required for high DPI support.

We use the QApplication argument parsing to filter out Qt
specific commandline arguments like style.

Change-Id: I83ead87476d99351de6fe4f86c96c39a721af47b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-13 12:18:13 +00:00
Christian Stenger
d9dfddac73 AutoTest: Simplify determination of RunConfiguration
Since bc698d4ce6 the build system targets / build keys are
unique on their own.
Simplify the completion of test configurations and improve
readability.

Change-Id: I258e8a35a4740dd58b1365498ca399258092e0e3
Reviewed-by: hjk <hjk@qt.io>
2018-04-13 12:04:45 +00:00
hjk
83c6a4916c ProjectExplorer: Streamline OutputFormatter creation a bit
Note that the concept of a single monolithic OutputFormatter per
RunConfiguration (and why RunConfiguration, not RunControl to start
with?) is unchanged and suboptimal as one cannot easily combine
existing use cases, e.g. Python_and_Qt.

Change-Id: Ibeb8191020387324f22ed313230293597f96e36a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-13 11:55:31 +00:00
Robert Loehning
6a62717271 Squish: Update tst_designer_goto_slot for Qt>=5.10
Change-Id: I29b3788f2daed5ca27069cc8ab9d972bdcee3c02
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-13 11:44:42 +00:00
Eike Ziller
845541c89d Fix compiler warning
Some compilers are picky with types used in ternary operators

Fixup of d44ed66a9f

Change-Id: I73b64592b7741269c6d3631fd0b14cd99c4a3c2a
Reviewed-by: hjk <hjk@qt.io>
2018-04-13 10:56:05 +00:00
Tobias Hunger
3d0459c428 AbiWidget: Improve AbiWidget
Do less work in the Abi widget by ignoring intermediate states. Blocking signals
did not work well enough:-)

This makes the Abi widget more robust since a lot of useless state changes are
avoided. It also reduces the number of abiChanged signal emissions from this
widget, avoiding potentially costly updates in its users.

Change-Id: I777097a165502fade22f9ca3f154314c7362d655
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-13 10:13:08 +00:00
Eike Ziller
193861072d Merge "Merge remote-tracking branch 'origin/4.6'" 2018-04-13 10:13:01 +00:00
Christian Kandeler
33d48093a8 Update qbs submodule
To HEAD of 1.11 branch.

Change-Id: I8f82841f13a45e127864d7a5786f0e48d65a4a56
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
2018-04-13 08:56:15 +00:00
Orgad Shaneh
b41431545f ProjectExplorer: Close write channel for non-terminal processes
There is no way to enter input for those. Don't let them wait in vain.

Change-Id: I3ba023c086d575cbf6be1ad52560767b86b514f4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-04-13 08:55:33 +00:00
Eike Ziller
428fcb476b Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/libs/utils/settingsaccessor.cpp
	src/plugins/autotest/autotestplugin.cpp
	src/plugins/git/gitclient.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.cpp
	src/plugins/qbsprojectmanager/qbsrunconfiguration.h

Change-Id: I65f143cad18af509a2621d6c5925abbd038ea70f
2018-04-13 10:54:42 +02:00
Christian Stenger
9e29a32e1a Utils: Fix compile with gcc4.9
Otherwise compile fails with
 constexpr constructor does not have empty body.
Broke with 4b0bcbdcb6.

Change-Id: I5f058cd4ef11dddb72c8fc88b7184d41f4ffc15a
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-13 05:47:46 +00:00
David Schulz
f4594c922f Highlighter: fix crash after closing file
Regular expression rules are tracked inside the progress data to inform
the rule about a finished highlighting process. A cloned rule was not properly
tracked. That results in a rule that tries to untrack itself on
destruction after the progress data has already been deleted.

Task-number: QTCREATORBUG-20247
Change-Id: I007e7afbc16706bc28f89faf91c0b1c5f0bc692a
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-13 05:10:16 +00:00
Nikita Baryshnikov
c18747c853 clang_installation.pri: Don't add default include paths to LLVM_INCLUDEPATH
Full error:

In file included from /usr/include/c++/7.3.1/bits/stl_algo.h:59:0,
                 from /usr/include/c++/7.3.1/algorithm:62,
                 from /home/nib/Qt/Latest/include/QtCore/qglobal.h:142,
                 from /home/nib/Qt/Latest/include/QtCore/QtGlobal:1,
                 from /home/nib/soft/qt-creator/src/libs/sqlite/
sqliteglobal.h:30,
                 from /home/nib/soft/qt-creator/src/libs/sqlite/
utf8string.h:28,
                 from /home/nib/soft/qt-creator/src/tools/clangbackend/
source/clangcodecompleteresults.h:30,
                 from /home/nib/soft/qt-creator/src/tools/clangbackend/
source/clangcodecompleteresults.cpp:26:
/usr/include/c++/7.3.1/cstdlib:75:15: fatal error: stdlib.h: No such
file
or directory
 #include_next <stdlib.h>
               ^~~~~~~~~~

Change-Id: I590f95b201dc5e3e0ad44f8d2e580b380f31bd7c
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2018-04-12 19:01:00 +00:00
Marco Bubke
438b5736d5 UnitTests: fix spelling
Change-Id: Ib6a94c0fac5fe6ead62a440dbe8c6368cfd7dd57
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2018-04-12 14:38:51 +00:00
Ulf Hermann
d9fb7b2cf1 Timeline: Don't set detail width to 0 if content is undefined
This doesn't do anything useful but messes up the layout.

Change-Id: I4d59f828bced62c873a6eb96f7e0e2a023b8233e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2018-04-12 14:19:09 +00:00
Tobias Hunger
a7e2c4595a SettingsDialog: Use RAII for event loops
With a custom deleter the event loop is exiting. The erase function is
defining the order of deletion.

Change-Id: I50cb166c4e117cbb779db2d1b992221cd1d8ad60
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-12 13:59:25 +00:00
Alessandro Portale
8797123128 ProjectExplorer: Fix warning about signed/unsigned mismatch
Msvc says:
warning: C4018: '>=': signed/unsigned mismatch

Change-Id: Ib3fc4734088bd799271105ed3757d55562efcba3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-04-12 13:36:49 +00:00
Nikolai Kosjar
5f1d035a1b Clang: Backport support for parsing Float128 in stdlib.h
...if GNU_SOURCE is defined.

Task-number: QTCREATORBUG-20258
Change-Id: I0dbe8a2182c1e63fd2dd1bf955640da73da5653d
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-12 13:36:26 +00:00
Ivan Donchevskii
851726aad3 ClangRefactoring: Do not save macros with invalid fileId
Change-Id: I2933fc3695ebf03b3e4f05a0435ca4d629877d2c
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-04-12 13:14:38 +00:00
Marco Bubke
4b0bcbdcb6 Clang: Locator filter for the symbol database
There are no symbol queries for the locator filters. The signature
generation is still not implemented but for simple cases it should work.

Change-Id: Ic6b04fbe1e7e057892f194ac139615c47d6ec33f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-12 13:12:24 +00:00
Marco Bubke
18de1e3fcf Clang: Disable PCHs generation
Some important features are missing so it should be disabled.

Change-Id: I24f8f2cd42c6c4d7152a36db0fe8496e4fb824a6
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-12 13:12:14 +00:00
Marco Bubke
ee85cf4518 Clang: Store the symbol kind in the database
It is cleaning up some other stuff too.

Change-Id: I75274356fd35f2ee8c84aedf8839c67506ab2355
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-12 13:12:08 +00:00
Marco Bubke
b0fd6c30ce Clang: Distinguish between Enum and Records
Creator is distinguishing enumerations and records, so we should do too.

Change-Id: I114cfd207464abd9afd96c26c7504cf8a3a1cb8c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2018-04-12 13:11:51 +00:00
hjk
bc698d4ce6 ProjectExplorer: Consolidate RunConfiguration identifications
The previously per-Project/RunConfiguration changing meanings of
BuildTargetInfo::buildTarget have by now been split
into separate values in BuildTargetInfo:
  - buildKey     a handle to one item in Target::applicationTargetList
  - displayName  a user-visible string in the run settings page

The buildKey was tweaked to coincide with the previous 'extraId',
i.e. the non-RunConfiguration-type part of the project configuration
id that (still) use id mangling.

This allows replacing the cases of locally stored seven different
versions of buildKey(-ish) data by one RunConfiguration::m_buildKey,
and do all remaining extraId handling in RC::{from,to}Map only,
i.e. remove the base ProjectConfiguration::extraId() virtual and
remove the "re-try fromMap with mangled id" hack entirely.

The id mangling is still used to temporarily maintain .user file
compatibility in some cases for now, but should be replaced by
storing the build key and the RunConfiguration type soon. Qbs
already changes in here to only use the uniqueProductName as
buildKey, without the previously added display name which is
stored as part of the ProjectConfiguration already.

It turns out that RunConfiguration::buildSystemTarget was intended
and used to retrieve an item from the Target::applicationTargetList
for some configurations, coinciding with what buildKey does always.
So use that insteand and drop RunConfiguration::buildSystemTarget.

There is clearly is further consolidation potential left.

handling of (default)displayNames is still a per-runconfiguration
mess and there is further consolidation potential left.

Change-Id: I448ed30f1b562fb91b970e328a42fa5f6fb2e43e
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-04-12 12:11:45 +00:00
Christian Kandeler
4ab7c19e84 Let users set a global default for whether to amend the run environment
... with the paths of libraries used at link time. The value can still
be set per run config.

Task-number: QTCREATORBUG-20240
Change-Id: Ibe2425e95d791f93af2fba85a64be8bde6b31f5a
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2018-04-12 11:08:37 +00:00
Marco Benelli
d7f431482d qmljs: handle js directives .pragma and .import
The directives .pragma and .import are not included in the AST.
Their source code locations are not stored in any other place.
As a result, when reformatting the source, they simply disappear.

This patch keep track of their source code locations, so they are
not removed when reformatting the source code.
This patch contains also some modification in the lexer that should
probably be ported to the qtdeclarative version.

Task-number: QTCREATORBUG-13038
Change-Id: I5d568abf02d37a584d4d246939736aaec5af5053
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-12 10:49:46 +00:00
Christian Stenger
c637c66ebb QmlProfiler: Avoid structs with default values
gcc 4.9 and msvc 2015 choke when creating those from initializer lists.

Change-Id: I85936fe33418d5d9ffeb3c910392ad43fbb9a9bb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-04-12 10:30:13 +00:00