Commit Graph

277 Commits

Author SHA1 Message Date
Jarek Kobus
abb85b073a QScopeGuard: Make all usages of QScopeGuard consistent
Change-Id: Icfc35ecbdbdee8dadbb1b17789694093427c3ed9
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-06-07 10:35:01 +00:00
hjk
9db19c653c All: Replace deprecated QLibraryInfo::location
... by QLibraryInfo::path() which exists since 6.0

Change-Id: I0e1e071e0d279ddaf1f1027a0e6ce350ab21739a
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-06-06 14:35:55 +00:00
hjk
21cb45e665 App: Remove workaround for crash in regexp jitting in Rosetta
The relevant Qt bug was fixed upstream.

This effectively reverts ab16f2984b

Task-number: QTBUG-97085
Change-Id: I2ccf50f83b42111bbeaa26dfd95b1eb69a62c3bf
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-16 11:08:26 +00:00
Jarek Kobus
a059f87754 QtSingleApplication: Introduce QTC_FREEZE_DETECTOR env var
This may help with tracking the freezes in main thread.
By default, when QTC_FREEZE_DETECTOR is set, it detects
freezes above the 100 ms and prints the receiver object
and event type that triggered the freeze.

Change the default 100 ms threshold by setting the
QTC_FREEZE_DETECTOR to some different numeric value.

Change-Id: Ifb68c7648c09a5329f1f2aa39cd7e29e69a76052
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-04 09:44:16 +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
ef6ab90d1c crashpad: add sha to sentry annotations
Change-Id: I7142da6d8fc61643512ff2ae6f581bf6795ab802
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-03-06 04:46:49 +00:00
Tim Jenssen
b619f24396 crashpad: change chrashpad dumps location to user directory on macOS
This is necessary to not pollute the signed and notarized .app
bundle.

Task-number: QDS-9113
Change-Id: I74e0bced5679faac94b27d2a31ea10a7949fb21f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-03-06 04:46:03 +00:00
Kai Köhne
4e9c1d126c Replace GPL-3.0 with GPL-3.0-only
GPL-3.0 is deprecated by SPDX.

Change done by

 find . -type f -exec perl -pi -e 's/LicenseRef-Qt-Commercial OR GPL-3.0(?!-)/LicenseRef-Qt-Commercial OR GPL-3.0-only/g' {} \;

Change-Id: If316a498e3f27d2030b86d4e7743b3237ce09939
Reviewed-by: Lucie Gerard <lucie.gerard@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-10 08:05:04 +00:00
Eike Ziller
5344bec59b Add support for plugin paths set by the installer
This is important on macOS, where we cannot install optional plugins
into the app bundle, because that would break code signing.
Instead the install settings in the signed bundle sets a custom plugin
path outside the bundle, and the installer puts optional plugins there.

Task-number: QTCREATORBUG-26705
Change-Id: I8b36752471d16dfc5828e87e20254f39ab985ca2
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-01-03 15:59:40 +00:00
Alessandro Portale
5649fc30ca main: Prevent GTK3 platform theme plugin from enforcing a dark palette
Fixes: QTCREATORBUG-28497
Change-Id: Ib49b57aafe044d711940db3ea0e0778206221111
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-12-02 16:05:33 +00:00
Eike Ziller
a1851c7cf1 Add -language command line option for overriding UI language
I run Qt Creator in german, but for responding to questions and
generally looking things up I regularly want to run it temporarily in
english. A command line option makes that easier than having to start Qt
Creator, navigate to the settings, and restarting it, and doing the same
again to revert back to german.

Change-Id: I7c0d84375ffc97e5c7607307fd3f785f2c315c3d
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2022-11-07 14:50:36 +00:00
hjk
b4446607ec App: Also accept --version with two dashs
That more common on Linux.

Change-Id: Id724932565a6d5292012e446914ef4fac1b4f652
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-19 10:54:16 +00:00
hjk
0819bf3781 App: Make -version output go to stdout
Fixes: QTCREATORBUG-28327
Change-Id: I0a263ec79ab49a4d1d0816fe798d8a0403e6fce0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-10-19 10:52:57 +00:00
Eike Ziller
ea5a050c5c Merge remote-tracking branch 'origin/8.0' into 9.0
Conflicts:
	src/plugins/mcusupport/mcusupportsdk.cpp
	src/plugins/qmldesigner/components/edit3d/edit3dwidget.cpp
	src/plugins/qmldesigner/components/materialbrowser/bundleimporter.cpp
	src/plugins/qmldesigner/components/materialbrowser/materialbrowserview.cpp

