Commit Graph

167 Commits

Author SHA1 Message Date
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
Marco Bubke
0c177cd0d1 Add ICore::cacheResourcePath()
We need some directory where we save the index database and the precompiled
headers. This files should be persistent but the user can delete them
if he wants because we will rebuild them.

Task-number: QTCREATORBUG-22012
Change-Id: I9f25eb48a9992d6385a96427ef9c10bc739a3567
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-03-04 16:43:09 +00:00
Eike Ziller
b9db5ea86e Move documentationPath() from Core::ICore to Core::HelpManager
It is documentation related API, so it belongs there.

Change-Id: I5d1676f251e6deb92050ddedac19bf3c332aab54
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-09-20 07:19:49 +00:00
Eike Ziller
8fa449126c Fix context of Locator input
- In the main window, the locator input (actually the status bar)
  visually feels like being part of the mode widget, so give
  it its context.
- In extra editor windows, the whole editor window should have
  "editor manager" context, so that is also active for the locator
  input.

Task-number: QTCREATORBUG-20626
Task-number: QTCREATORBUG-20071
Change-Id: Ib68d6a8177446572ea59c3cc057eca0706173e11
Reviewed-by: Xing Xiong
Reviewed-by: David Schulz <david.schulz@qt.io>
2018-08-09 08:55:25 +00:00
Alessandro Portale
f36f04deba Core: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init (partially)

Change-Id: Idf10d7ffb1d98a04edc09a25c35e4e9e3abe87b5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-08-08 16:04:21 +00:00
Ivan Donchevskii
344cbb3a1b Clang: Move clang paths helper functions to Core plugin
These functions require core plugin so they can't go
to utils library. At the same time to use them in
ProjectExplorer plugin there are not too many choices
where to put them without introducing new dependencies.

Change-Id: I3cccccffaae8ac4bbce924fd809b5423da5dc503
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-08-06 12:38:52 +00:00
hjk
892546bd6a Core: Minimize directly accessible SettingsDialog interface
Only the getSettingsDialog + exec combination was ever used. Make
that accessible by a free function, move everything else to
settingdialog.cpp.

Take the opportunity for some code cosmetics and remove a few
indirections by using direct members instead of pointers where
appropriate.

Change-Id: I14bc47395a85045ab439d418da0bc459add844bb
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-14 16:37:08 +00:00
hjk
730a8186af Core: Compile fix after 974022c77b
Change-Id: Idd26b1da785deec81772dff3134c4c23e63762bb
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2018-02-01 17:07:04 +00:00
hjk
effa4d830f Core: Remove the now-unused ICore::optionsDialogRequested() signal
Change-Id: I5b712c8f01170d406b2a1e5cb969ff2e4ffe16d4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-01 14:17:30 +00:00
hjk
e712c8b7e2 Core: Replace an in-Core connection by a direct call
Change-Id: Ic219a992658e080467a18d38121a41990cc377ce
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-01 13:31:04 +00:00
hjk
974022c77b Core: Reduce code path ping-pong between ICore and MainWindow
Public entry points for displaying settings dialog were in ICore,
diverting to MainWindow, and back in some cases.

Move implementation to icore.cpp instead.

Change-Id: I02cbf1dcfe6241c665d7d701b4b4af1a8a242af5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-01 13:29:58 +00:00
Eike Ziller
f42ea09b74 Do not construct settings/resource paths from QSettings object
These paths are controlled by ICore.

Add ICore::installerResourcePath() to replace constructions with
settings(SystemScope)
Replace constructions with settings()->fileName() by usage of
ICore::userResourcePath().

Change-Id: I5a9fa9d09f2563c39dc5d11a4586da825c62f9ac
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2018-01-11 10:42:09 +00:00
David Schulz
319990d7c5 Core: return QMainWindow * from Core::mainWindow
... instead of QWidget *

Change-Id: Ibe38814ae26524a9ffa4c14d170d5aa487a40931
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-11 06:35:27 +00:00
Eike Ziller
0be914853b Use IDE_ID for user resource path
We should not share these settings with a different IDE_ID

Change-Id: If50102606722f40ab64c9c7fe01c74a9f0dda06e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-01-10 15:36:36 +00:00
Eike Ziller
7b6943e578 Add "Remove File" to file system view
Task-number: QTCREATORBUG-19208
Change-Id: Iacf1e1468018fa8dd3426bc1325f36bb39a4b4e2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-12-12 10:50:29 +00:00
hjk
cdaa4aee1a Add some mechanism to help screenshot creation
If QTC_SCREENSHOTS_PATH points to a writable directory, each widget that
has been registered with ICore's setupScreenShooter(const QString &name,
QWidget *w) will dump a screen shot to this directory as soon as the
widget is shown.

Change-Id: I2dec12064f1bb3c510d2fd9d27c1b79f7b7d5f30
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2017-11-16 10:28:49 +00:00
Tobias Hunger
4ef01c961e app_version.h: Make IDE name configurable
Change-Id: I993f452c8d09cf89e9a2958fc8e36b7d2c17ee6f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2017-09-05 10:19:48 +00:00
Eike Ziller
1891af4b07 Specify Qt Creator's "display version" in qtcreator.pri/qtc.qbs
Currently it is set by passing defines to qmake, which complicates
package build setups.
Set the display version where the numerical version is defined. This
also makes it available to developer builds. Also switch around the
display version and numerical version in the about dialog, since e.g.
"4.3.0-rc1" is more descriptive than "4.2.83".

Change-Id: I26dda427975acdc6cc169f8d625f57918167cf19
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-04-21 13:28:54 +00:00
Orgad Shaneh
530c248051 Core: Fix compiler display name for MSVC2017
Change-Id: I0a0a6e2899373241dac0cdec5154ea7f22efd0c2
Reviewed-by: David Schulz <david.schulz@qt.io>
2017-04-18 08:43:13 +00:00
Eike Ziller
36b443dfba Add defines for relative data paths
Derive the relative paths used in code from the paths used by the build
system.

Change-Id: I208ee55d3c1ee76921734f5c1c6c40d3fcb9724c
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2016-12-01 14:24:53 +00:00
Eike Ziller
94a58b4653 File > New: Bring existing dialog to foreground
Task-number: QTCREATORBUG-16932
Change-Id: I1a90ab01825b5cd2f439395cbdf4400075943dc4
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
2016-09-30 08:16:55 +00:00