Commit Graph

47434 Commits

Author SHA1 Message Date
Alessandro Portale
bf852d8fed TextEditor: Better default background colors for C_SEARCH_RESULT_ALT1|2
C_SEARCH_RESULT_ALT1: Give it a bluish tint.

C_SEARCH_RESULT_ALT2: Black on red is quite sneaky on many people's
eyes. This changes the red background to a brighter and less saturated
red.

Change-Id: Id1000119583bf05d47206d877a791ccc42323753
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-17 12:54:26 +00:00
Christian Kandeler
ab91e547da ClangTools: Allow to disable a specific type of diagnostic
... from the results list.
This is much more convenient for the user than having to locate the
diagnostic in the settings first.
This patch deals with the global settings. We plan to offer the same for
project-level settings in a follow-up patch.

Task-number: QTCREATORBUG-24852
Change-Id: I7a97189c393048b98b9c2cdb6f21861a34670e8f
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-17 12:40:58 +00:00
Knud Dollereder
83187ba54f Enable pan and zoom gestures for the formeditor
Use continuous zoom for mouse-wheel zoom
Directly apply zoom and not by detouring through custom notification
Moved logic related to zooming from the zoom-action into the view

Change-Id: Ib56779f3ea686736cc419aec94d7b5566091fb96
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-17 11:53:11 +00:00
David Schulz
5da4c61f6c Debugger: Fix tooltip expression collector
Only use the selected text from the text cursor if the requested
position is inside the selection.

Task-number: QTCREATORBUG-24180
Change-Id: I1d9b07fec2f89c125fa6568aa76130f252e146a4
Reviewed-by: hjk <hjk@qt.io>
2020-11-17 11:32:42 +00:00
Jarek Kobus
8f4532daae Fix warning about deprecated QProcess::startDetached()
In Qt 5.15 QProcess::startDetached(const QString &command) overload
got deprecated, and in Qt 6 it has disappeared.
We substiture it by setting explicitly the program and
arguments on browserProc. In order to properly separate
the command into program name and arguments we use
Utils::QtcProcess::splitArgs(). We also handle the case
when a path to file browser was not specified, and the case
when starting a file browser failed and the error was empty.

Task-number: QTCREATORBUG-24098
Change-Id: Ie9c9581b303407ddc5c64264576ad39ec0894bdb
Reviewed-by: hjk <hjk@qt.io>
2020-11-17 11:31:53 +00:00
Jarek Kobus
3998e30684 Fix a warning about const signal
Fix a [clazy-const-signal-or-slot] warning. Instead of defining
a signal for internal usage, use directly QMetaObject::invokeMethod().
Don't declare scanDirectoryForQuickTestQmlFiles() a const method
anymore.

Change-Id: I036afc6124dfb877ced7d9e798920c8a8fde1892
Reviewed-by: hjk <hjk@qt.io>
2020-11-17 11:30:23 +00:00
Eike Ziller
8f655c60b7 Add some known "path" variables to environment widget
Task-number: QTCREATORBUG-24925
Change-Id: I754a1dd1df88232570b33bb6eb05719dbb8d04fd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-17 10:41:05 +00:00
Jarek Kobus
0a230928c0 Drop autoconnections
Use typed connections instead.

Change-Id: I04205c877541722cc059398a146a216727daa103
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-17 10:13:52 +00:00
Jarek Kobus
32e455c12e Fix a crash when changing filter for clazy analyzer
Fixes: QTCREATORBUG-24935
Change-Id: I94ff4f1a5bdd07c8055608048773b4a81a81fcb3
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-17 07:40:51 +00:00
Jarek Kobus
eede69e313 Don't create a temporary list of values for qDeleteAll
It's enough to pass QHash as an input for qDeleteAll,
it will delete all values and won't touch keys.

Change-Id: I5a924f4d59787ac3fd1ffaf07709ab91ba96c7c6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-17 06:29:14 +00:00
Jarek Kobus
b6a51f046f Use static version of QFileInfo::exists()
Docs say it's faster than creating QFileInfo object and calling
exists().

Change-Id: I0c10216bf72ab11ebf97b66a113d85ac0768d918
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-16 22:49:40 +00:00
Jarek Kobus
eaba657d90 Fix warnings about possible detach of temporary objects
Calling first() or last() on temporary container may
unnecessarily detach the container. Fix it by calling
constFirst() and constLast().

