Commit Graph

187 Commits

Author SHA1 Message Date
Jarek Kobus
c37ee615a6 ICore: Fix possible crash in raiseWindow()
Don't call else branch with nullptr when window is nullptr.

Amends 79be19a8a0

Change-Id: I4c1ee3783d36374cbc6ad9555328b5737f2ce348
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-12-02 14:00:07 +00:00
Christian Stenger
60f11cf637 Squish: Avoid potential crashes
The control bar of the Squish plugin is used as top level
widget, but may get destroyed out of the sudden under several
circumstances.
If some dialog is using the control bar as parent QC will crash
at this point.
Redo 0d7bbb8480 to avoid all crashes instead of just
this specific one.

Change-Id: I5c5de737d748fe8eee724e9fa489696a27300978
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-09-14 10:50:40 +00:00
Eike Ziller
a2f21d40f5 Merge remote-tracking branch 'origin/8.0'
Conflicts:
	src/plugins/debugger/debuggerdialogs.cpp
	src/plugins/qmldesigner/components/materialeditor/materialeditorview.cpp
	src/plugins/texteditor/fontsettingspage.cpp

Change-Id: I5a6accd2065e0d8320045b57ade7b54a9a09aae0
2022-08-31 11:03:13 +02:00
Eike Ziller
54bce73089 Core: Use qtcEnvironmentVariable* instead of qEnvironmentVariable*
And instead of qgetenv.
Takes Qt Creator's setting at "Environment > System > Environment" into
account, which makes it easier on some platforms to set them (e.g.
macOS), can be configured differently in different settings paths, and
potentially can be changed at runtime (depending on usage).

Change-Id: Idfc8a7e255b4a0527f4651d6f9e5334e95b4351f
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-08-31 06:27:33 +00:00
Sona Kurazyan
60a045299d Prepare for moving qVersion() from qglobal.h to qlibraryinfo.h
Include qlibraryinfo.h where it's used.

Change-Id: I31afbca9c69e39eb05175704487ade1e8ae42eee
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-08-30 13:56:41 +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
hjk
4f4d77e797 Core: Avoid #include of fileutils.h in icore.h
filepath.h is sufficient.

