Commit Graph

288 Commits

Author SHA1 Message Date
hjk
25f5771aa4 Rename QtSupport::BaseQtVersion to QtVersion
... and the Utils::QtVersion enum to Utils::QtMajorVersion to avoid
conflicts.

Change-Id: Ib688c67388272b7204a91444155f60b8c18a56bd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 12:13:19 +00:00
Eike Ziller
9d8a419d10 Remove qmake build files
Removes qmake as a build system for building Qt Creator itself.
Keep them for some tests that are not completely moved to CMake yet.

Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-20 12:18:15 +00:00
Eike Ziller
9091761996 Fix issues with Meson tests
- set temporary directory for launcher
- check for finding meson tool instead of crashing
- use GUILESS_MAIN since it doesn't use gui

Change-Id: I3f8de658d9ccbec3efb260cf2d58e27720e78d47
Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-12 11:47:02 +00:00
Alessandro Portale
9cc2b7aaf3 qmake/qbs/CMake builds: Remove "recommended" dependency on Designer
Recommendation of Designer is the artifact from an earlier solution
for adding code of .ui files to the code model. The refactoring of
extra compilers made that superfluous, this change removes the
left-over traces.

The CMake build of Qt Creator breaks because of the recommendation
if the qttols module is not installed.

Amends: 78d3191363

Change-Id: I64827492d79a9238dc8512047abd581f9da3189e
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-11-17 13:46:07 +00:00
Alessandro Portale
d7ed48ac6f Add missing "emit"s
Change-Id: I88a7397c7689b1e72cdd0e52077f8097443963c0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-11-11 14:10:42 +00:00
Jarek Kobus
f15e5e020a Use QtcProcess in run_meson()
Change-Id: Ib86940984d00de429a6ab138ee767155409f968f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-11-04 16:36:21 +00:00
Jarek Kobus
7958de05f5 Introduce Utils::Singleton
Introduce Utils::Singleton class and
Utils::SingletonWithOptionalDependencies class template
that helps implementing singletons that depend on other
singletons. It's guaranteed that whenever singleton B depends
on singleton A, than A is always created before B is being
created, and that the order of destruction is always
opposite to the order of creation.

Dependencies of singleton are listed as template arguments
for SingletonWithOptionalDependencies class template.
The first argument of SingletonWithOptionalDependencies
class template is always a singleton class itself.

Prepare a common interface for all singleton subclasses:
SingletonSubClass *SingletonWithOptionalDependencies::instance();

Make instantiating singletons and its dependencies thread-safe.

Create singletons on demand (only if some code needs them).
It's not needed anymore to explicitly instantiate
all required singletons in tests.

Make it possible (and thread-safe) to instantiate ProcessReaper
and LauncherInterface singletons in non-main threads.

Make the following dependencies between existing singletons:
   SshConnectionManager depends on:
-> LauncherInterface depends on:
-> ProcessReaper

Change-Id: Iefaacab561c2b3dcf07e7fafbb87339ea6a15278
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-28 10:25:29 +00:00
Christian Kandeler
de8c90e9d9 Meson: Fix autotests
Change-Id: I5f690efe9db19ef8ae6f86ed5556b4939bb52a05
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-09-16 13:26:37 +00:00
Christian Kandeler
939cc5af21 ProjectExplorer: Give build systems a name
... and make it accessible through a variable.

Fixes: QTCREATORBUG-26147
Change-Id: I0601c09a74360b91fe8421876207a8f4ae9d75b6
Reviewed-by: hjk <hjk@qt.io>
2021-09-09 14:41:56 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
Jarek Kobus
000f5aba4f Use QtcProcess for reading version number in meson project
Change-Id: I8f7b72ae9d21fec5a7c8e9baf154dcba70a3a2b3
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Reviewed-by: hjk <hjk@qt.io>
2021-08-31 14:15:07 +00:00
hjk
22ecef0444 ProjectExplorer: Streamline access to buildDirectoryTemplate data
There's only one kind of use, in the context of BuildConfiguration.

