Commit Graph

177 Commits

Author SHA1 Message Date
hjk
93e188ab94 QtSupport: Move QtVersionManager closer to "new" singleton pattern
Not 100%, as there are a few more local variables involved.

Change-Id: I15458d614c381862aa6f9e1c54d56c045bac8941
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-08-31 11:52:11 +00:00
hjk
41184bc9fc Utils: Use numberedKey(Key, int) more wildly
Will ease transition to a key class that doen's have ::number()

Change-Id: Ib2f2957c916f41b0731a2033422bfbf7e429bcc8
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-30 09:57:23 +00:00
hjk
271405e08e QtSupport: Don't save QtVersions directly after creation
Change-Id: I379262734bf11776d77576b8fca698ce691654b8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-30 07:22:53 +00:00
hjk
23149b27ab Utils: Introduce variantFromStore and storeFromVariant
These are functional replacements for
  QVariant::fromValue(QVariantMap) (or QVariant::fromValue(Store)) and
  QVariant::toMap() (or QVariant::toValue<Store>())

We will have a few code paths in the end that need to explicitly
operarate on both QVariantMap and Store (e.g. actual reading/writing
to keep format compatibility etc), so these can't in the end be
simple to/fromValue(OneType) but need an internal 'if' or such.

Change-Id: I954f3cb24fa8fe123162b72bbd25d891dd19b768
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-28 11:16:40 +00:00
hjk
8d0aa34bfc Plugins: A bit more Keys and Store
Change-Id: Iee55eeaa881dd9f2047fdbe95ad8d827f4ba34e0
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 08:00:02 +00:00
Jarek Kobus
8dd46d0399 Various Plugins: Simplify return FilePath statements
Change-Id: Ia9efb86f722caca1492b577d51442f1f23b804b4
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-08-02 08:19:23 +00:00
Jarek Kobus
a0f6e8dc04 Utils: Rename qtcprocess.{cpp,h} -> process.{cpp,h}
Follows QtcProcess -> Process rename.

Change-Id: I97235a9a40cb7fd52944515b7ab878d96528f919
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 05:52:26 +00:00
Jarek Kobus
470c95c94b Utils: Rename QtcProcess -> Process
Task-number: QTCREATORBUG-29102
Change-Id: Ibc264f9db6a32206e4097766ee3f7d0b35225a5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2023-05-04 05:52:16 +00:00
Jarek Kobus
a5ad722184 QtVersionManager: Fix a warning about missing initializer
It fixes the following warning:
warning: missing initializer for member
‘QtSupport::Internal::ExampleSetModel::ExtraExampleSet::qtVersion’

Amends bdfa412b14

Change-Id: Ieb984664953f53d458297970e09678c499a26197
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-04-19 08:45:44 +00:00
Tim Jenßen
feabda3aa7 Merge remote-tracking branch 'origin/10.0' into qds/dev
bigger conflicts resolved at:
  src/plugins/qmldesigner/CMakeLists.txt
  src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
2023-03-26 16:26:18 +02:00
Tim Jenssen
a18ab6b11f QtSupport: allow relative paths for the qmake command
This change makes it possible to bake in settings for bundled/shipped
Qt versions like we have in the QtDesignStudio.app package.
The result is that the installer does not need to write absolute
paths to the settings anymore, so it stays like it was signed.

A signed package on macOS is more and more necessary
and recommended for a while. Especially If the application will
touch files in special folders like Download, Documents, or Desktop.

Change-Id: I3153ffd4229b34a59bdfe740937c21ee93de3e9b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-02-09 13:55:56 +00:00
hjk
3ff5661327 Move some FileSystemWatcher usages to FilePath
Change-Id: I72d24ae3f819e429009b0d7e42b21957f07cb00a
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-27 08:18:49 +00:00
hjk
4ddd28ae22 Utils: Rename QtcProcess::readAllStandard* to readAllRawStandard*
... and re-use the old QtcProcess::readAllStandard* names for
a QString-returning 'decoded' version.

For now, only use that in 'full Utf8' cases, to stay bug-compatible,
the plan is, however, to employ the QTextCodecs we have already
in the channel buffers. That will be one-by-one, though.