Change-Id: I2460efd5dbee1534eec8a514d9bff2a947bfddf9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-16 22:11:46 +00:00
Jarek Kobus
27c962f503 Remove QStringRef leftovers
Change-Id: I3cf4a4f58b9c7a8572745c73451c483f3d52e606
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-16 22:11:38 +00:00
Jarek Kobus
e97a267533 Don't create a temporary list of values for qDeleteAll
It's enough to pass QHash as an input for qDeleteAll,
it will delete all values and won't touch keys.

Change-Id: I9b00963888ac780f74eabdf59ad02890a042a0d2
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-16 22:11:33 +00:00
Miikka Heikkinen
d4775673f7 QmlDesigner: Fix navigator preview tooltip issues
Preview tooltip is now shown as separate frameless tool window instead
of just a child widget to ensure it is always on top.

Fixed the layout issues with preview tooltip when the navigator
is moved to another screen with different pixel ratio.

Node internal id is used to identify the hovered node instead of
row index, as row index is only relative to immediate parent node.

Change-Id: Ida06565c7addfb6247e13ded11a1fed51097f0e9
Fixes: QDS-3119
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-16 15:31:12 +00:00
Mahmoud Badri
c73f93a7cf QmlDesigner: replace qAsConst with as_const in the model class
Also revert few linebreaks from previous commit to satisfy the 100
character rule.

Change-Id: I92e85ae79338b3f1d9f9cb89d9c71f0d1f436198
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2020-11-16 15:19:52 +00:00
David Schulz
1984ebcf51 Git: fix assert when comparing GerritApproval
When compiling a debug msvc build std::stable_sort verifies that the
compare function returns the inverted result when switching the left
hand side with the right hand side argument.

Change-Id: I34549d69144966c1b74f368e9af35ec565dc791e
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-11-16 14:00:05 +00:00
Leander Schulten
92667c779c CppEditor: Remove using directive at global scope always in all files
Previously only using directives in the global scope that followed the
quickfixed using directive were removed

Change-Id: I330acfe3236a6845fd1667f9fa699ab6c8fb560d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-16 13:55:27 +00:00
Henning Gruendl
d3ab7a89f9 QmlDesigner: Add "NOT" option to binding editor
* Add "NOT" CheckBox in binding editor if boolean target
* Fix wrong node assignment in binding editor context menu call
* Fix connection editor state iteration source
* Cleanup redundant code

Task-number: QDS-2872
Change-Id: I8780bb1507f991b52aacfb011b889896d74ccb4f
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-16 13:51:24 +00:00
Jarek Kobus
6d5e302157 Use typed syntax in calls to QMetaObject::invokeMethod
We do it wherever possible. Some places can't be fixed
since they still rely on dynamic introspection
(mainly QQuickItem cases).

Change-Id: Ia00b4a04d8b995c9a43b7bf2dbe76a60364bb8ca
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-16 13:45:02 +00:00
hjk
d7b19b929d Qbs: Use a StringAspect for the "Equivalent command line"
Change-Id: I8d8c6039282dcdb870202e6d0d42d017f557b26a
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-16 12:12:59 +00:00
Mahmoud Badri
9e8d88c90b QmlDesigner: cleanups on the Model class
Change-Id: I61764f5ea829b3a59d55b341d02aedfda7b87b84
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-16 11:33:06 +00:00
Eike Ziller
4498c12ddc Merge remote-tracking branch 'origin/4.14'
Change-Id: I790a8b9002a55f52090d085b65d9fe58b7eb1d20
2020-11-16 11:26:03 +01:00
Henning Gruendl
c7b5501c84 QmlDesigner: Update icon font
* Add flow action, flow transition and search

Change-Id: I87fc48904b5f1a56aca34f2a66b2aef4657d86bc
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-16 09:30:42 +00:00
Christian Stenger
d60fa5c762 Python: Improve auto detection
Do not list app installer redirectors as python
executables. Windows may put empty redirector files
with the same name in a path that is prepended to
PATH for the respective user.

Change-Id: I9418784ef099df72ef8d0426e55198b30fbeed6a
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:33:49 +00:00
Christian Stenger
bf8eb2d270 AutoTest: Fix using of cache
Change-Id: I3f7695c96139c1f1809631ead1b723e3820b240d
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:33:40 +00:00
Christian Stenger
5d1c789c27 AutoTest: Introduce TestToolConfiguration
Preparation for having code based and build system based
test items.

Task-number: QTCREATORBUG-23332
Change-Id: I4d21142d74b40b988d82c69d02f5c6633c8cebe4
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:56 +00:00
Christian Stenger
73613d8549 AutoTest: Introduce ITestTool
Preparation for separating handling of code based and
build system based tests.