Change-Id: I09628ff443ef08e28738125a614c17d5d979189b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-08-24 16:27:33 +00:00
hjk
ef1653698e ProjectExplorer: Use FilePath for ProjectNode::{path,directory}
... and let the fallout trickle down a bit.

Change-Id: I1a2f79e281725c4a121cc2fbbc0377e881616ce5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 08:09:26 +00:00
Andre Hartmann
dbc708fe61 Meson: Fix Qt container detach warning
mesonoutputparser.cpp:152:5: c++11 range-loop
might detach Qt container (QStringList) [clazy-range-loop]

Change-Id: I356969ce680d44e248233358d2a3b2bb90544118
Reviewed-by: hjk <hjk@qt.io>
2021-07-27 08:02:14 +00:00
Cristian Adam
8ed5836746 Project: Remove knowsAllBuildExecutables feature
This is feature is no longer needed.

Change-Id: Ia0798402fcb4c06fb4dd38225359738306211176
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Reviewed-by: hjk <hjk@qt.io>
2021-07-01 15:49:01 +00:00
hjk
fe7d6f0def Utils: Drop QProcess specific parameters from QtcProcess::finished()
Mid-term plan is to concentrate on use of QtcProcess::result()
instead which is a bit more system-agnostic.

There's quite a bit of potential for downstream cleanup by
re-using QtcProcess::exitMessage() now.

Change-Id: I3806b3f5933d96e64b7cfb18cc6c52823fddcbcd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-14 13:31:05 +00:00
hjk
accb1e6e08 Utils: Make QtcProcess::{setW,w}orkingDirectory use FilePath
But keep the old setter for a while to ease transition.

Change-Id: If02b79b1fcd31fbf8b06ef26876c41af891127f9
Reviewed-by: hjk <hjk@qt.io>
2021-06-03 10:31:13 +00:00
hjk
08040e4e94 Utils: Move QProcess base to QtcProcessPrivate
Change-Id: I4c6811d42e051fadfcf32edb664ff3bc09e692e6
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-02 13:21:08 +00:00
Eike Ziller
f18ac508e8 Move CommandLine out of fileutils.h
to ProcessArgs and rename the files to commandline.*.
fileutils was a strange place for CommandLine, and this
reduces the dependencies needed for sdktool.

Change-Id: I9d7e8ffe8a3560f5d12934457b086f9446976883
Reviewed-by: hjk <hjk@qt.io>
2021-05-11 13:27:23 +00:00
hjk
f2f40efa03 Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no
explicit references left to QtcProcess::Arguments and related static
helper functions, so it only clutters the QtcProcess class interface

So move these items out of QtcProcess, later potentially to a separate
file pair.

Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-05-11 09:45:24 +00:00
hjk
8e352af0ec Core: Add a default parameter to various ICore::*path functions
Saves some code on the user side.

Change-Id: I32cd220b6e533f5497a1865f9c34ab9db4cfda79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-04-27 06:52:05 +00:00
Eike Ziller
c1f90aeca2 ICore: Change some path API to use FilePath
Change-Id: Id841d6177206a021c9e606ce560b47d1ae6e52b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-04-26 08:03:47 +00:00
hjk
7eb9d8cb60 ProjectExplorer: Introduce a KitAspect::createManageButton() function
Saves some repetition downstream.

Change-Id: Ied58586572d3e70669c9172c5076bbd12e211aa7
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-19 12:05:35 +00:00
hjk
77481f25ce ProjectExplorer: Base KitAspectWidget on BaseAspect
Enables re-using existing functionality.

The "Make mutable" functionality is still oddly placed. I doubt people
find and use it actively.

Change-Id: Ic6aae17e3a7df093f0f5f234f1e6e1afc196a087
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-04-19 12:02:19 +00:00
Eike Ziller
bce81fd992 Projects: Create QIcons in the UI thread
Creating QIcons elsewhere is not safe because of image reader plugin
loading and the pixmap cache.

