Commit Graph

2674 Commits

Author SHA1 Message Date
Federico Guerinoni
3b995f7623 Remove export for class as TODO
Change-Id: I6ffe7b291a63d4f191528185505b02da6c0c9901
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-30 07:13:39 +00:00
Eike Ziller
c8a2ea5433 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/qmldesigner/components/curveeditor/detail/graphicsview.cpp

Change-Id: I2a0ccb84560174c5170d5baaff526c0e095f0ba0
2020-03-19 09:35:50 +01:00
Leena Miettinen
dd91e8e062 CppTools: Fix UI text according to the guidelines
https://doc.qt.io/qtcreator-extending/qtcreator-ui-text.html

Task-number: QTCREATORBUG-23683
Change-Id: I35a1782f62514dfb6ea7e1e3cf334c8a5615fd74
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-16 08:28:53 +00:00
Eike Ziller
95d41fa23e Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/qmldesigner/designmodewidget.cpp

Change-Id: I94a94a15df433d6caa8922fccaa69918b5e4e365
2020-03-11 07:29:47 +01:00
Christian Kandeler
ce3103194f CppTools: Fix code model with clang and precompiled headers
Amends a1d22fd2f7.

Fixes: QTCREATORBUG-22897
Change-Id: Iaadf72d78e11279c8dd553860e00be9d29135752
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-03-09 11:31:42 +00:00
Eike Ziller
995ba78fae Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/cmakeprojectmanager/tealeafreader.cpp
	src/plugins/cmakeprojectmanager/tealeafreader.h
	src/plugins/projectexplorer/miniprojecttargetselector.cpp

Change-Id: I88d85be3903f57a55fddb7901e771a4822db1b85
2020-03-04 08:15:50 +01:00
Andre Hartmann
d76a2f4fcd Deduplicate elapsed time formatting
While it's nice to see my code spreading,
I still prefer to have it at one place.

Change-Id: I7bdb13c47ed7e96227deeb14b0a8070aa40148de
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-02-29 18:21:47 +00:00
Christian Kandeler
bcc2b5e08d "New Class" wizard: Try to find a base class header
If the project has a header file whose name suggests that it might
declare the base class, then add an include statement for it.
While we cannot guarantee that the include statement is resolvable as-
is, it's at least a basis for the user to adapt accordingly, while
without any include statement the class will definitely not compile.

Fixes: QTCREATORBUG-3855
Change-Id: I55ec43d58a9a13b9b59a5bbe6415a457b974b654
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-27 13:28:23 +00:00
hjk
aeef7137a2 CppTools: Work around a endl warning
And drop some foreach use.

Change-Id: I2ba4762cf6c5c8de7262a47044f65624d585e21a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-25 09:27:56 +00:00
Cristian Adam
b7bfcc3786 CppTools: Do not reindex all sources on project update
When CMake was run it would cause an update, which would have a
cancelAndWaitForFinished on the future interface.

The CppTools would have the future interface added on all updates, and
even though an indexing job would be finished, it would be picked up as
active and cancelled, which would be interpreted as action from the user
to cancel the indexing and cause a full reindex.

This patch makes sure that if an indexing job has finished, it doesn't
register as active, and only the jobs that actually do some work, and
will be finished will wait for the cancel signal.

Change-Id: If8a4db2a4a7a5707a360db84affe794ab0678d38
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2020-02-20 13:53:36 +00:00
Eike Ziller
d43f1662d0 Make TextEditor setup more flexible
So far it was only possible to combine TextEditorFactory, BaseTextEditor
and TextEditorWidget directly.
That TextEditorWidget is also directly a QPlainTextEdit made it
impossible to "decorate" the text editor widget with something else
without a lot of effort.

Make it possible to create a text editor factory that returns an
arbitrary widget, as long as it can be "cast" to a TextEditorWidget with
either qobject_cast or Aggregation::query. That way the TextEditorWidget
instance can be attached to the editor widget via Aggregation.

Adapt other code that accesses TextEditorWidget from editors
accordingly. Introduce a common method how to do that.