Task-number: QTCREATORBUG-23332
Change-Id: I490af5f3157fd4a8cd07d976cdfd9e4503ade97b
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:31 +00:00
Christian Stenger
e95041c054 AutoTest: Guard against nullptr access
Change-Id: I0378b043ed240533ce6f4b341705dc84d6ede7eb
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:17 +00:00
Christian Stenger
239a59c596 AutoTest: Introduce ITestConfiguration
Preparation for an additional simpler test configuration
which needs to have the same common base.

Change-Id: I1800ed5d7301f1aea99eba6ef588a204697bd569
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:10:04 +00:00
Christian Stenger
55298cc211 AutoTest: Introduce ITestTreeItem
Preparation for having separated test tree items with a
common base.

Change-Id: I3735f582cc96910e971f5a41c799cc0729a10a58
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-11-16 08:09:46 +00:00
Alessandro Portale
b057ea1ab8 WebAssembly: Revamp Emscripten SDK registration and toolchain handling
Qt Creator's ability to register Emscripten toolchains depended on an
SDK being activated "globally", and on the presence of the ~/.emscripten
file. Qt Creator would parse that file in order to determine the
location of the compiler and the necessary environment variables that
have to be set.

As of recently, the Emscripten SDK does neither activate gobally
anymore, nor is the ~/.emscripten generated. This change here addresses
the new situation in a couple of ways:

- Instead of trying to silently detect everything, add a UI
(IOptionsPageWidget) that lets the user select the Emscripten SDK root.
- Instead of parsing the ~/.emscripten file, parse the output of the
emsdk_env tool to determine the toolchain environment
(ToolChain::addToEnvironment). The parsing is cached. A test for the
parsing is included.
- Instead of registering the underlying clang as compiler, register the
emcc/em++ wrapper scripts, which are (also as of recently) compatible
with Qt Creator's way of determining gcc's predefined macros and built-
in header paths.

One Emscripten SDK is registered globally in Qt Creator. When changing
that, the previous Emscripten toolchains are removed, the new ones are
registered and the kit are "fixed" to use those.

On startup, an InfoBar entry is shown if Qt for Webassembly kits exist
and no Emscripten toolchains are present. That's the case for first-time
use after installing Qt for Webassembly via Qt SDK installer. The
InfoBar entry opens up the IOptionsPageWidget.

Qt 5.15.0 for WebAssembly and Emscripten SDK 1.39.0 are the minimum
supported versions. The new UI will show warnings accordingly.

Task-number: QTCREATORBUG-24811
Fixes: QTCREATORBUG-24822
Fixes: QTCREATORBUG-24814
Fixes: QTCREATORBUG-23741
Fixes: QTCREATORBUG-23561
Fixes: QTCREATORBUG-23160
Fixes: QTCREATORBUG-23126
Change-Id: I017c61586b17e815bb20a90e3f305a6bf705da36
Reviewed-by: hjk <hjk@qt.io>
2020-11-16 07:39:20 +00:00
Orgad Shaneh
783a06b2ee ProjectExplorer: Add a user controlled tooltip to build configuration
Change-Id: I16b95f01273e9be4ebcbcaacd87c6afe4e4bda46
Reviewed-by: hjk <hjk@qt.io>
2020-11-16 07:12:36 +00:00
Christian Stenger
1eb0b02ce9 QmlProfiler: Fix flamegraph test
Change-Id: I27d7067a844e614334a5faedcb2915b3a24ae5e0
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2020-11-16 05:29:50 +00:00
David Schulz
7e10d6d7b5 LanguageClient: remove unused function
Change-Id: If931e1e6d2e28eddb599faefda2590324ff0801b
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-16 05:29:34 +00:00
Thomas Hartmann
ef01956c7c QmlDesigner: Rename method
Change-Id: I43e85703b8a09c33a0685487a42ae333439d9beb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-13 20:10:06 +00:00
Eike Ziller
381c5656e7 Merge remote-tracking branch 'origin/4.14'
Conflicts:
	src/plugins/mesonprojectmanager/project/mesonprojectparser.h

Change-Id: Id38d20ce20981dcdc322fe5d1d7647f4bec89d8a
2020-11-13 16:03:26 +01:00
hjk
7a2e49435c ProjectExplorer: Remove ClangClToolChain::m_clangPath
Use the ToolChain::compilerCommand() instead, which now does not
need to be virtual anymore.

Change-Id: I7cf7a623f86b7faacadae424dcbde8b9dbe8d3a9
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-13 12:50:43 +00:00
Christian Kandeler
3cd2e2c445 CppEditor: Improve "definition from declaration" for templates
- Make sure the template parameters are included in the definition.
- Find the correct insertion location when using an already-defined
  template member function as an anchor.