Fixes: QTCREATORBUG-25301
Change-Id: Ia22a0cd571f808d7f5c639353fdf2e548743f8ca
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-04-09 13:34:55 +00:00
hjk
c24291648b Meson: Aspectify general settings
This follows suit which what is currently happening in other plugins.

Change-Id: I5fb75e23d7d6add632cd07c732131b4f9793d345
Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-01 12:11:17 +00:00
hjk
035a6ff031 Utils: Avoid intermediate widgets when using LayoutBuilder
In most cases, the layout constructed in the builder was set
on a widget which in turn was put into a vbox in the actual
widget. This is not necessary, but needs some re-ordering.

Also make sure that using not-yet-parented widgets during
layout construction does not cause visible artifacts.

Change-Id: I75727a571da093d3131ea6fba467c2c646cdb6f1
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-03-16 11:37:44 +00:00
hjk
2756794b4f Utils: Drop deprecated Utils::FilePath::{setFilePath,filePath}
Change-Id: I730dfb716f744bbcb62dedf611e93c0d2d358247
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-03-16 08:12:34 +00:00
Alessandro Portale
72d91dc94a Use qAsConst with non-const Qt containers in range-loops
... in various places

Change-Id: Ic6c0c1b9437a1ed402105c7a14a1f5f9454a68d4
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-02-17 14:43:29 +00:00
Alessandro Portale
38a38cd0ed Utils: Fix output formatter "new searchDir found" signalling
Change-Id: Id9bc5cb0641dbac902b7d5af8ee3d00e0308478e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-02-17 12:55:34 +00:00
Orgad Shaneh
dad2b3d84b Merge remote-tracking branch 'origin/4.14'
Change-Id: I7d55c01489dfcdd26fcf3ced9f26539a09073e8c
2021-02-08 12:56:36 +02:00
Orgad Shaneh
8a243aa6ca Meson: Fix tab order in item settings
Change-Id: I0ff2303c64f18fef30dd5e5f06ea47291b036096
Reviewed-by: hjk <hjk@qt.io>
2021-02-08 08:26:53 +00:00
Alexis Jeandet
303008a09a Meson plugin: Fix segfault when switching build type
Change-Id: I837e0a7ba8dd731438d36cfb766fd60c9643be73
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-02-04 09:28:41 +00:00
Eike Ziller
c245a642f2 Share "auto-detected" UI string and add tool tip
No need to have the same translatable string repeated at all these
places.
Also add tooltip to expand a bit on what "auto-detected" actually means.

Task-number: QTCREATORBUG-25291
Change-Id: I25d43486758ba17256cf7e1ea2eea0ec3d567b62
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-29 15:04:05 +00:00
Cristian Adam
707a3cfaf3 CMakeProjectManager: Use CMAKE_HOME_DIRECTORY as source directory
The CMakeCache.txt file has CMAKE_HOME_DIRECTORY pointing to the
project source directory used to configure the project.

When importing a cmake build the CMAKE_HOME_DIRECTORY from
CMakeCache.txt might not point to the same CMakeLists.txt that was
opened as a project.

qt-cmake-standalone-test from Qt6 uses a CMake template project which
does a add_subdirectory with the test source directory, which will not
work if opened standalone.

Normally this is a user error though, so ask the user if this was
intended, before actually importing the build.

Task-number: QTBUG-88776
Change-Id: Ifdd5e1d1cb8a1ef9955d22493eba3a1a55dc689f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-01-08 16:25:24 +00:00
BogDan Vatra
7a6bfbcfbe Allow the user to add custom parameters to meson
Don't use QtCreator's autogenerated native-file if the user passed a
custom one or a cross-file.

