Commit Graph

2507 Commits

Author SHA1 Message Date
hjk
19e1cf1520 Replace uses of qVariantFromValue with QVariant::fromValue
Deprecated in Qt 5.14, alternative has been around since Qt 4 at least.

Change-Id: I4e3a53c289088368609e0d0ce2405a832d311308
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-05-27 12:33:29 +00:00
Eike Ziller
6fb9bf453f CMake build: Add ability to disable building of individual plugins
Adds a cache entry "BUILD_PLUGIN_${NAME}", defaulting to ON which
can be set to OFF to disable building of a plugin.

Adds a extend_qtc_plugin function that should be used to add
properties to a plugin after add_qtc_plugin, instead of the
standard CMake functions target_... . The new function results
in a no-op if the plugin was disabled.

Change-Id: I57f6799620aea0aaa8b56acead4815ccced95911
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-05-23 11:13:21 +00:00
Nikolai Kosjar
975173af11 CodeAssist: Ensure perfect match for keywords
...as otherwise the completion windows stays open and gets in the way.

Fixes: QTCREATORBUG-21767
Change-Id: Ib0a841b9d9de52109439f067c466478744361814
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-05-23 08:08:30 +00:00
Christian Stenger
1433a83805 CppTools: Fix build for old compiler
Change-Id: Ia245e9867c4fffe256b0da5708542c88d73ae069
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-05-22 05:03:36 +00:00
Nikolai Kosjar
f7b3e0a6c2 CppTools: Show more project part details in inspector dialog
Change-Id: Ic7c94c9cd83f73cad0603ceb75836fa21768a649
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-05-21 09:19:05 +00:00
hjk
535f0da977 Utils: Make FileName::shortNativePath a member
Change-Id: If1ab02ae9dc7efb97792cdf3bbdce3bba18b3e3d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-20 13:07:38 +00:00
Cristian Adam
d855b84c5d Qt Creator CMake port
Based on Tobias Hunger's work from a few months ago.

The CMake configuration needs libclang and Qt paths specified as
CMAKE_PREFIX_PATH.

Auto tests are run with "ctest". At the moment the pass rate is 87%.

Change-Id: Iba98e39bf22077d52706dce6c85986be67a6eab0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 13:33:28 +00:00
hjk
f4c9e5e5c4 More FileName::appendPath() -> .pathAppended()
Change-Id: I403d34e4f52f758339c158efc7a11fd329e3e043
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-05-17 11:55:04 +00:00
Nikolai Kosjar
e3def98c00 CppTools: Ensure that parse contexts are backed up by a toolchain
Otherwise empty parse contexts (e.g. not having any include paths...)
will be created that are not useful.

Fixes: QTCREATORBUG-22421
Change-Id: I5c9172aee38503d8b48762416e17e7047679bf2e
Reviewed-by: Cristian Adam <cristian.adam@gmail.com>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-09 14:23:40 +00:00
Eike Ziller
e0d38ae414 Export Wizard values to JavaScript macro
Registers a new function "value('name')", available to the wizard json
files, which returns the value of the variable "name" as a JavaScript
object. So, variables with a string value are actual JavaScript strings,
booleans are booleans, lists are lists, and dictionaries are
dictionaries.

The patch also makes it actually possible to assign JSON lists and
dictionaries to values.

This removes some hacks involving creating complex JavaScript objects
through string substitution.

Change-Id: I4ac6da22bc5bccc9fadee97694c2fa14d44c9307
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-09 11:19:43 +00:00
Ivan Donchevskii
cc9d246b02 CompilationDatabase: Asjust the sysroot and target handling
If the sysroot option is found - set it as a kit sysroot (only
in CompilationDatabase project where we have a cloned kit
which does not affect the other existing kits).
In other cases use the backup for the sysroot from the
toolchain (can exist for clang toolchains based on mingw).

Provide target when searching builtin include paths for clang.