Change-Id: Id209e0671920d4ea4197918e872f441254112d52
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-01-10 12:08:53 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
hjk
c7c6ddb8b0 Utils: Replace Environment::isSameExecutable()
... by FilePath::isSameExecutable().

The only non-mechanical case is the use inside QmakeBuildSystem::testToolChain
using a build environment instead of the FilePath's device environment.

This make a difference in theory due to the use of PATHEXT in the actual
check, but I believe the case that someone creates a 'qmake.foo' and
a 'qmake.bar', adds .foo and .bar to PATHEXT and then complains that
there's a warning missing about not-matching mkspecs has zero
likelihood in reality (and will break other places in Creator anyway).

Change-Id: Id6a8d1e4dc2eb74ca81610ccb1c4ee94c6f47e12
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-11-23 08:07:08 +00:00
Christian Kandeler
13f40f5471 Utils: Add sorted() function
For simpler calling code.

Change-Id: Ia0a16a28770fd172f74d06a626148248bf5d3c0c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-10-25 14:29:45 +00:00
Marc Mutz
8eb4d52342 Port from qAsConst() to std::as_const()
We've been requiring C++17 since Qt 6.0, and our qAsConst use finally
starts to bother us (QTBUG-99313), so time to port away from it
now.

Since qAsConst has exactly the same semantics as std::as_const (down
to rvalue treatment, constexpr'ness and noexcept'ness), there's really
nothing more to it than a global search-and-replace.

Task-number: QTBUG-99313
Change-Id: I88edd91395849574436299b8badda21bb93bea39
Reviewed-by: hjk <hjk@qt.io>
2022-10-07 13:47:53 +00:00
Alessandro Portale
a917770053 Replace QtSupport::QtVersionNumber with QVersionNumber
Task-number: QTCREATORBUG-27786
Change-Id: I71a44709c264829f629c9dfce702076eda297a77
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-09-19 12:08:39 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Christian Kandeler
958531adbf Revert "QtSupport: Add support to register Qt versions via qtpaths"
The patch breaks several plugin unit tests; at the very least QtSupport,
AutoTest and ClangCodeModel.

This reverts commit 72aa77ced7.

Change-Id: Iaa7f452d0f43d0072b0bbcf8934fa0dcd6f9b240
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
2022-06-01 14:24:20 +00:00
Alessandro Portale
72aa77ced7 QtSupport: Add support to register Qt versions via qtpaths
qmake is a "build tool", and it is also a "query tool" when called with
parameter "-query". Qt Creator, so far, assumes that building and
querying with a Qt installation are done with one and the same tool:
qmake. This change adds the ability to register a Qt version vie either
qmake or qtpaths and still build with qmake, if that is installed (which
is not anymore mandatory from Qt 6 on).

1) Distinguish between Qt query tool and qmake build tool:
Add QtVersion::queryToolFilePath() to the existing
QtVersion::qmakeFilePath(), and use queryToolFilePath in most "query"
related code, and qmakeFilePath when building with qmake (e.g. in
QmakeProjectManager).
Also, a couple of functions and variables were renamed from *qmake* to
*queryTool* in order to express that the affected code is about
querying/managing Qt versions rather than about building with qmake.

2) Support manual Qt Version adding by qtpaths via file dialog
This change adds qtpaths to the "Add" Qt Version file picker filter.
After selection, "qtpaths -query" is executed for testing purposes. If
that fails, (e.g. because it is an older Qt version), qmake is instead
chosen, silently.

Task-number: QTCREATORBUG-22175
Task-number: QTCREATORBUG-25546
Change-Id: I4d9c1e7eec7d5ae7c5a8d2e1a1ed95addff69966
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-06-01 06:09:48 +00:00
hjk
a48a96e05c QtSupport: Introduce a type alias for QList<BaseQtVersion *>
Change-Id: I96b0eccc04da2f4a1a4e5ea9bdceb91b3fa3d724
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-01-24 14:38:20 +00:00
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
Jarek Kobus
8e8e8ddead Use QtcProcess in runQtChooser()
Change-Id: Ied2c58eb522e9ae9e5f312dce98b66bc852f41a7
Reviewed-by: hjk <hjk@qt.io>
2021-11-04 09:44:43 +00:00
hjk
324ff024d7 QtSupport: Rename BaseQtVersion::autodetection* to detection
It's also used for manually triggered detection nowadays and
closer in naming to what kit, debugger and kit have.