Change-Id: I72b8721f3a8a8d8281c39af75253e9c80cbe1250
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-02-12 10:28:31 +00:00
hjk
ede1d31a3f CppTools: Make CppCodeStyleSettingsPage a plugin pimpl member
Change-Id: I75f90ddbb3cb1f2dbded16c8b6eb6d6c9bbc9f50
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 17:00:22 +00:00
hjk
7e326657e9 CppTools: Use a plugin pimpl data member for CppToolsSettings
Change-Id: I05c2f8f34b88973fc916115f71c0557675396366
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 16:27:52 +00:00
Christian Kandeler
cd9571b4f7 CppTools: Optionally move raw project parts creation into thread
... by letting callers pass in a generator function.
This takes some load off the UI thread for larger projects.
For now only used by the QbsProjectManager, which can provide a thread-
safe generator function due to the project data existing in "value"
form.

Task-number: QTCREATORBUG-18533
Change-Id: I525dea36a4c4079bd1bd5a4fff844617547d56f1
Reviewed-by: hjk <hjk@qt.io>
2020-02-06 15:53:46 +00:00
hjk
e3e6cece89 CppTools: Use a normal plugin pimpl member for CppModelManager
Change-Id: Id2c4b098084808070ef91de13c8338184e52141d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 12:24:21 +00:00
hjk
fd5461b93d CppTools: Use a normal plugin pimpl member for StringTable
Change-Id: I2804b623b7ec03f6f4375452c9a422604468aafa
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-06 09:51:40 +00:00
hjk
582b0216c6 CppTools: Remove yet another flag initialization with nullptr
Change-Id: I35b1033f8b69b5564fcf86a6406c486be0e90bbf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-06 07:52:13 +00:00
hjk
ea6da69e8b CppTools: Move CppFilesSettingsPage closer to new setup
Including some drive-by cosmetics.

Change-Id: Id9cdba68545907b099a70944c83fe17ad3c0b2a0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-02-05 12:42:42 +00:00
Igor Sidorov
a9e40ad14c Add final specifies to classes
Warning -Wfinal-dtor-non-final-class in clang trunk

Change-Id: I2bf17064bf8898eab10b82b69583a283157766d0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-05 09:33:55 +00:00
hjk
36f23df6c3 CppTools: Use unshared object for CppCodeModelSettings
There's nothing shared here, only ever one copy. Ideally, this
should be const outside CppToolsPlugin, but some settings
are modified directly.

Change-Id: I775b9151a244b3cc44d28bc992a041c42d234a18
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-02-04 07:55:01 +00:00
Christian Kandeler
cc32cabd4f CppTools: Give early warning if kit has no compilers
We keep getting bug reports from users who forgot to set a compiler in
their kit and then get confused by (misleading) warnings from the code
model.
Improve the situation by detecting the condition that a C/C++ project's
current kit does not have a C/C++ compiler and showing a warning for
that in the issues pane.

Task-number: QTCREATORBUG-23247
Change-Id: I10164e85ad595f3a386340e7813d1f3e40fbecb5
Reviewed-by: hjk <hjk@qt.io>
2020-01-31 15:13:47 +00:00
hjk
c3f7ef5340 Several SettingsPages: Code cosmetics
De-Q_OBJECT-ify, remove unnecessary #includes, final-ize, etc.

Change-Id: I461d3e73400dacac90c22e7c84a40e3ea1718b6e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-01-30 15:04:58 +00:00
hjk
2c865a771c TextEditor: De-noise ICodeStylePreferences setup a bit
Change-Id: I6c3fcbb6ef17c7ca5771326b1444f057cc150e3d
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-29 06:30:48 +00:00
hjk
811f4a38da Use less nullptr for empty flags
Change-Id: Ic4eafdc8f204a432a752a97593380609a408a7de
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-21 13:28:26 +00:00
Alessandro Portale
8c6e6d1dbd Don't initialize QFlags unnecessarily
And if needed, do it with {} instead of with nullptr or 0.