Fixes: QTCREATORBUG-22339
Change-Id: Ibe07c2e490ba4f7e0d259e6df698d641dbfd0298
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-04-30 18:00:17 +00:00
Christian Kandeler
24263717f3 Make QtWidgets wizard work with namespaced Qt
Fixes: QTCREATORBUG-19590
Change-Id: Ic003b2b1f580d9a6708e144b690c4cee8d94ff69
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-04-30 10:50:10 +00:00
Christian Kandeler
dfeb024583 C++: Do not apply "Lower-case file names" setting to file wizards
This setting is intended to derive file names from class names. It is
not relevant if the user explicitly provides a file name.

Fixes: QTCREATORBUG-14711
Change-Id: Ic31f8727220d99692286adf9ad0434ce06aa7c62
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-04-25 08:46:51 +00:00
Marco Bubke
5ab057746c CppTools: Add pre system include search path per project
Sometimes you want add a pre system include search path per project to
overload some system header for indexing. This can then even be checked in
the repository.

Change-Id: Ib103e5935d0553aa94522ed736f8c4eb2405a093
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-23 09:08:33 +00:00
Ivan Donchevskii
53c407bc0c Clang: Fix build with clang-8
Clang-Tidy checks and Clazy flags updated.
CLANG-UPGRADE-CHECK done.

Change-Id: I1ca585c5c3c77a7f183719df9c262603150914e8
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-04-17 12:13:36 +00:00
Marco Bubke
a78655e521 Fix Utils::LanguageVersion::None handling
Change-Id: Id0d8bd59c1a317103ea309ee2f9b982ecfd6d6c7
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-04 09:12:50 +00:00
Marco Bubke
56b01f7463 Clang: Minimize reindexing
We optimal indexer is only reindexing if the index would be changed. This
patch is a step in that direction. We only reindex now if the file or
project has changed. It fixes some typos too.

Task-number: QTCREATORBUG-21150
Change-Id: I6ea1c13282fbcd70253b9b2939aed37580dbd160
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-04-02 13:08:44 +00:00
hjk
4f3f73bc3b Utils: Rename one of the FileName::fromString overloads
Overloaded functions are ugly to use in algorithms like transform().

Change-Id: Ia4f191e1cd9a21ceb99dec23a8f4fd1ce5f24182
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-03-19 09:05:47 +00:00
Eike Ziller
c53ccceff1 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/plugins/debugger/debuggerkitinformation.cpp
	src/plugins/languageclient/languageclientmanager.cpp
	src/plugins/plugins.pro
	src/plugins/projectexplorer/kit.cpp
	src/plugins/projectexplorer/kitmanager.cpp

Change-Id: I66fb941202991f35f7d7761430b21e42dfc678a8
2019-03-14 15:51:15 +01:00
Ivan Donchevskii
a0072afd49 Clang: Improve compilation database generation
Do not use CompilerOptionsBuilder anymore because we don't
need much tweaking for projectPart data and can do it better
specifically for the generator.

Fixes: QTCREATORBUG-21936
Change-Id: I00ad872c703598a9a88af29399b428520dd5cb3b
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-03-13 13:17:05 +00:00
Ivan Donchevskii
d9703158ee Clang: Fix language version detection with PCH-s in CMake enabled
Filter out the PCH flags when detecting macros and language version.

Fixes: QTCREATORBUG-21860
Change-Id: I25c63f1409c16db3623d1c8f43ffd5d2bd0f6748
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-03-11 11:33:06 +00:00
Robert Loehning
90bc1c91da Fix quotation marks
Change-Id: I26bd4b9e965a5313569b6e0ef6f606da57b31bff
Reviewed-by: Filip Bucek <fbucek@atlas.cz>
Reviewed-by: Rainer Keller <Rainer.Keller@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-03-05 09:40:54 +00:00
Robert Loehning
118406346e Clang: Fix plurals
Change-Id: I150b9ccdec73ade8826b90036b59332687b84448
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-03-05 09:40:03 +00:00
Eike Ziller
0619de8681 Merge remote-tracking branch 'origin/4.9'
Conflicts:
	qbs/modules/qtc/qtc.qbs
	qtcreator.pri
	src/tools/clangpchmanagerbackend/source/taskscheduler.h