Change-Id: I68705aafe297d61afc8b5918650e47353d3ccce1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-07-14 10:19:05 +00:00
Tim Jenssen
22121885fe baseqtversion: commands are FilePathes
also renamed the qmlscene* qmlRuntime*

Change-Id: Ifd522e21f5ce30aaa54060fdcebee2cd8b9463c4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-07-14 09:50:01 +00:00
hjk
2ceb105323 Utils: FilePathify BuildableHelperLibrary
Change-Id: I18791de1ed69e598b6c35cbae4ba28ac8129e9de
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-01 06:33:38 +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
Eike Ziller
02a27a9bb6 QtSupport: Use new settings API
Avoid writing defaults to the settings.

Task-number: QTCREATORBUG-24430
Change-Id: Ic068ade0d34a66e1baf067d90d63e01b0d0e73c0
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-22 12:28:58 +00:00
Eike Ziller
1dcb7e5550 Help: Register at least one set of documentation per major Qt version
The default configuration only registers documentation files only once,
from the highest registered Qt version. This made sense within the Qt 5
series, since Qt documentation for the higher version included all items
from the lower versions.

With Qt 6 this changes - some API was removed in Qt 6. To make sure that
documentation of all Qt 5 API is still available, we have to register
the newest available documentation for Qt 5 and Qt 6, not only of Qt 6
(the overall newest available documentation).

Expands 3dfa188182

Change-Id: I8b2984b0be11dcc823ef4a206800c84887b632ca
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-20 09:18:40 +00:00
Eike Ziller
58d288b523 Proparser/QtSupport: Fix build with Qt6
Pulls in some QStringView related updates to proparser:

f5d8ad61a4c85a656a7332c43d0c42f5eaf43593
"qmake: use new QString::arg(QStringView) overload"

52f3a7d9d40d3bf835bb0716ad201ee56731b980
"Build qmake with QT_USE_STRINGBUILDER"

c49728eb27be0f3f2eaaa77b0ed573f5d8705af1
"Port qmake from QStringRef to QStringView"

But do it in a way compatible with Qt5. Since some QStringView API is
not available in Qt5 (see QTBUG-86516), this means using a StringView
typedef that is either QStringRef (Qt5) or QStringView (Qt6)

Task-number: QTCREATORBUG-24098
Change-Id: Ic9a73ca450543f3fdd5fcf9d686c4b773a48854c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2020-09-14 07:26:54 +00:00
Eike Ziller
5b364de168 Use dialogParent() instead of mainWindow()
There are very few reasons to use mainWindow() directly.
Especially for modal dialogs, using dialogParent() is important, since
that guarantees the stacking order in case of other dialogs currently
being open.

Change-Id: I7ad2c23c5034b43195eb35cfe405932a7ea003e6
Reviewed-by: hjk <hjk@qt.io>
2020-06-02 11:44:53 +00:00
Eike Ziller
83ed1e3a7c Allow plugins to register additional example sets
Change-Id: Icfa2a8093a5cffd86dc029fd1b06117f599203ab
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-04-03 08:37:57 +00:00
Christian Kandeler
37e7b72609 QtSupport: Try harder to uniquify the list of auto-detected qmakes
Fixes: QTCREATORBUG-23459
Change-Id: I40d1baee48489a6fd439f7ece8b1c5ee664c75c6
Reviewed-by: hjk <hjk@qt.io>
2020-01-17 13:45:10 +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
3dfa188182 Help: Add option to only register highest versioned Qt documentation
In Options > Kits > Qt Versions. And make it the default.
It registers each documentation file only for the highest registered Qt
version. If you have Qt 5.12 and Qt 5.13 registered, but only installed
QtWebEngine for Qt 5.12, you'll get QtWebEngine documentation for Qt
5.12, but the other documentation is from Qt 5.13.
That is usually sufficient, since the documentation still contains "old"
API, and new API is flagged with "since".