Change-Id: Iae80253cd334494cfe1d69ec1552d710f2a31ad2
Reviewed-by: hjk <hjk@qt.io>
2020-01-21 10:07:22 +00:00
Alessandro Portale
24a25eed14 Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-20 20:56:57 +00:00
hjk
7e19d1af7c Use even less nullptr for default flags
Change-Id: I5ec30de3e41dfc1c7bf6d5f5e36991eadcbbfb72
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-20 10:09:23 +00:00
hjk
57c41edf54 CppTools: Apply new SettingsPage patterns
Change-Id: Id7410041d5813dc3df9aeb650074f961e394cd2d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-01-17 14:47:00 +00:00
hjk
d43b793dd8 Core: Introduce a IOptionsPage::setCategoryIconPath
Less noise on the user side.

Change-Id: I34dea09e8a3c8639f5a7db89b22f8b825b946395
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-16 09:53:45 +00:00
Nikolai Kosjar
1b4de8d769 ClangTools: Add help context menu entry
...that opens the documentation page for the current diagnostic.

Change-Id: I398fdc82bb118a80536acbb12420a9bac84e66c9
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-13 14:33:55 +00:00
Christian Stenger
2f5365bf61 CppTools: Fix compile due to ambiguous namespace
Change-Id: Ie1bfac86253e5152f65ab8e8de720be3b1dde8ea
Reviewed-by: hjk <hjk@qt.io>
2020-01-09 10:31:02 +00:00
Eike Ziller
69bcf7ca60 Merge remote-tracking branch 'origin/4.11'
Change-Id: Ica0d173a08ff3f0296e875aa324d5bb6974bd90f
2020-01-08 07:13:32 +01:00
Christian Kandeler
c5473762ed Move ProjectExplorer::WarningFlags to a more suitable location
No need to waste a (badly named) header file on that one type.
Also fix typo in enum value.

Change-Id: I0cd4e3cda9383c3ab197ae6788666324a1dce43d
Reviewed-by: hjk <hjk@qt.io>
2020-01-07 14:27:01 +00:00
Jarek Kobus
f6659f24df Fix layout of the code style settings editor
Fixes: QTCREATORBUG-23227
Change-Id: I1ae650ba1e66c9444ef0d7fe17d003e5d6662b77
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-06 10:54:13 +00:00
Alessandro Portale
8a1daa15fa ClangTools: Use Utils::InfoLabel in ClangDiagnosticConfigsWidget
Task-number: QTCREATORBUG-23346
Change-Id: I39016adae451c5212643e412d5700b89915cb2e4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-01-03 12:28:32 +00:00
Eike Ziller
92546d0983 Merge remote-tracking branch 'origin/4.11'
Change-Id: I0657cee6b87eea7b3178548bebed85d5ac824519
2020-01-03 08:57:33 +01:00
Nikolai Kosjar
26693e8212 Revert "Clang: Stop enabling exceptions explicitly"
This reverts commit b114f77d8a as
"--driver-mode=cl" apparently still disables exceptions.

Task-number: QTCREATORBUG-23000
Change-Id: I9c49d971fafda5e1aca8445f8921e50f323d368f
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-20 22:46:02 +00:00
Nikolai Kosjar
4fdd944617 Clang: Fix removing gcc internal include paths
Amends 5165c037eb.

Gentoo has the standard library headers installed in e.g.
<installdir>/include/g++-v8 and we excluded those. MinGW with the
standard library headers in <installdir>/include/c++ was whitelisted.

Instead of whitelistening more dirs that could contain standard library
headers, regard

  <installdir>/include
  <installdir>/include-fixed

as gcc internal include paths to remove. These seem to be stable across
distributions.

Task-number: QTCREATORBUG-23330
Change-Id: I44965d2030b4ea5a9dd269400faf19c3df89f5a6
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-20 22:45:31 +00:00
Nikolai Kosjar
2de52cffb1 Clang: Fix c++98-compat warnings for MSVC toolchain
Clang invoked with --driver-mode=cl will map "-Wall" to "-Weverything",
thus enabling -Wc++98-compat-pedantic and way more options.

