Commit Graph

62421 Commits

Author SHA1 Message Date
hjk
d75005fbd2 Docker: Use mapToDevicePath() in startContainer()
Change-Id: Iad91144413a176bee036e03192713f5bf4695dcb
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-12 11:24:38 +00:00
hjk
34b42a4772 Utils: Introduce FilePath::mapTo{Device,Global}Path
Re-directing via IDevice::mapTo{Device,Global}Path

Change-Id: Ica957839479967790bbd93e90eced66aa0b122a8
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-12 11:24:29 +00:00
Assam Boudjelthia
f49fbe7f58 Android: set the deploy step widget to expanded by default
The deploy step widget most useful aspect is the uninstall before
deploy checkbox, and having it expanded by default would improve the
UX a bit by avoiding one extra mouse click.

Change-Id: I23ebc90daf9290d229d93dca1b9b25629902e3f2
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-12 10:59:13 +00:00
Assam Boudjelthia
9ccf355abe Android: put "am start" extra args at the end of the arguments list
Add "am start" extra arguments after all the params used by Creator's
deployment process are added. This in turn help tackle two issues:
1) Allowing users to use [-n] to start a different Activity than the
default one.
2) Won't fail deployment silently is a param is a non supported arg,
where adb would try to start an app but the return code is 0 even if
the that app is not found.

Then, we don't need the warning aspect anymore because after this
change, we would rely on "adb am start" to report an exception, but
the app would start anyway if the case 2 above occurs.

Change-Id: Ie609b748e76a068c66c8a9be1d08ccc050167ad1
Reviewed-by: hjk <hjk@qt.io>
2021-10-12 10:57:43 +00:00
hjk
2292e3a7a6 ProjectExplorer: Always set a RunControl's macro expander
In some cases (e.g. "Attach to running application") there is no
proper RunConfiguration, so fall back to Target or Kit.

Amends e78f456083

Change-Id: I0093d5f573fc259fd2a72bbc1aaa22dcb8adbaee
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-12 10:51:12 +00:00
Aleksei German
3ccf269f81 QmlDesigner: Fix for Binding Editor
- Makes Binding Editor modal
 - Fixes Binding Editors hotkeys and actions
 - Adds Target item, property and expected type into title

Task-numbers: QDS-2819, QDS-4878
Change-Id: Ib5c5f73e6552f58828776043f9b793a24c48a1f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-12 08:09:19 +00:00
Christian Stenger
2cc28dea65 Debugger: Fix compile
Amends b6d3e67270.

Change-Id: I0acf8a7bb447e99f7bccfc8f5055a49163727619
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-10-12 07:22:09 +00:00
hjk
786dbcb9e8 Debugger: Force English debugger output
So that ptrace output can be recognized.

Fixes: QTCREATORBUG-26384
Change-Id: Ibd9456963a5379c333782287754bf9aed4235dc4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-12 06:55:41 +00:00
Christian Stenger
46a0abef2e PE: Fix compile with Qt 5.14
Amends 05fa3b06e5.

Change-Id: I26eff2c7f096b0beb77a87486bcae8faa2c137ca
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-12 06:52:02 +00:00
Thomas Hartmann
b071603175 QmlDesigner: Sanitze QML file on save
Before writing the annotations we also sanitize the QML file.
This removes dangling PropertyChanges and dangling KeyFrameGroups.

Those are simply noise and have no relevance. We only sanitize
ui.qml files.

Change-Id: If4bb993b808f9d96ab89296117e776e8e9eec2c3
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-10-11 14:40:29 +00:00
Thomas Hartmann
e3d9ba8f59 QmlProject: Add support for supportedLanguages
Task-number: QDS-5187
Change-Id: Ieb1cb90225db4093178fafe4ebe948d5967a529d
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-10-11 14:40:22 +00:00
Cristian Adam
fded7e4edd CMakePM: Add headers only on compiler groups without PCH sources
The change that treats header files as projects added all sources for a
certain language for every compiler group.

This meant that for the target that has precompiled headers, the source
files would be added multiple times.

This change reverts to adding only the source files from a compiler
group and the header files for a language type, but only for non PCH
compiler group.

Fixes: QTCREATORBUG-26383
Change-Id: Ib328e0a0331e0f373d5a5981489bc17c58b8eed6
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-11 14:17:30 +00:00
Jarek Kobus
797bcb3007 Optimize mime type matching
Don't count "*", don't search for "[" and for "?"
inside m_pattern on every call to matchFileName().
Do it once, when constructing the MimeGlobPattern.

