Commit Graph

268 Commits

Author SHA1 Message Date
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
Eike Ziller
41b73594ad Add API for saving settings with default value
We should never actually write default values into the settings, because

- if the default value changes in a later Qt Creator version, the new
  default should automatically take effect if the user didn't change the
  value
- it senselessly grows the settings file

Add a QtcSettings class that extends QSettings by a
"setValueWithDefault" method, which does not write default values to the
settings, and actually removes the settingskey if the user switches back
to the default.

Use it at the places where we already do this manually.

Task-number: QTCREATORBUG-24762
Change-Id: Ia76414cb21e8521f3aeed1e37b43ae4fb3393ea3
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-12-04 08:25:17 +00:00
Alessandro Portale
871c8e3ffd Don't access static functions via Utils::HostOsInfo instance
Change-Id: Ic45b8f324cb7c6a4691545fc8d668eed69dfeced
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-18 22:08:42 +00:00
Jarek Kobus
7a14e38b7e Explilitly ignore the return value of QTranslator::load()
Otherwise we are getting warning about unused return type
of function marked with [[nodiscard]].

Change-Id: I07b464cc641ff1b6e36a0c84115deed1701e40d3
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-13 11:07:13 +00:00
Jarek Kobus
1fd7e9b242 Get rid of setting deprecated attributes in Qt 6
Setting AA_EnableHighDpiScaling and AA_UseHighDpiPixmaps
attributes does nothing in Qt 6.

Change-Id: I1744604f34294d809c594c66ef86b610ed6efb16
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-13 11:07:07 +00:00
Morten Johan Sørvig
9c09d82251 Limit workaround to 5.14.0
QTBUG-80934 was fixed in Qt 5.14.1.

Change-Id: I3f9f2a629bce40b13ad8836ae4b0f4a710241d49
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-09-03 11:26:33 +00:00
hjk
7dfa4acfb7 App: Restrict use of Qt::AA_DisableWindowContextHelpButton to Qt 5
Gone afterwards.

Change-Id: I8c7009658844a5979b144c108736055ed11bec05
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-06-19 10:25:22 +00:00
Christian Kandeler
b9e79f7852 Linux: Force release of unused memory
Apparently, glibc uses an overly aggressive caching strategy, causing
Creator to accumulate an unreasonable amount of resident memory over
time.
We deal with this by manually forcing glibc to free unused memory once a
minute, provided the application is actually in use.

Fixes: QTCREATORBUG-22832
Change-Id: I300eafd8714eb7e49774129758998db32ca1a1de
Reviewed-by: hjk <hjk@qt.io>
2020-05-11 08:33:14 +00:00
hjk
2a664afaa1 App: Add mechanism to not propagate LD_PRELOAD
LD_PRELOAD is useful e.g. to preload custom malloc implementations
for profiling purposes. At times, it makes sense to not propagate
that to spawned child processes. This here allows to prevent that
by setting another variable, QTC_DO_NOT_PROPAGATE_LD_PRELOAD, in
the environment.

Change-Id: Ib8944685488a18a651d351b8a64dd8d7a7e48837
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-04-30 08:01:21 +00:00
Eike Ziller
d6c95ef365 Take compatibility version into account for user plugins
When loading user-local plugins, do not load plugins for all patch
versions starting from .0 unconditionally. Take the compatibility
version into account.

That fixes that prereleases x.y.82 etc should not try loading plugins
for any actual x.y.z release.

Change-Id: Ide0931bbdef4f48e08dcc3213f7c193c8889fb0f
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-03-06 09:49:05 +00:00