Fixes: QTCREATORBUG-24848
Change-Id: I1272ba36403904e7aed81bcef48745793c5e2217
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-13 12:49:51 +00:00
Jarek Kobus
ccf1d17bfe Silence the warning about missing initializer for member
Silence the following warning:

warning: missing initializer for member
‘clang::tooling::IncludeStyle::IncludeCategory::SortPriority’
[-Wmissing-field-initializers]
  118 |     style.IncludeStyle.IncludeCategories = {{"^<Q.*", 200}};

According to the docs of IncludeCategories, the SortPriority field
is optional, and when not set its value is set to the value of
Priority field. So in order to fix the warning we repeat the same
value for SortPriority field.

In addition we ensure that we require at least clang version 10.0.0.

Change-Id: I8baae7a33ad1a7a7f3afe66779f482b29a7396b4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2020-11-13 12:11:41 +00:00
hjk
c60c642fe5 ProjectExplorer: Consolidate *ToolChain::compilerCommand() implementations
All ToolChains had an compiler command member one way or the other, so have
one in the base class and drop all others.

ClangClToolChain is quirky insofar as it diverts the compilerCommand()
to the additional m_clangPath member. This is left for a later patch.

Change-Id: Ic8b5da17a4b7050966d0c37573edb0706fac2ecf
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2020-11-13 11:25:25 +00:00
Jarek Kobus
11ce7e1206 Silence the warning about comparing type with different signedness
Silence the warning:
warning: comparison of integer expressions of different signedness:
‘const long long unsigned int’ and ‘const long long int’ [-Wsign-compare]

Change-Id: I3e0ace4a9aa354f9c8b30814265e9d7516fbdc7d
Reviewed-by: hjk <hjk@qt.io>
2020-11-13 10:17:31 +00:00
Thomas Hartmann
fb9fb01e34 QmlDesigner: Collect events for telemetry plugin
For each action/event we want to track we
emit QmlDesignerPlugin::usageStatisticsNotifier() with an identifer.

This allows counting how many states, transitions, timelines were created
and we track every registered action.

More 'trace points' can be added later.

Change-Id: Ibb31e1b7e20d984a10697e05bb4417e7ad1b8980
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-11-13 05:38:20 +00:00
Alessandro Portale
d30d0e05d8 MesonProjectManager: Add .qrc file to the Qbs project
Fixes the error message:
Could not load image:  ":/mesonproject/icons/meson_bw_logo.png"

Change-Id: I41487f827cda9885b525b658117ff04eefb503e8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2020-11-12 18:41:10 +00:00
Thomas Hartmann
49230c2122 QmlDesigner: Do not setup imports when checking
Change-Id: I4b3aabeb3384b25918ad9eac84fc44f1679da7a6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-12 15:58:28 +00:00
Thomas Hartmann
c9c56c2099 QmlDesigner: Duplicate state in transaction
Change-Id: Ib7db0b82f17edc77adfa91869ac9333f9a6be679
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-12 15:49:46 +00:00
Thomas Hartmann
98c735be6e QmlDesigner: Fix for high dpi and Qt 6
When grabbing the window  we have to clip the window using
the root item size.
Depending on the window manager the window is resized.

Another issue is that when grabbing the window offscreen
the pixel ratio is always 1.

Before we assumed that the pixel ratio of all images
is the same for the host process as for the puppet.
This is not necessarily anymore and we have to set
and forward the correct pixel ratio.

Change-Id: I36b467291ab120f825119adea4ed7db10d34266d
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-11-12 15:15:48 +00:00
Thomas Hartmann
0fea7203a7 QmlDesigner.MetaInfo: Add special case for "QML.QtObject"
In Qt 6 QML.QtObject is used as typename for QtQml.QtObject.

Task-number: QDS-3117
Change-Id: Ib4b78d69781d946a7d5a3447841f20482c44ddf5
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2020-11-12 15:09:24 +00:00
Thomas Hartmann
d2293204d4 QmlDesigner: Use single transaction to add state
The QtQuick import has to exist.

Change-Id: I2184a6981b8307b593bddcc2feba8dee28a7eaf3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2020-11-12 13:51:05 +00:00
Christian Kandeler
80be8c2b14 QtSupport: Prefer suffixed uic
This prevents the wrong uic from getting picked up in the case where the
unsuffixed version belongs to a different Qt.

Change-Id: I3fe7b4afc25a2733c632bb0195ca7ea74666bdbf
Reviewed-by: hjk <hjk@qt.io>
2020-11-12 13:16:18 +00:00