Commit Graph

72385 Commits

Author SHA1 Message Date
Christian Kandeler
6dd66e012b CppEditor: Fix possible crash in CompleteSwitchCaseStatement
There can be an unexpected null pointer if the built-in code model fails
to parse the code properly.

Fixes: QTCREATORBUG-26316
Change-Id: I5751be505b1182df17f58e1a174d645cef1e95cf
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-13 14:05:37 +00:00
Christian Kandeler
38b97b404a Fix various compiler warnings
Change-Id: I59db57e8501bbd0d0293ccce1b520df8acc07413
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-13 13:56:11 +00:00
Thomas Hartmann
ea8400a9ff StudioWelcome: Do not use TitilliumWeb as system font
Task-number: QDS-1081
Change-Id: I6c78fc0a95163f72168a29373a8e190d4bdf3167
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-13 09:38:26 +00:00
David Schulz
6e6753a064 Docker: use mapped working directory for remote processes
Change-Id: Ibbc89f963ca42510cf072b242a5cdfdc0d4c23ff
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 09:35:57 +00:00
Thomas Hartmann
8b45f1f6c5 QmlDesigner: Only create components as primitives if actually possible
The type might not actually be exported and imported as a folder import.

Change-Id: I0ada27d619727044c2f8b8a601a2632a44c5a7cb
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-13 09:35:55 +00:00
David Schulz
7e9f955a58 Docker: Use only path part of FilePath when mapping to device
Otherwise neither normalizedPathName nor startsWithDriveLetter works as
intended when used with a non local path, but these are required to take
the correct code path in FilePath::mapToDevicePath.

Change-Id: I25e8f1a6a01a3e4056633ff3afec883cfbeb0e46
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 09:35:51 +00:00
hjk
ba7aa5ea9c Docker: Also add Qt Quick stuff to test image
Had to tweak things a bit, and the QML part doesn't start up yet:

Starting docker://e5813ba3db76/data/dev/sessions/docker-quick-cmake/docker-quick-cmake...
QML debugging is enabled. Only use this in a safe environment.
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-'
QQmlApplicationEngine failed to load component
qrc:/main.qml:2 module "QtQuick.Window" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed
qrc:/main.qml:2 module "QtQuick.Window" is not installed
qrc:/main.qml:1 module "QtQuick" is not installed

Change-Id: If7ec4aebee27880e01af6184ae22509e97054137
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-13 08:47:26 +00:00
hjk
11fc62e9b1 EditorManager: Avoid one use of FilePath::toFileInfo()
Change-Id: Id6312657298d29eab2f487213d296c0d5ffe2f9a
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-13 08:37:01 +00:00
Orgad Shaneh
a9ef0a8af8 ClearCase: Minor cleanup
Replace iteration over all documents with a faster lookup.

Change-Id: Iccc20ff2e5a44eef9d0bc925e25ef5c7ebaa98e9
Reviewed-by: hjk <hjk@qt.io>
2021-10-13 08:08:01 +00:00
hjk
f58663ce1c CMake: Use FilePath::mapToDevicePath for construction cmake line
Change-Id: I178803f39b5fa7707c1e4338ff02b9de18b22858
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-10-13 08:07:59 +00:00
David Schulz
0bfbdf5e7c ScxmlEditor: block non Utf8 codecs
Change-Id: I7d44dc0ddb17ab543e9e578d4480a090cc6835f1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-10-13 06:52:59 +00:00
David Schulz
67037b1ca8 Designer: block non Utf8 codecs for FormWindowFile
Fixes: QTCREATORBUG-26028
Change-Id: Ia10804fef127f6caa9f9bd50ab3ff9946499e3c6
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-13 06:52:51 +00:00
David Schulz
cb5325f6d5 Core: introduce codec support check for text documents
So indiviual documents can block codecs they do not support like ui or
qml files.

Change-Id: I65b605762c696d38be9049f0064fd68aad0193da
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-10-13 06:52:46 +00:00
David Schulz
1a0c937485 VCS: use context menu actions of TextEditor in VcsBaseEditor
Change-Id: I1947190ad0147d15cd4e95c5dff102b795a78bfc
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-10-13 06:30:38 +00:00
David Schulz
9ea3d61aaa VCS: update the text cursor of VcsBaseEditorWidget
TextEditorWidget::slotCursorPositionChanged makes sure that the multi
text cursor in the TextEditorWidget reflects all changes of the
QPlainTextEdit cursor.

Fixes: QTCREATORBUG-26360
Change-Id: I43d612c6f85fedbf45179898e044b516a93a3ed8
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2021-10-13 06:30:34 +00:00
Alessandro Portale
6703162783 Debugger: Add commandline to "Unable to determine gdb target ABI" warning
Helps finding out which gdb doesn't want to tell.

Change-Id: Iab374f577ee133a3bad576dd425cad5c91391f41
Reviewed-by: hjk <hjk@qt.io>
v6.0.0-beta1
2021-10-12 13:02:20 +00:00
hjk
d20a0c8c03 QmlDesigner: Add #include <QTextStream>
Amends d1b62588c5.

Change-Id: I10a6fe427087e60dd29b18488e15519a88fd77df
Reviewed-by: hjk <hjk@qt.io>
2021-10-12 11:34:14 +00:00
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
Cristián Maureira-Fredes
c2996081c3 doc: replace old quickdesigner by qmldesigner
Fixes: QTCREATORBUG-26222
Change-Id: I8445a5a98299bac3c27334c6c91a1a9cddc8e9d9
Reviewed-by: hjk <hjk@qt.io>
2021-10-11 10:41:15 +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
9b6f60992c QmlDesigner: Update repeater parent when repeater properties change
Any time repeater properties change, the repeater parent should be
dirtied to ensure it rerenders. Often the rerender is triggered
incidentally due to other triggers, but e.g. in case model value is
changed to zero, or if model property is removed, no other trigger
causes rerender.

Also moved the repeater parent checks into QuickItemNodeInstance
to avoid polluting Qt5NodeInstanceServer with such stuff.

Fixes: QDS-5233
Change-Id: Idd89e23c5ad022d26f443d665dac81dc2cbb0b28
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-10-11 08:44:13 +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
Johanna Vanhatapio
7c2121bcfd Doc: Fix the file name for directional light
Change-Id: Idd70918270f12371cf6dc6215047ef612616b4ec
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-10-08 12:34:02 +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