Fix this by escaping "-Wall" in the cl mode, effectively passing in
"/clang:-Wall" instead of "-Wall".

This fixes what 5675169e56 addressed also
for ClangTools.

Change-Id: Ideb7bab923d0359e8039b61e9d53c8765de79c29
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-12-19 12:04:56 +00:00
Nikolai Kosjar
548e798885 TextEditor: Fix typo in a TextDocumentLayout function
Change-Id: I17153d9bfe9820f3ccc88f54bce1d494a522be33
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-12-18 10:15:50 +00:00
hjk
e109b731ad Utils: Rename FilePathList to simply FilePaths
The exact storage type does not really matter here.

Change-Id: Iefec40f0f5909c8e7ba3415db4a11962694e1b38
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-18 08:43:18 +00:00
Eike Ziller
267946d100 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri
	src/plugins/boot2qt/qdbrunconfiguration.cpp
	src/plugins/boot2qt/qdbrunconfiguration.h
	src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp
	src/plugins/qnx/qnxrunconfiguration.cpp
	src/plugins/remotelinux/remotelinuxrunconfiguration.h

Change-Id: I17c8e1bf300bb75d7317ccf7749dd3cc07709c21
2019-12-16 16:19:44 +01:00
Cristian Adam
5675169e56 CppTools: Suppress the c++98-compatibility warnings
Fixes: QTCREATORBUG-23118
Change-Id: I3c29faa05cb77841b22201dce01b341e565ca32d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2019-12-13 14:45:48 +00:00
Alessandro Portale
116451ba1b CppTools: Update clang-tidy documentation URL
8.0.0 -> 8.0.1

Change-Id: Ic58777d2e97711e12e208c1b2a709bb0a9279e41
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-12-11 05:48:50 +00:00
Nikolai Kosjar
7bb333f15a CppTools: Add convenience functions to ClangDiagnosticConfig
Change-Id: Iebf01e1ab71dc3500cc6e492c525735f300272ca
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 13:24:11 +00:00
Nikolai Kosjar
dcb35676df Clang: Clean up TidyMode/ClazyMode enumerators
Change-Id: Ie3ff0d629fd3c115df9c527e9ae8d7962fcfa156
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 13:23:38 +00:00
Nikolai Kosjar
7d851c12ed ClangTools: Remove pointless "Disable" setting for clang-tidy
...as unchecking the root item in the tree has the same effect.

Change-Id: I960ea2c09a71dad3b0ba3dfb38a19055653354cd
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 13:23:26 +00:00
Nikolai Kosjar
0d7a30cdfe ClangTools: Query the tools for supported checks
...instead of hardcoding them for a particular version of
clang-tidy/clazy.

While at it, move also the tidy/clazy widgets to ClangTools as this
simplifies feeding data to them.

Reduce also the built-in configs to a single one using clang-tidy's and
clazy's default checks as they look very reasonable and saves us some
porting effort. Also, our previous built-in configs were just too
numerous.

Change-Id: Ib9297acb7810a940b86a23a8695530506a570394
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 13:23:13 +00:00
Nikolai Kosjar
3090e744c2 ClangTools: Polish ClangDiagnosticConfigsWidget
* Improve distinction between built-in and custom configs by introducing
  corresponding parent nodes
* Add button to rename a config
* Make closing the dialog apply the selected config.
* Adapt also the related ClangDiagnosticConfigsSelectionWidget showing a
  combo box of the diagnostic configs and a "Manage..." button: Remove
  the combo box and show the current config as the button text.

Change-Id: Ic015df37f2532f84bd7da6cd20bfce07799a97b8
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-12-03 13:22:28 +00:00
Nikolai Kosjar
62791a61fc Clang: Improve tab names
Change-Id: I24f963cfdf6c7a10fcaef96cf622c156b421d2b4
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2019-11-29 09:31:37 +00:00