Fix matching the pattern for names without any
wildcard: index of question mark should be -1, not
just different from 0.

This shortens loading a Qt6 project by about 500 ms.

Change-Id: I868fa5c024233467c8e717a8482268da8e9e4a66
Reviewed-by: hjk <hjk@qt.io>
2021-10-11 12:40:35 +00:00
Tapani Mattila
d1b62588c5 Add action to generate CMake files for QML projects
Task-number: QDS-5140
Change-Id: I56d2d3d9efce4bea1281eb60a059119f5b29c02c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-11 12:35:19 +00:00
Christian Kandeler
6669a9e442 CppEditor: Add missing namespace
Like the comment says. Amends 284817fae6.

Task-number: QTCREATORBUG-26304
Change-Id: I6cee9d84cedafa02dce14372e65672731e3e5cfc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-11 12:25:44 +00:00
Artem Sokolovskii
b6d3e67270 Debugger: Use iterateDirectory
Change-Id: I37010d4b33ac1c555f05abe91376b9befe9fa65c
Reviewed-by: hjk <hjk@qt.io>
2021-10-11 11:53:02 +00:00
Tapani Mattila
05fa3b06e5 Wizards: Enable using default values for json wizards by using json "imports"
Task-number: QDS-5214
Change-Id: I67ba3aef15edb3935fb9aeb6b317348de3f60dca
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-11 09:29:51 +00:00
Christian Kandeler
ce34ffdc21 ClangCodeModel: Do not trigger snippets
... in strings or comments with clangd.

Change-Id: Ic16e94051018e91f273fafe2ec90d5395e4cc07a
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-11 08:48:28 +00:00
Christian Kandeler
0a2b504663 CppEditor: Add warning label to clangd settings page
So people with older installations know right away that they can't
expect full functionality.

Change-Id: I8cceb2c88ba1622fa37fb88fc0b96253b6c13a06
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-11 08:47:24 +00:00
Christian Kandeler
a40b7867f6 ClangCodeModel: Optimize getAstPath()
Profiling has shown that this function is a hotspot. Luckily, it can be
easily sped up by taking advantage of the fact that the AST nodes are
(mostly) sorted by range, allowing us to employ a binary search when
looking for a given range.

Change-Id: I950c150543ff68b975d36c6fb652d366b93ea3b2
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-11 08:46:52 +00:00
Miikka Heikkinen
3395cdfd26 QmlDesigner: Make form view react to node source changes properly
Implicit components lose/gain node source when reparented, so we need
to also potentially remove form editor items based on the node
source state of the node itself in addition to the state of the
parent.

Node source can also change without reparenting, and it's not
guaranteed the node source is up to date when nodeReparented is
called, so to make sure we always end up in correct state in form
editor, we do the same checks in nodeSourceChanged as we do in
nodeReparented.

Fixes: QDS-5230
Change-Id: Ib358ccb0db4c26e4857bad00e35930287c4149fb
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-11 08:44:05 +00:00
hjk
7a76f7edbf Revert "FakeVim: Also record NoVisualMode as last visual mode"
This reverts commit e5dd24322f
which caused QTCREATORBUG-26214.

Fixes: QTCREATORBUG-26214
Change-Id: I0d285b4df8fa428201fb6c48bbbad81f8195a941
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-11 06:05:23 +00:00
hjk
e78f456083 Debugger: Use MacroExpander from RunControl instead from Kit
Kit is just a subset.

Change-Id: I9ddfbfeaa5eadaa2e9a1d9a4a3409c6cf8a9658e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-11 06:04:49 +00:00
Jarek Kobus
dfb5ab475e Optimize addTargets() method
Don't lookup for matching targetDetails on every iteration.
Before we start a loop we prepare the appropriate hash and
use it on every iteration instead.

This shortens the total time spent on findOrDefault
from about 2 seconds to about 10 miliseconds now.

Change-Id: I89bb3f472bc9071a54f9900fa057f87b57d4742d
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-08 16:27:02 +00:00
Eike Ziller
2ae0d4d0b1 Merge remote-tracking branch 'origin/6.0'
Change-Id: I655155b35747082ac891a4b95e1680871d9b3234
2021-10-08 16:00:32 +02:00
Eike Ziller
7bb21fcfff Merge remote-tracking branch 'origin/5.0' into 6.0
Conflicts:
	cmake/QtCreatorIDEBranding.cmake
	qbs/modules/qtc/qtc.qbs
	qtcreator_ide_branding.pri