Change-Id: I9317da0fc1243b9ce6d87f577aa843c51f132ad7
2022-10-18 10:48:46 +02:00
Eike Ziller
519b6fefe1 Link with Qt: Prepare for sdktool to move to a different location
When linking we should now consider the new sdktool location within the
Qt installation first. The new location of QtCreator.ini will be <Qt>/
Tools/sdktool/QtProject/QtCreator.ini on macOS, and <Qt>/Tools/sdktool/
share/qtcreator/QtProject/QtCreator.ini on Windows/Linux.

When resolving an existing install settings path to the old location
within the Qt Creator installation (Qt Creator.app/Contents/Resources or
Tools/QtCreator/share/qtcreator), the QtCreator.ini at that location
will itself redirect to the new sdktool location. So, try to follow that
as well, to keep existing setups working.

Task-number: QTBUG-28101
Change-Id: Idbb09ad6961f6fd4a4112830959a615d8186a132
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-10-14 08:32:53 +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
Eike Ziller
04e50438eb Utils: Remove Utils::optional
Since we are now requiring macOS 10.14 we can remove our local
implementation of optional and use std::optional for macOS too.

Change-Id: I2bd018261b68da64f7f031a812045dd7784697e1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-01 06:58:04 +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
hjk
df4155f617 App: Use more local methods to trigger memory trim timer
The global event filter function is executed often, for events
originating deep in the widget hierarchy even multiple times.

Triggering the timer only by mouse and key presses on the main
application and on texteditor is less intrusive and still happens
often enough (TM).

Change-Id: I848d55a347bd62d12e8523965d1750c59da33116
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2022-08-02 11:18:12 +00:00
Alessandro Portale
d4643a627b App: Set QPixmapCache limit according to devicePixelRatio
Higher resolution also means more data to be cached. The default 10MB
cache limit don't cut it in HighDpi, especially in cache-intensive parts
like the welcome screen.

Change-Id: I653a939c3a37f80647d73e8de8df616d5386e39c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-07-22 16:08:56 +00:00
Marcus Tillmanns
3462bc67be filesystem: Add QFSEngine for filepaths
Change-Id: Ibd0c88c69863c0877138d8cc45541530c359bd9c
Reviewed-by: hjk <hjk@qt.io>
2022-07-21 13:14:01 +00:00
hjk
2b3386908a app: Adapt to Qt >= 6.2
Change-Id: Ia27bccff16f0ba41e18c72ffd950b15e800fcf47
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-15 10:11:47 +00:00
Eike Ziller
6a296ab68a Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/qmlprojectmanager/qmlprojectplugin.cpp

Change-Id: I14030f58303839e706af892dd12a67566e3bed68
2022-05-18 13:35:47 +02:00
Tim Jenssen
839502650c qds: ENABLE_CRASHPAD on macos (universal builds)
using a newer crashpad version build with:

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=$PWD/depot_tools:$PATH
mkdir crashpad
cd crashpad
../depot_tools/fetch crashpad
cd crashpad
gn gen out/Default --args='target_cpu="mac_universal"'
ninja -C out/Default

Change-Id: I782c09cb564aff725652cd1419a8dec78bc04fc5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-05-12 10:06:03 +00:00
Robert Löhning
7c942cfd18 Remove outdated code
Change-Id: I65e0ed79dabd987bc67d4082969835d52dd7cb8b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-03-09 18:53:36 +00:00
Tim Jenssen
b58c57fb3f crashpad: disable calling crashpad_handler on arm64
Currently, the none arm handler binary is hanging and
needs further investigation.
Maybe a complete universal build will fix this, and
we can enable it again.