Change-Id: I518adaf647df412887c2a372416634359f09ad2a
2019-03-05 10:22:45 +01:00
Alessandro Portale
af318f9723 CppTools: Fit ClangDiagnosticConfigsWidget on manager's laptop screen
Managers have laptops with small screens. ClangDiagnosticConfigsWidget
had a widget with too big height as minimum size. The Clang Diagnostics
dialog did therefore not fit of Portale's screen.

This patch removes the minimumSize and makes the dialog fit.

Change-Id: I056c10c8a4e51ba4652c30616035a7c649287f58
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-03-04 14:48:50 +00:00
Leena Miettinen
2a7a4f08a3 Clang: Fix UI text
Change-Id: I395aa4311aca8f880a9181e639dddebb306566fb
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-03-04 09:02:09 +00:00
Orgad Shaneh
cbfc6e522d Merge remote-tracking branch 'origin/4.9'
Change-Id: I801042a53ae4d02d1891ea582ca9ea89b00d3181
2019-03-01 13:06:57 +02:00
hjk
6f37348b4c Replace static_casts by QOverload where possible
Mainly to get rid of the QProcess::finished deprecation warning.

Also adjust coding style in the surrounding connects when needed.

Change-Id: I12f9b248c7974b892c4a069356e578e80f8c59e9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 15:18:14 +00:00
Orgad Shaneh
a53032d6a5 CppTools: Move code style snippets to a separate header
Include it only where used.

Resolves many "unused static variable" warnings.

Change-Id: Ie1e578d9b9511f963e359d87f7740b4981975dbd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-02-26 06:06:51 +00:00
Ivan Donchevskii
956543e462 ClangFormat: Add the preview text editor to the settings
Allows the user to see how the current style applies to
the code snippet. The action is triggered by the 'Apply' button.

Change-Id: I820d989519cfdfb6e617ed6e8e9e5751be6619ea
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2019-02-22 14:31:05 +00:00
Nikolai Kosjar
296f7709bd LicenseTemplate: Fix %USER% on Windows
Fixes: QTCREATORBUG-21871
Change-Id: Ibec147b32cc3bd1053e5df07b27838094dc02e88
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-21 07:02:34 +00:00
Eike Ziller
6d43aaf134 Merge remote-tracking branch 'origin/4.9'
Change-Id: I7bdb6a4658c5fca1a7e1dda5adbb5613dabc6d18
2019-02-19 09:08:53 +01:00
Marco Bubke
337155a648 CppTools: Add project directory filter to HeaderPathFilter
For the indexer we want to filter every not builtin include search path to
as system include search path which is not inside of the project or build
directory.

Change-Id: I33663a1f3eb53ec39d5b16a8ca64b57d1b57bd9c
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-18 14:30:02 +00:00
Alessandro Portale
88d1d92728 Bump minimum Qt version (to build Qt Creator) to 5.11
Recent adaptations to Qt 5.13's API deprecations require using APIs
which were introduces in Qt 5.11.

Change-Id: I6c077d824c9ce716e019543b290c355a5d512fad
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-02-15 14:39:12 +00:00
Orgad Shaneh
6fc532f812 Merge remote-tracking branch 'origin/4.9'
Change-Id: If4e8f52fc94c4e5fd9ec69c9000436d4ded913ff
2019-02-15 13:42:44 +02:00
Nikolai Kosjar
9e57c5db5d CppTools: Allow to black list command line flags from project
...for debugging and workarounds if necessary.

Change-Id: If76cddb59fbd8e96f42d141bd5e5d03cd88ab30f
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-12 09:50:21 +00:00
Eike Ziller
d4415b02af Add fallback help IDs to built-in model
Task-number: QTCREATORBUG-15959
Change-Id: I1e022450d09cb0e8565573079e412b26d09ce662
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-02-12 07:40:43 +00:00
Eike Ziller
9c492ce962 Move function to get fallback help IDs to CppTools
To be shared between Clang and Built-in model