Change-Id: I87b19a51b1950d19eff95086848b0728ba2f0ebd
2021-10-08 15:58:02 +02:00
Artem Sokolovskii
9cb0bd94f0 ClangFormat: Move ClangFormat settings page
- Move ClangFormat settings page to TabWidget in the dialog
that opens when a user press "Edit" button in the CodeStyle tab

Change-Id: Ibd285344f07a6b2b20e275f2134976c50f91a019
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-08 13:09:12 +00:00
Christian Kandeler
e454c91838 QmlPuppet: Fix qbs build
Amends b8b6af0dbb.

Change-Id: I5ef8c58fec1ccdf4b620969c07a2134818b82f1c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-08 12:18:03 +00:00
Christian Kandeler
3ee484332b Fix qmake build of qbs
Change-Id: Ia59128fd3f37a73071bcefacd4163f3e997c7744
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-08 12:17:45 +00:00
Jarek Kobus
a7b9ee22dd Optimize resetOptimalWidth()
Don't call this method directly on every demand, but schedule
a call instead and invoke it once after the current call
returns back to the main loop.

The single call may cost up to ~20ms, and when we call it for
every target having 5000 targets, the total cost is up to ~10 seconds
(every call removes one items, so subsequent calls take a bit
less time). This happens on shutdown when Qt6 project was loaded.
The shutdown time went down from ~15 seconds to ~4 seconds with
this patch.

Change-Id: Id821d72cd8e1dd949112d9167b7736a267b221fc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-08 12:09:25 +00:00
Jarek Kobus
de3e33a76b Optimize setupLocationInfoForTargets()
Don't search for each target separately in the node tree,
but do a one search for all targets at once.

This makes searching for nodes much faster, as in case
of loading a Qt6 project (5 main modules only) with debug build
of Creator, the searching time went down from 36 seconds into
30 miliseconds (just 1000 times faster). The number of targets
in this case was more than 5000.

Change-Id: I015f6fd2a2d5e613307cc7b65746c01a5b14c6dc
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-08 12:09:20 +00:00
Mahmoud Badri
56de449b17 QmlDesigner: Add dropped 3D models to the 3D Editor
When dragging 3D model file(s) from the file system and dropping them
on the 3D Editor, add the models the the 3D Editor after importing
them.

Change-Id: I51ec945097a19e8895eb599b898d49e879100b6d
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-08 11:13:19 +00:00
Thomas Hartmann
8770c8674d QmlDesigner: Delete animations if target is deleted
Task-number: QDS-5221
Change-Id: I98d1a370bf73ef298d3f309d0129b85e2147de6a
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-08 08:07:07 +00:00
Assam Boudjelthia
df904decd0 Android: correct label for build platform sdk in project settings
The current label could be confused with build-tools version, so make
it more explicit.

Change-Id: I96abe9af04e6a6e8518926578411f759b90fc9a0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-10-08 06:52:57 +00:00
Ivan Komissarov
21a90d5332 Update Qbs submodule to the top of 1.21 branch
Change-Id: Ic97122e5b029ce854b24c641b764ea9910e3a2e4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-07 17:20:41 +00:00
Alessandro Portale
0786e967dd Core: Prevent contents of Popups being styled as "panelwidgets"
Content of widgets with windowType Qt::Dialog was already excluded from
being styled as "panelwidgets". This change adds Qt::Popup to the
blacklist.

Task-number: QTCREATORBUG-26370
Change-Id: I76d07da4d8f3ae9f1c8235cdc072a04917454065
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-10-07 16:06:07 +00:00
Eike Ziller
19b59f88d2 Fix that .ui files could be opened in C++ editor
The glob "*.ui" is unfortunately not unique in the mime database, so it
falls back to using the mime magic to determine the mime type.
That process is unfortunately defined by the "standard" in a most useless
way: Even if a mime type matches both by glob and by mime magic, a mime
type that does not match by glob can be preferred, if its mime magic
matches either with a higher priority, or with the same priority but is
alphabetically "smaller" than the other mime type.

Reduce the priority of the "#include" mime magic for the text/x-c++hdr
mime type, so it is lower than the mime magic of the application/x-
designer mime type.

Fixes: QTCREATORBUG-21773
Change-Id: Idfb9ab509c13563b50381b098d643f6fa9292f27
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-07 15:51:20 +00:00
Christian Kandeler
5156c8b510 ProjectExplorer: Fix unsafe kit removal procedure
We iterated through a list that was in the middle of a std::remove(),
which is not safe.

