Commit Graph

252 Commits

Author SHA1 Message Date
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
Kai Koehne
fda9955df0 Globally disable WindowContextHelpButtonHint
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>
2020-02-25 13:26:44 +00:00
hjk
edbdb4436c App/aggregation: Some modernization
Change-Id: I390e81122453d20a646af4a5bf08edf9de0d9db5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-14 09:41:26 +00:00
Eike Ziller
392b063fe8 Guard against crashing plugins
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>
2020-01-20 10:39:28 +00:00
hjk
8b4915ce41 App: Make compile
Amends 7c35c447e1.

Change-Id: I92af20bb4d9e23c91fc43a0c3388a6cf1cdec5a5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-01-14 09:15:45 +00:00
Eike Ziller
7c35c447e1 Set application details earlier
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>
2020-01-14 08:16:52 +00:00
Eike Ziller
be19b00289 Provide "Restart Now" functionality
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>
2020-01-07 12:46:59 +00:00
Eike Ziller
4a00f53c17 Work around high DPI issues on Windows
Task-number: QTBUG-80934
Change-Id: I4b7dbe7157145db3a9feee83f32be3babaca5ab9
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-01-03 07:53:24 +00:00
Orgad Shaneh
d73632c6f3 Main: Remove unused include
Change-Id: Ifeef80bfc6465c5544118a74e774a5442c4f8374
Reviewed-by: hjk <hjk@qt.io>
2019-10-22 13:27:27 +00:00
Eike Ziller
ac014e3875 Merge remote-tracking branch 'origin/4.10' into 4.11
Conflicts:
	src/plugins/projectexplorer/projectnodes.h

Change-Id: I10a749cca38c2d0929cf4d2b74ab089e14b6157b
2019-10-02 07:32:57 +02:00
Elvis Angelaccio
85fcd10f90 Show application icon in Plasma Wayland sessions
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>
2019-10-01 07:02:35 +00:00
hjk
2e14df7561 Some clang-tidy -use-modernize-nullptr
Change-Id: I1bed5e85a5b7948d08502a72a10f80baa075c204
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-08-01 13:20:26 +00:00
Christian Kandeler
4d71c0f13e Let users disable environment entries
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>
2019-07-22 14:31:01 +00:00
Tim Jenssen
3ae169f8ac improve installsettingspath error message
Change-Id: Iefd301009faad8a15e9a1b99b0a52bce34eae654
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-17 13:21:39 +00:00
Tim Jenssen
dfd9d5a5ee try only show MessageBoxes if that is possible
Change-Id: I70f41b7a2936d6797895559530050e8de54b2913
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-07-17 12:16:28 +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
Eike Ziller
e0b0a08e50 ExtensionSystem: Move away from QList
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>
2019-05-27 14:21:00 +00:00