Change-Id: Iebe132c93033c252c58da13b858a0dce61483eaf
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-02-12 06:17:58 +00:00
Christian Kandeler
83dd031960 ProjectExplorer: Rename KitInformation to KitAspect
The name "KitInformation" does not properly convey the fact that it
represents a certain *aspect* of a kit. The same goes for
"KitConfigWidget", which in addition was inconsistent with
"KitInformation".
We now use "KitAspect" and "KitAspectWidget".

Change-Id: I9804ee4cedc4d61fad533ea1dd4e4720e67fde97
Reviewed-by: hjk <hjk@qt.io>
2019-02-11 11:55:01 +00:00
Nikolai Kosjar
9d25cb8720 CppTools: Avoid unused values
Value stored to 'newPosStart' during its initialization is never read
[clang-analyzer-deadcode.DeadStores]

Change-Id: Ib8e16cd1bfc3930588e4c10639f463d4f742da0e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 08:43:44 +00:00
Nikolai Kosjar
c62f811c4b CppTools: Fix some clazy level0 warnings
Use midRef() instead [-Wclazy-qstring-ref]
Use multi-arg instead [-Wclazy-qstring-arg]

Change-Id: I74d79c4d9595aabd6b2b621743055b807652383c
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 08:43:38 +00:00
Nikolai Kosjar
12f4b1ee86 CppTools: Modernize
Change-Id: I78af9cd4ccddfa4ed744dce96b772ae5644c89d2
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 08:43:32 +00:00
Nikolai Kosjar
ae388a85b9 CppTools: Fix failing tests
Amends 4dd4d088c5.

Change-Id: I9099dd6fa74b0ad8369234cc7dad4cbe1f8624c8
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-02-08 07:19:16 +00:00
Nikolai Kosjar
f6c46ce35d Clang: Add tooltip action to remove specific warnings/checks
...from the diagnostic configuration.

If no custom diagnostic configuration is set in Projects Mode > Clang,
one is created and set for the current project. Otherwise the current
custom diagnostic set in the project settings is modified.

Change-Id: I5c48280c90f0e807e7333122d504dda302a8b0a9
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-05 15:22:20 +00:00
Nikolai Kosjar
b9d3055e72 Clang: Allow to forward warnings flags from build system
Change-Id: I47ebb1ce4f3b5544408eb1d0f891ed5090394282
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-05 11:36:55 +00:00
Nikolai Kosjar
719749103a Clang: Remove some pointless "this" capture
Change-Id: I8ac56d0ec34128aa33263f171483c36dae608d01
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-05 11:22:39 +00:00
Nikolai Kosjar
c5e43d86d1 Clang: Make diagnostic tooltips consistent
Fix that triggering a diagnostic tooltip from the diagnostic
location/range itself (underlined text) did not show the icon on the
left and the actions/toolbuttons on the right in the tooltip.

Instead of showing the tooltip content itself, request the tooltip for
the corresponding text mark to get the extra decoration and actions.

Change-Id: I5e94aca117a761f7a798d4f4b33db6e386e54d84
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-05 11:22:27 +00:00
Eike Ziller
443931c1da Help: Move resolution of help from multiple candidate IDs to HelpItem
No need for code duplication.

Change-Id: I3d2c795d072b8de5818e1844b8126e526339c0da
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-01 11:28:02 +00:00
Nikolai Kosjar
07c66495d8 Clang: Make some functions available for reuse
Change-Id: I7b85ea104a852c1168578949247efb8387a95f30
Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
2019-02-01 08:16:02 +00:00
Ivan Donchevskii
1dee275f58 ClangFormat: Add cursor position to the indenter interface
Sometimes it's imnportant where the cursor currently is
to properly format the code without affecting the current line.

Change-Id: I8b1fb11d2303adb5f960c7cb80a0ed2e6e45010f
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2019-01-31 10:25:18 +00:00