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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Do set the global application flag AA_DisableWindowContextHelpButton
to avoid having to unset the default WindowContextHelpButtonHint
in every single dialog.
AA_DisableWindowContextHelpButton was added in Qt 5.10.
Change-Id: I21fe8bc5ddfa4c01ec7a799b04bfb6ff1c9d6d86
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
If a plugin crashes, ask the user if that plugin should be disabled.
For this track which plugin currently is changing its state. Remove that
information if the state change was successful.
At startup check if there is a plugin for which we wrote, but not
removed that information.
This is especially interesting if the user installed 3rdparty plugins.
Change-Id: I5729aa5c786b653d5bd53304f4fbeaca35ec9e71
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
The application details (name, organization, etc) were only set during
Core plugin startup, but that is too late for e.g. the plugin manager.
Change-Id: Id47d79e38dec9e586ab7b91a3080101e5fecb20d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
And use it for the plugin dialog and when changing the UI language.
Change-Id: Ic767837d2526409f7ec46d7e4612a1499f19459e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
kwin_wayland fetches application icons from .desktop files, so we
need to set the desktop filename on the QGuiApplication instance
(otherwise kwin will set a generic wayland icon as fallback).
Change-Id: I89921ace4a5a4ff2a2387111e51a8914f58e44a8
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
It's helpful to be able to temporarily disable environment variables, as
opposed to having to remove (and then re-add) them entirely.
Fixes: QTCREATORBUG-20984
Change-Id: Ib0d287035b9357507c4c19faaf3a1517382506b5
Reviewed-by: hjk <hjk@qt.io>
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>
Qt 6 API will move away from it.
Use QVector for API and some std container for internal things.
Change-Id: Iff14d48a47d5ac52ade875d9c8c84ad8a4f577d8
Reviewed-by: hjk <hjk@qt.io>
Qt Creator X.Y.Z is binary compatible with X.Y.(Z-1) so load plugins
from these user plugin directories too.
Change-Id: Ibed7f54e84864337a69a4745fb1ecd2f78907486
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
And mention the option in the ChangeLog.
Change-Id: I7cce04ec1ad8b3f89b4a4f6c24f2a8d2da9381a0
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
For people that are too lazy to think about currently unused
throw-away temporary directory names.
Change-Id: I0c52f3ea2b0dac4ef6cf3f9db646fd5107fa7977
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Instead, set the default level of all logs to QtWarningMsg.
The call to setFilterRules overrides the user preferences in qtlogging.ini.
Change-Id: Id5f6cd550d14ff7f45ae04c5d3110e0bafb0f072
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
Reviewed-by: hjk <hjk@qt.io>
We used to set QT_OPENGL, currently set LD_LIBRARY_PATH when qtcreator.sh
is used, and might set other variables in the future,
but these environment modifications should not be passed on
to user applications or when we run tools that are not shipped with
Qt Creator.
For LD_LIBRARY_PATH there already was a hack for
Environment::systemEnvironment.
For environment variables that we might set in main()
in the future, this patch caches the system environment for
Environment::systemEnvironment early before any modifications are made.
The previous hack for LD_LIBRARY_PATH no longer works, since it
used QCoreApplication::applicationDirPath() which cannot be used at that
point in time (before the QApplication has been created). Instead pass
the correct user LD_LIBRARY_PATH directly from qtcreator.sh to
Qt Creator through a command line option, which is cleaner anyhow.
Task-number: QTCREATORBUG-20808
Change-Id: I6674a5e0537e1b37fd7dcbff371b542fa24bce69
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Environment variables are passed on to user applications,
and we should avoid forcing ANGLE on these.
Task-number: QTCREATORBUG-20808
Change-Id: Ia6663e4e2bc4f78ec053d100563a0f07d47092be
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
We parse the arguments independently from QApplication
and initialize the settings before we create QApplication.
Therefore we can parse any setting before creating
QApplication which is required for high DPI support.
We use the QApplication argument parsing to filter out Qt
specific commandline arguments like style.
Change-Id: I83ead87476d99351de6fe4f86c96c39a721af47b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
An option is added to the Options dialog:
* Allow to enable high DPI scaling on Linux
* Allow to disable high DPI scaling on Windows
On macOS+retina, high DPI scaling applied automatically
and we do not show the option on macOS.
I had to duplicate the logic for parsing -settingspath,
because the code has to run before QApplication is created.
Task-number: QTCREATORBUG-20232
Change-Id: I4e94fc54391fe99e30d4778ec2a178529961eed7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Many OpenGL drivers are still very unstable and we see many issues.
Task-number: QTCREATORBUG-20067
Change-Id: Ifc1d5b2666f9cc69154032c3c4534cd96194110c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Allow explicit native menubar disabling as there are platforms with
known broken implementations.
Change-Id: Ice5fb1270969b422eb1a964fab5e305bc658c667
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>