This avoids registering a lot of documentation, which creates a startup
performance issue, and also leads to usually unneeded popups for which
Qt version some documentation should be shown.

The option also allows going back to registering all documentation,
and no Qt documentation at all.

Fixes: QTCREATORBUG-21482
Fixes: QTCREATORBUG-22799
Task-number: QTCREATORBUG-10004
Change-Id: I1c7bc73982d48d8e53f5083e2fa851b6c5f60f80
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-12-16 11:03:31 +00:00
Eike Ziller
9760d02b77 Merge remote-tracking branch 'origin/4.11'
Conflicts:
	src/plugins/perfprofiler/perfprofilerflamegraphmodel.cpp
	src/plugins/qtsupport/qtversionmanager.cpp

Change-Id: I2f29dd2e86b028be46184b12ac2c17ace2513d5a
2019-10-23 07:41:01 +02:00
Orgad Shaneh
734b6a5fdd QtSupport: Use QLoggingCategory for Qt version manager
Change-Id: I27b98ff853d7b5d437cab0df61243146220dadc8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-10-22 09:54:20 +00:00
Eike Ziller
78e5a8a80a Fix crash in QtVersionManager
Introduced in 9c2568b8e8
Range-based for loops that modify the original container must
work on a copy.

Change-Id: Ib917014ab259c20b282cdc85e7ca6583f7844de5
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2019-10-22 08:03:09 +00:00
Eike Ziller
9c2568b8e8 QtVersionManager: Small code cleanup
No QLatin1String, foreach -> for, a few other things.

Change-Id: I80aaff6855e4a38c29d43db917fc37eb975a6de0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2019-10-18 12:08:17 +00:00
Eike Ziller
91d785a123 Help: Unregister documentation when unregistering Qt versions
While doing we must take care that we do not remove documentation that
is used by other, still registered Qt versions (since for example
desktop & mobile Qt versions share the same documentation).

Fixes: QTCREATORBUG-16631
Change-Id: I77a38c89698cb3050d4a0a6963ab12d3238e2068
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-10-18 12:08:08 +00:00
Christian Kandeler
400eeaea7e QtSupport: Use Utils::DisplayName in BaseQtVersion
Task-number: QTCREATORBUG-16281
Change-Id: Idd697594bfd83d8f26c4cbfe5ff2d9472609836b
Reviewed-by: hjk <hjk@qt.io>
2019-10-16 08:16:47 +00:00
Tobias Hunger
a542f5075f BaseQtVersion: Deduplicate documentation related methods
Use docsPath() over documentationPath() since that fits better into
the naming scheme of the rest and already returns a FilePath.

Change hasDocumentation() to hasDocs() accordingly.

Change-Id: I619d7c68e612c4e25a830e4dce128d9a1e84c2e2
Reviewed-by: hjk <hjk@qt.io>
2019-10-01 07:37:29 +00:00
hjk
110f6dece9 QtSupport: Remove unused QtVersionManager functions
Change-Id: Ic6bc4c56ebedc71ff4c136fd201b8a236384c3fd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2019-09-11 09:55:44 +00:00
hjk
6a58666f44 More Utils::toSet/toList
... and unrelated cosmetic changes.

Change-Id: I591b17fd5289831e701b683f8fb47816efd1fa67
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-07-04 12:28:38 +00:00
hjk
473a741c9f Utils: Rename FileName to FilePath
More in line with QFileInfo terminonlogy which appears to be
best-of-breed within Qt.

Change-Id: I1d051ff1c8363ebd4ee56376451df45216c4c9ab
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2019-05-28 12:23:26 +00:00
Christian Kandeler
5e749c6d09 QtVersionManager: Find all Qt installations in PATH
Not just the first one.

Change-Id: I60c4cd8721c0833e02d2311e6f47f3194fe1ace0
Reviewed-by: hjk <hjk@qt.io>
2019-03-15 12:01:06 +00: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
hjk
be8afc820f QtSupport: Remove QtVersionManager::updateDumpFor()
Never called anymore.

Change-Id: I9a017897fcc763b656290c60294e1614a4a89561
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2019-02-14 13:09:49 +00:00