Change-Id: Ibd865020f7820a6c6478eca6cf7b8065cf8c8cf3
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-07-22 13:07:43 +00:00
Sergey Levin
4a1a0eaa39 Core: Close ICore::showWarningWithOptions dialog on pressing Esc button
Change-Id: Ic09202799bde9cb4fbc3ca4e9836ca0c0cc499f2
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-07-13 13:03:33 +00:00
Eike Ziller
ae0032dfd5 CorePlugin: Use Tr::tr instead of QCoreApplication::translate("Core"...
Change-Id: Idf0b8e9effedbacda7a4eedb5bf0f78918fce631
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-06 06:41:24 +00:00
Cristian Adam
a5a06fe355 Core: Display build cpu architecture in about dialog
Previously we were displaying the word size: 32 bit, 64 bit, but
nowadays we could have x86_64 and arm64 and "64 bit" doesn't cut
it anymore.

Change-Id: I02c1942eae2b93726554561fa4eb83ac8a97dfa0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2022-04-25 09:23:42 +00:00
Cristian Adam
795269e1ce Core: Support MSVC 2022 in about dialog
Change-Id: Ia51f7ae35839fc58bb0a7f76792fda6aea0b8c2f
Reviewed-by: David Schulz <david.schulz@qt.io>
2022-04-14 12:05:25 +00:00
Topi Reinio
92984571fe Doc: Fix documentation warnings in Extending Qt Creator Manual
Change-Id: Ic9b1644328e10e147c7f08563b8394418a7d7581
Reviewed-by: hjk <hjk@qt.io>
2021-11-25 18:13:51 +00:00
Samuel Ghinet
a850b1b866 Implement the New Project creation wizard for QDS
Task-number: QDS-4490
Change-Id: Ie8073e8838ec14a7f11ad972acc6fca4456adf58
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-11-09 18:21:22 +00:00
Samuel Ghinet
4e7ee4687b Allow the NewDialog to be overridden by other plugins
So that Qt Design Studio can set its own implementation for the New
Project dialog box.

Task-number: QDS-4490
Change-Id: Ie04b041a5b6e25b38416f53b0ee4943839c2f64f
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-07 07:04:56 +00:00
hjk
f29bc8c787 ClangTools: Proliferate use of FilePath
Change-Id: I3eb16546a729ab01c10e37572adac9aef83f5cd4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-18 11:43:30 +00:00
hjk
ef1653698e ProjectExplorer: Use FilePath for ProjectNode::{path,directory}
... and let the fallout trickle down a bit.

Change-Id: I1a2f79e281725c4a121cc2fbbc0377e881616ce5
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-06 08:09:26 +00:00
hjk
906cfb060b Core: Use FilePath in some functions related to opening files
Change-Id: I9610855a914d315d7934996c755fb69ad399320f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-29 11:14:46 +00:00
hjk
3edc5673b5 Utils: Provide FilePath based wrappers for common dialogs
Change-Id: I464a7b5775495f32648905335f2d798384867900
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-07-26 09:44:20 +00:00
Cristian Adam
ba9f5ec3bb Version dialog: Add clang-cl specific case
Differentiate between Clang MinGW and Clang MSVC by specifying
"clang-cl" for Clang MSVC.

Change-Id: I4d3052af2e5f1fc9ff28678be61417a419e065a7
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-06-04 07:37:30 +00:00
Jarek Kobus
0f535703aa Implement scenario player
A scenario player may be used for testing Creator crashes which
can't be easily tested with "-test <plugin>" option. Some crashes
are triggered when Creator unloaded plugins and left the
main function. This may happen due to some other threads may
still be running. This scenario can't be tested using plugin tests,
since when the test finishes, Creator still has its plugins loaded.
Also it's not possible to quit Creator from inside the plugin
test, as if we do it, we couldn't report the test result.

The follow up patches will introduce the first test scenario
and provide automatic test for testing against regression
in StringTable.

The scenario player may be potentially used for other purposes,
including automatic presentation of features (yeah!). However,
most probably the API should be further developed for other purposed.
This is just a starting idea.

Change-Id: I0f5c3c028f35a5cdf9130c2cf315dd4b68e81126
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-02 11:59:33 +00:00
Eike Ziller
6161a9e43b ICore: Don't "clean" the relative path given to (user)resourcePath
It leads to unexpected results especially because any slash at the end
is removed, and also behaves differently to the other path methods in
ICore.

Amends 8e352af0ec

Change-Id: Iae3417d5a5e57bcef7ce4cdb368567ccd8fdc4c4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-05-27 08:40:03 +00:00
Christian Kandeler
dabfd6c0ed Fix libexec path construction
Fixes: QTCREATORBUG-25648
Change-Id: I5da2cb1b2809f29a676a3929ce5967afb5601cd9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-04-29 13:04:54 +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
Christian Kandeler
ecafdb7543 ClangCodeModel: Add experimental clangd support
If the user has enabled clangd (default is off), we start up one instance
per project when it is opened/changed (including build config switches),
and trigger background indexing.
So far, the index is used to provide results for locators and "Find
Usages".
Per-document functionality such as semantic highlighting and completion
is still provided by libclang.

Change-Id: I12532fca1b9c6278baab560e7238cba6189cde9f
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-04-22 07:32:58 +00:00
Jarek Kobus
be1d33299e Use invokeMethod instead of single shot timer with 0 timeout
Refactor it in coreplugin.

Change-Id: I6aaad1b9270a8ff8a4a0bea6a1fff806b2fe190b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-01-29 15:24:41 +00:00
Eike Ziller
c245a642f2 Share "auto-detected" UI string and add tool tip
No need to have the same translatable string repeated at all these
places.
Also add tooltip to expand a bit on what "auto-detected" actually means.

Task-number: QTCREATORBUG-25291
Change-Id: I25d43486758ba17256cf7e1ea2eea0ec3d567b62
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-01-29 15:04:05 +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
Alessandro Portale
3e9385bf1b Core: Make member functions const/static
readability-make-member-function-const finds lots of member functions
that could be made const. This change just picks getter functions that
really should be const.

readability-convert-member-functions-to-static finds non-static member
functions which do not access this. This change turns most of them
into static ones, but leaves some non static to keep the class API
consistent.

Change-Id: I004d6f7fab4375f9902f940f29b4a4f561fc7604
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-11 08:28:25 +00:00
Eike Ziller
1283b15117 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	doc/qtdesignstudio/examples/loginui1/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui2/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui3/qtquickcontrols2.conf
	doc/qtdesignstudio/examples/loginui4/qtquickcontrols2.conf
	share/qtcreator/debugger/dumper.py
	share/qtcreator/debugger/qttypes.py

Change-Id: Id44a67cdeeb0889ff96eddcdf409d20ca7cbdd0b
2020-12-10 13:02:02 +01:00
Henning Gruendl
2d9de4f706 QmlDesigner: Fix evaluation dialog automatic close
Fix Qt Enterprise Evaluation dialog being child of the QtDS splashscreen
resulting in the dialog getting closed together with the splashscreen
after its 15 seconds timer runs out.

Task-number: QDS-3258
Change-Id: Ied7a883efc925491dae65ac90227573cc93e1167
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-12-07 15:34:53 +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
81f3452e1c Aggregation/Utils/ExtensionSystem: Make member functions const/static
readability-make-member-function-const finds lots of member functions
that could be made const. This change just picks getter functions that
really should be const.

readability-convert-member-functions-to-static finds non-static member
functions which do not access this. This change turns most of them
into static ones, but leaves some non static to keep the class API
consistent.

readability-static-accessed-through-instance fixes the places where
the originally non-static, now static functions were called through
instance.

Change-Id: I8cf16c01f7988a7c9d073b5f8ede6a9706b94fb0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-27 09:16:08 +00:00
Christian Kandeler
d65ef60ea2 clang: Fix include/resource dir confusion
The getClangResourceDirAndVersion() function in ClangTools could return
the actual resource dir or the include dir, depending on the input. This
mistake happened because of misleading names spread all around the code.
Now the function returns what it says, and the other names are accurate
as well.

Change-Id: I0a8600857ee7b9fafb16256e0d1ad203ac3273d2
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-08-24 10:18:30 +00:00
hjk
430a33dcd9 Core/Utils: Migrate further to Utils::Id
The coreplugin/id.h header is kept for downstream for now.

Change-Id: I8c44590f7b988b3770ecdc177c40783e12353e66
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-07-06 06:07:13 +00:00
Eike Ziller
7c5ed6f7d9 Move InfoBar to Utils
The only reason it was required to be in Core plugin, was its use of Id,
which now is available in Utils.

Change-Id: I66ce863c24924e6448d339b3422538a7fe167336
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-06-18 06:39:54 +00:00
Eike Ziller
fa16071ca8 Fix "Header" documentation in Core plugin
Change-Id: If3cbe51b47a3acba32429894dfb5154cd573967d
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-06-15 07:55:39 +00:00
Eike Ziller
f1720910d4 Fix and complete documentation for ICore
Change-Id: Id7517ced928e7b4eefb1822f5e9381187169486a
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-05-29 14:46:34 +00:00
Cristian Adam
93e7629ef6 Core: Report MSVC 2019 when built with MSVC 2019
Change-Id: I1c360b76d6d9f9b59e2ce563c5ca9a9c7fdeafa1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-05-28 16:52:47 +00:00
Eike Ziller
6d97c1fcb1 Unregister deleted IContext objects automatically
Change-Id: I7b84c02c8fe1e7201431116e3d993792370fb942
Reviewed-by: hjk <hjk@qt.io>
2020-05-27 06:54:54 +00:00
Eike Ziller
a040bebe5d Add "Install Plugin" button
Shows a wizard. Select a library file or zip file, and if you want to
install in user location or Qt Creator install.
For zip files it requires "unzip", "7z" or "cmake" in the PATH.

Change-Id: I191079046cbd2cb6ab181bc044a00488af41b349
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-23 07:39:06 +00:00
Leena Miettinen
eecd2a5aa1 Doc: Fix QDoc warnings in Core plugin classes
Task-number: QTCREATORBUG-23620
Change-Id: Idf1fb2b3f930812c3cf18b9f8ced03fb8e0947be
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-03-18 13:39:43 +00:00
Leena Miettinen
8046e3311f Doc: Fix QDoc warnings in Find classes
- Document BaseTextFind and FindSupport
- Mark undocumented classes and namespaces \internal
- Add and fix docs for IFindFilter, SearchResult, and
  SearchResultWindow

Fixes: QTCREATORBUG-23600
Change-Id: Ic9445f7f15562f114f4cbd9fe16988d7249d48db
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-02-17 15:45:51 +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
Nikolai Kosjar
fc37ea4276 ClangTools: Add UI for specifying executables
Add a new group box "Executables" for this. Hide the UI for
clazy-standalone unless QTC_USE_CLAZY_STANDALONE_PATH is set as there is
no released version with the needed -export-fixes option.

Rename the previous group box from "General" to "Run Options".

Change-Id: Ia9daf66c40d3a7eea98b31d9c086886d29466490
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-12 13:35:01 +00:00
Nikolai Kosjar
a8f00d147c ClangTools: Invoke clang-tidy instead of clang
Change-Id: Ibcc53cf8cb8bbaf262757bec52f15936506dad50
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@qt.io>
2019-09-12 10:24:30 +00:00
Eike Ziller
c67ed4d35b Add global notification area and use for UI Tour info
Adds a global info bar display above the main window's status bar that
can be accessed via ICore::infoBar().

Replace the blocking "Take UI Tour" dialog by a notification there.

Fixes: QTCREATORBUG-22819
Change-Id: I733f1bfd2d1db0295754ed2e28bb202f927d0edb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2019-08-12 07:15:27 +00:00
hjk
4742216feb Core: Give a hint why saving of settings are requested
Not all requests are the same, handling code might want to act
differently on different request reasons.

Main driver here is the handling of the debugger/analyzer main window
state savings which depends on actual visibility of certain windows.

Change-Id: I87b2a9149e3d09d27bc14b44aace9f2e0686db04
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-06-03 08:25:41 +00:00
Christian Kandeler
4eff36b7f6 Unit tests: Print a warning at the end if not all tests passed
It's easy to overlook that Creator returned with a non-zero exit code,
particularly if the last test succeeded.

Change-Id: I6975014aec36c7a267dc88cde41f830d314c90af
Reviewed-by: André Hartmann <aha_1980@gmx.de>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-03-14 08:49:02 +00:00