Change-Id: I60b5623d8dda500a3be3efd095f91a9609600324
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2022-02-24 16:27:34 +00:00
Mahmoud Badri
ed21e25e14 CrashPad: Remove the 1 crash per hour limitation
Change-Id: Ie7634012f15059fd204cb03e37afd3d63d7bfb29
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-02-23 13:00:59 +00:00
Eike Ziller
041e8d178f Linux: (Optionally) Enforce XCB backend if QT_QPA_PLATFORM is not set
Especially on older distributions, Qt/Wayland works worse than Qt/
XCB(XWayland). On Ubuntu 20.04, starting Qt Creator with Wayland can
even crash the Wayland session
(https://bugs.launchpad.net/ubuntu/+source/mutter/+bug/1958684/).

We still want to ship the plugins, and allow forcing the usage of
Wayland, since on the other hand Wayland works better in HiDPI
environments for newer distributions.

Behavior is enabled when configuring with  -DQTC_FORCE_XCB=ON

Task-number: QTCREATORBUG-26867
Change-Id: I623f001412f809381208b6cb3ec5b3fcfdb86011
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2022-02-16 07:50:48 +00:00
Jarek Kobus
1f0ecd600e Move TerminalCommand into a separate file
This will ease the ConsoleProcess and QtcProcess
unification.

Change-Id: Idda9ad393d184088c3e3a734389761d7176bd0c0
Reviewed-by: hjk <hjk@qt.io>
2022-01-21 15:06:28 +00:00
Jarek Kobus
74f522e0de ConsoleProcess: Make setSettings() a static member
Since it's not possible to use directly ICore::settings()
inside Utils lib, make setSettings() a static member.
This simplifies the API of other static methods.
Set the settings just once now, inside main().

Change-Id: I2bcc58d4d29b5aba4a1a21a98a9f4245b24b530f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2022-01-21 14:53:17 +00:00
Eike Ziller
31bcc0ca2c Merge remote-tracking branch 'origin/5.0' into 6.0
Change-Id: I311d1128c6a299c1db8717a12b40393055a889bb
2021-10-05 09:13:56 +02:00
Eike Ziller
ab16f2984b Work around QRegularExpression crashes on macOS with Rosetta
Looks like the regular expression jitting is not reentrant when running
under Rosetta for some reason. It was crashing when loading bigger
subdir .pro files which regular expressions in it, like qtcreator.pro.

Disable JIT if we run under Rosetta.

Task-number: QTBUG-97085
Change-Id: Icbab1ca8f62afa9cc86045983e84087a7694b5ad
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
2021-10-04 13:39:14 +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
Jarek Kobus
33f1a96005 Control the lifetime of SshProcessManager
Make it possible to control when the SshProcessManager is
being constructed / destructed. Expose public constructor.

Since different singletons depend on each other, we need
to control the order of creation and destruction of them.

The order of creation is like that:

1. QCoreApplication
2. ProcessReaper
3. ProcessLauncher
4. SshConnectionManager

The order of destruction must be opposite to the above.

Change-Id: Ice07eb751cd61c03cb461816fa1b74ab040a53de
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-10 14:02:21 +00:00
Jarek Kobus
ace765c199 Move ProcessReaper into lib/utils
Reuse ProcessReaper inside process launcher.
Automatically reap all internal QProcesses of QtcProcess
(either direct child of QtcProcess in QProcessImpl
or indirectly inside process launcher).
Make ProcessReaper work again on QProcess instead of on
QtcProcess, so it may still be reused for non-QtcProcesses.

Change-Id: I950cac5cec28f17ae97fe474d6a4e48c01d6aaa2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-09-06 21:28:19 +00:00
Artem Sokolovskii
0f89b97b03 QtCreator: Update help message
* Add information about -tcs alias of -temporarycleansettings command
to the help message

Task-number: QTCREATORBUG-26132
Change-Id: Ie79e33cf2358ad2f7253656017c9e8b433b7f635
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-18 09:54:47 +00:00
Eike Ziller
c7168d1063 Merge remote-tracking branch 'origin/5.0'
Conflicts:
	src/plugins/coreplugin/locator/executefilter.cpp

Change-Id: Iff5b82a9e491b782e4720138904f389d318b005c
2021-08-11 10:10:51 +02:00
Thomas Hartmann
269143a0d9 App: Replace DisableHighDpiScaling with HighDpiScaleFactorRoundingPolicy
AA_DisableHighDpiScaling is deprecated and ignored in Qt 6.
The next best option is to use Qt::HighDpiScaleFactorRoundingPolicy::Floor
instead.

Change-Id: Ic279ac34f744dec2558624799809007bbb638431
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-08-05 08:23:38 +00:00
Alessandro Portale
6595650804 App: Use the same high dpi scale factor rounding as Qt 5 does
After brief usage of a Qt 6 build of Qt Creator under non-rounded
scaling factors such as 150% or 175%, all kinds of rendering artifacts
are noticeable.

Proper support of these scaling factors requires fixes in several
places. This change is the quickest alternative fix/workaround: restore
the behavior of Qt 5.

Fixes: QDS-4739
Fixes: QTCREATORBUG-25862
Change-Id: Ia8bfda088ee20ebbe08cb4f79325d5a51ef7124b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-05 07:56:05 +00:00
Eike Ziller
17d716118a Merge remote-tracking branch 'origin/5.0'
Change-Id: I4236e3d2f87d56aea787905f4b78b1f5f933c069
2021-08-03 14:19:44 +02:00
Alessandro Portale
6cb62bc94e App: Remove unused function
Not only was "copyRecursively" copy/pasted, it is also unreferenced (by
others than itself).

Change-Id: I500fa42d31f5dbf97b2cb7ba5c144249c157ce57
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-30 07:24:04 +00:00
Jarek Kobus
971abe115b Provide initial implementation for ProcessLauncherImpl
The initial implementation is a copy of QbsProcess
with some small adaptations. Start a LauncherProcess
in Creator's main function, just after the creation of
the application object.

Change-Id: I016df3ed664d7914c73f4a35742d5a63d5faaca0
Reviewed-by: hjk <hjk@qt.io>
2021-07-09 11:17:31 +00:00
Orgad Shaneh
dcf692d3ff CMake build: Purge copying settings from Nokia directory
It is not used, and not supported in the other build systems.

Change-Id: I38049e145595490058e255b94cdb8dd13c3f6fb2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-07-05 14:36:25 +00:00
hjk
a58dd22f2d Utils: Use FilePath in TemporaryDirectory API
This helps to lower impedance in the using code.

Even though TemporaryDirectory will very likely always stay on the local
host, this is one of the entry points into path related string
manipulation
that we want to base on FilePath nowadays.

Change-Id: I302016b8d65e54df94296659a54a93935d9e4627
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-07-02 05:05:12 +00:00
Christian Stenger
093f3479ce Fix execution of scenario
There are different ways of having a settingspath for QC. If the
settingspath is not provided for starting QC we may use the global
settings or a temporarily created settings folder.
To correctly run the test scenario from inside a plugin unit test
we need to have the same environment and settings.

Change-Id: I5dcc61e162258a0af8d3c8df2e63255d0e35f464
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-06-09 12:24:39 +00:00
Jarek Kobus
422409bf26 Add TestStringTable test
The TestStringTable tests the fix provided for a crash in StringTable
on shutdown.

Amends: f4ab1279fd

Task-number: QTCREATORBUG-25417
Change-Id: I5a4a7e4a20e1b9611682a976d38dee17d4603c5c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-06-07 12:16:27 +00:00
Knud Dollereder
af4ce2fbe6 Set QSG_RHI_BACKEND to opengl
in order to prevent a crash ancompanying the console output:
QQuickWidget is only supported on OpenGL.
Use QQuickWindow::setGraphicsApi() to override the default

Change-Id: Iab7c0cc486b150723000cc11ba4c6d9cd4be8b03
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-25 13:31:59 +00:00
Alessandro Portale
a547b82075 App: Set OpenGL backend using the Qt 6 API
Qt 6 would emit:
"Qt::AA_UseOpenGLES is no longer supported in Qt 6"

Let's set the backend to OpenGL it via environment variable.
Setting it via QQuickWindow::setSceneGraphBackend would add a
dependency on "quick".

Fixes: QTCREATORBUG-25637
Change-Id: Ice53be9440c586008dea9ab3731050a63073bab0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-04-28 09:40:39 +00:00
Cristian Adam
1d27f894bb QtCreator: Add ability to specify text codec for default locale
On Windows you get one locale for unicode applications, and one
for old non-unicode applications.

Qt Creator uses QTextCodec::codecForLocale(), which would result
in the "System" codec, which is mapped for the default language
in the system.

Task-number: QTCREATORBUG-24776
Change-Id: I64496cc440931d3bf6f09314bdfc7c29e01b9f4f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-02-17 14:29:27 +00:00
Mahmoud Badri
cc7be5724a Add Crashpad to Qt Creator and Qt Design Studio
Fixes: QDS-2748
Change-Id: I87e25682f066d167eebfd7b78c46c166e5062e11
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-01-18 22:08:14 +00:00