Change-Id: I2b4bce18ebe3365fd22f33521aa82868c10e9647
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-07 15:21:16 +00:00
Jarek Kobus
0b96a1b76b Ignore the wheel event explicitly in order to propagate it further
Qt 6 brings a behavioral change regarding delivery of wheel events:
92df790f46b3a8b17aec2f385d6472fd3f8647f6 and
2a857ee28315c5bacfe2ecaf402ca9005b35c20e. If there is an event
filter installed and wheel event is being processed, the event
is now accepted by default, which means that after returning
true from eventFilter(), the event is not propagated anymore.
Since we want to redirect the event to the parent HelpViewer object,
we explicitly ignore the event prior to returning true.

Task-number: QTCREATORBUG-26369
Change-Id: I2fc8b7c8bfbc343a9ca7951684ced405f8a55039
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
2021-10-07 14:26:18 +00:00
Eike Ziller
69fbe0ab90 ImageViewer: Fix crash when opening invalid movie
Qt 6 sends the finished signal directly from QMovie::start, so if we
connect QMovie::finished directly to QMovie::start, we end up in
an endless recursion and stack exhaustion.

Use a queued connection, and do not restart a movie if it went
invalid.

Fixes: QTCREATORBUG-26377
Change-Id: I9980615f44d0cf7e92f85c010427bd6b67046949
Reviewed-by: Robert Löhning <robert.loehning@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-07 13:26:58 +00:00
Christian Stenger
4bea534c62 CMakePM: Do not register qch files from device
Change-Id: Ie6f8ce74d500d18b69fd5017ddd820356515c21a
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-10-07 13:26:56 +00:00
Thomas Hartmann
8f974cd1c5 QmlDesigner: Implement new functions in QmlObjectNode and QmlTimelineKeyframeGroup
* QmlObjectNode::allInvalidStateOperations
 * QmlTimelineKeyframeGroup::allInvalidTimelineKeyframeGroups

These functions make it easy to find dangling/invalid PropertyChanges and
KeyFrameGroups.

Change-Id: I201a6561a51aba53405e8a8fc92821c467fecb1b
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-07 10:58:22 +00:00
Thomas Hartmann
50557abd03 QmlDesigner: Fix crash
If the target cannot be resolved the result is invalid.

Task-number: QDS-5216
Change-Id: Ibd7884d6638ae653953347862ca1291f963aa3b3
Reviewed-by: Henning Gründl <henning.gruendl@qt.io>
2021-10-07 10:18:59 +00:00
Knud Dollereder
28b87ba4f4 Fix check if a key is supposed for deletion
Moved the function into timelineutils.h in order to be able to
use it from other places as well.

Change-Id: If5fa094abb6ae52d7922bc9bbcb96b482ece7ac0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-07 09:46:57 +00:00
Christian Kandeler
cd453a5c67 ClangCodeModel: Refer to clangd for the AST node under the cursor
The question which concrete AST node corresponds to a given cursor
position is surprisingly difficult to answer, and clangd already has a lot
of code for this. Therefore, we always refer to clangd to get a concrete
node, even if we already have the full AST.

Change-Id: I5d1528d776ee459a53b8e650a616ea7019ec59bf
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-07 09:36:49 +00:00
Thomas Hartmann
cfc732fe8f QmlDesigner: Remove all references also to children
If a node is deleted also children are deleted.
We have to remove all references to children, too.

Change-Id: Ie944b00ffc832fb0fb11ef0380c4b9b30add5757
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-10-07 09:22:21 +00:00
hjk
033d2c5cc3 Docker: create container before running image
Change-Id: Iea4a4ec446a2df6fc299be24615bca605fca83e9
Reviewed-by: hjk <hjk@qt.io>
2021-10-07 08:41:41 +00:00
Miikka Heikkinen
2a96c396f9 QmlDesigner: Notify other views of nodeSource triggered puppet reset
Use resetPuppet() instead of delayedRestartProcess() to properly
notify other views of the impending reset.

Fixes: QDS-5222
Change-Id: I46dc0dfc9f0b675bd2a0fc07c6b7d9cde4d1e48a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-07 08:28:34 +00:00
Assam Boudjelthia
1e765e5963 Android: add environment to removeAvd()
Valid for windows hosts, otherwise, the command might fail.

Change-Id: I3e759c74ea0a785fd226cda08f301f0cce17c9b7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-06 18:50:55 +00:00
Thomas Hartmann
9491c04b8a QmlDesigner: Update TransitionEditor when animation is removed
Change-Id: Ida9c1a44879bd1d8d2bbf6614eda7d8b31de9037
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
2021-10-06 17:53:04 +00:00