Change-Id: Ic1793df2578b6f5295cad88f0dc003666e5f16c1
Reviewed-by: hjk <hjk@qt.io>
2021-01-04 12:47:26 +00:00
Cristian Adam
5271a5c782 Utils: Add Qt6 to QtVersion enum
Change-Id: Idb00fde1459d00caaf263a21eecb96e6f6bd6fd9
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-23 11:12:56 +00:00
Eike Ziller
db2b085010 Meson: Use new message manager API
Avoid bringing general messages pane to front.
Flash when starting a process, write output silently afterwards.
Put an error into issues pane if parsing fails
Also don't log debug messages by default.

Task-number: QTCREATORBUG-24430
Change-Id: If4cbc1f48b0749b44410e2ac14d6796d63e4610e
Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-12-07 13:05:36 +00:00
Jarek Kobus
48c2afe157 Decorate some classes and methods with final keyword
This way we silence the clang warnings about calling
virtual methods from c'tor or from d'tor:
[clang-analyzer-optin.cplusplus.VirtualCall]

Change-Id: I8d6318b490152133da4833bda2ba28622bce30dd
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-19 09:45:53 +00:00
Alessandro Portale
30aec82285 Add missing "final" to unexported/unshared classes
Change-Id: I84d5fc39d7ef5588a20545854d0cfd0b993db090
Reviewed-by: hjk <hjk@qt.io>
2020-11-18 15:40:29 +00:00
Eike Ziller
381c5656e7 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/mesonprojectmanager/project/mesonprojectparser.h

Change-Id: Id38d20ce20981dcdc322fe5d1d7647f4bec89d8a
2020-11-13 16:03:26 +01:00
Alessandro Portale
d30d0e05d8 MesonProjectManager: Add .qrc file to the Qbs project
Fixes the error message:
Could not load image:  ":/mesonproject/icons/meson_bw_logo.png"

Change-Id: I41487f827cda9885b525b658117ff04eefb503e8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-12 18:41:10 +00:00
Jarek Kobus
2b414508b7 Remove unneeded includes
Change-Id: I67fee9303509b7080e123a2a5826e200ce498ce2
Reviewed-by: hjk <hjk@qt.io>
2020-11-12 12:14:11 +00:00
Nikolai Kosjar
888ea6bbbb CppTools: Take "-include" files into account
Fixes: QTCREATORBUG-20602
Change-Id: Ibfc518fc64ed75f93265db800558ec1d2e424bb4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-05 08:49:24 +00:00
hjk
eedb702bb9 Meson: Make spacing and #include ordering a bit more consistent
Not 100%, but a step forward.

Change-Id: I6957edbd24c1652b228a96a68424b857603aae45
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-03 09:18:10 +00:00
Alexis Jeandet
09eeab7737 Meson: partially clang-format all files
Change-Id: Ie621792417e89aa732311129f0cfa99a5147183a
Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-03 07:24:17 +00:00
Alexis Jeandet
cfcfb304fa Meson: Replace most std::for_each by range based for
Change-Id: I18aa38bb84264e0f6a99f431c1caaded9bbbe248
Reviewed-by: hjk <hjk@qt.io>
2020-10-28 09:16:27 +00:00
Alexis Jeandet
36632330ca Meson: Only trigger meson introspection files parsesing on file change
FileSystemWatcher was triggered before meson-info.json was written which most of the
time did just ignore last changes. When meson plugin is parsing the project, it discardes
all new parsing requests.

Change-Id: I20c8e95e5ed330628614a9fe1485394fd6b9fde8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-27 12:51:20 +00:00
Alexis Jeandet
8b23b6efbe Meson: List files from extra_files target field in project tree
Fixes: QTCREATORBUG-24824
Change-Id: Id37bdaea08fb527398195ac16f99fe3c00d36566
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-10-27 12:51:14 +00:00
Robert Loehning
91fb438b94 Remove invisible translated strings
Change-Id: If03c1e5d160d375e3a8ecd2c534214e3c92ae918
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-10-19 10:01:04 +00:00