Commit Graph

68765 Commits

Author SHA1 Message Date
hjk
f9fd83df9a Core: Introduce PagedSettings
An AspectContainer with an IOptionsPage.

Change-Id: I03d460f788cfcb2c631b2789bc8f7c74a0b62a37
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 05:00:40 +00:00
hjk
2e7930b56e LayoutBuilder: Rename Id to ID
The Id was only used in the demo. "ID" is Not exactly canonical naming,
but this clashes often with Utils::Id, so mis-spell until we settle on a
proper name.

Change-Id: I6fdf806c41abf224f7422ec6c9263db3eb357190
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 04:59:13 +00:00
hjk
c2f9f42653 BareMetal: Use a functor to apply settings
Change-Id: I5e770e6c51a3c709b38879b75c172d4c25e27085
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 04:58:58 +00:00
hjk
e7397ec576 LayoutBuilder: Fix Splitter construction
QSplitter is different insofar as that it doesn't have a Layout,
but a list of child widgets.

Change-Id: I4e1076e39d20df409c4bab93d79770b6d0e5aa8d
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-05-10 04:58:42 +00:00
David Schulz
266202b6b4 CppEditor: reduce complexity of getting previous line
for a given text cursor.

Change-Id: I43591b529e9d04b3ef013db3b9b30cf37773c115
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-05-10 04:34:36 +00:00
Alessandro Portale
03e14c264c Terminal: Remove clazy warning
Don't call QList::constEnd() on temporary [clazy-temporary-iterator]

Change-Id: I92108a5c7706173097ae643774af1dd7d7acb5dd
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-09 14:09:00 +00:00
David Schulz
3dc775a6df MultiTextCursor: iterate over map entries
This will ensure that the cursors are iterated over in the order they
appear in the document. This fixes an issue on copy and paste a
multitext cursors, since the text was copied in the order inside the
document, but inserted in the order how the different cursors were added
to the multi text cursor.

Fixes: QTCREATORBUG-29117
Change-Id: I8475cde7129c378ec7862482226db25e40f61e1b
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-09 14:02:47 +00:00
Marco Bubke
849b8cf000 QmlDesigner: Improve sqlite id
https://www.sqlite.org/autoinc.html says that "If no negative ROWID
values are inserted explicitly, then automatically generated ROWID
values will always be greater than zero."

So zero is an invalid value.

This changes reflect on it and makes it an invalid value too. Null is a
special value in SQL and it could cast to zero by accident. To prevent
that ambiguty we make zero an invalid value too.
You can explicit add negative rowids but that has size overhead because
positive values can be compressed. So explicit not positive values are
not supported.

Change-Id: I417ea9fec1573cfd9f1a98134f8adc567021988c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-05-09 13:42:31 +00:00
Marco Bubke
5ab0b37ba1 QmlDesigner: Cleanup cmake file
Change-Id: I8cca25367741df3ae265413220a64f0c682bada1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-05-09 13:41:51 +00:00
Jarek Kobus
7d35a11fd4 QtVersionManager: Fix a warning about missing initializer
It fixes the following warning:
warning: missing initializer for member
‘QtSupport::Internal::ExampleSetModel::ExtraExampleSet::qtVersion’

Amends bdfa412b14

Change-Id: Ieb984664953f53d458297970e09678c499a26197
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
(cherry picked from commit a5ad722184)
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-05-09 13:13:42 +00:00
Eike Ziller
c68b01c478 Markdown: Support bookmarks and jumping to search results
Redirect the currentLine/Column and gotoLine functions to the text
editor and ensure that it is visible for gotoLine.

Change-Id: I546e2cb1761363e3a75f9adeebcba195e312f00b
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-05-09 11:31:19 +00:00
Marcus Tillmanns
b509e5aef9 Terminal: Fix endless loop
An error in the QPoint constructor version of CellIterator meant
that m_pos could be bigger than m_maxpos.

CellIterator(,State) was also simplified to be more correct.

Change-Id: Ib67b26695fae1e1857d106319037ca8f63bcb250
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-09 11:21:29 +00:00
Marcus Tillmanns
c0f0ccdc78 Terminal: Ensure terminal is visible
When restarting an app, make sure the terminal is visible and focused.

Change-Id: I305eb59ddf2f5e0f2844d47e51500953c3145c38
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-09 11:20:49 +00:00
Marcus Tillmanns
734f559b76 Terminal: Fix cursor/viewport updates
Under some font sizes the cursor size and cell size were not correctly
aligned on the pixel grid, leaving behind artifacts of prior draws.

Change-Id: I25e6efdc44102f24672912e1e56c31be0c686b89
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-09 11:20:42 +00:00
Marcus Tillmanns
5ea6c34a23 Terminal: Fix shell integration for login shells
Change-Id: I78cc4b60b4e2164752b7b65e2e61659e5d5bbe22
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-09 11:20:36 +00:00
Marcus Tillmanns
12504b6802 Terminal: Combine settings
Change-Id: Ic9e3ac9bdba73eb99e8177083e08c8b4b1765972
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-09 11:20:30 +00:00
Jarek Kobus
936086745a FileSearch: Get rid of FileSearchResult
Use SearchResultItem instead.
This change should reduce the remaining freeze described in
a9eb732ce6 even more.

Change-Id: I102b82ed5677360ccd9e425dd0bdd941d87116f0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-09 11:03:48 +00:00
Burak Hancerli
7a2b1f724b QmlDesigner: Change the raw pointer to uniqeptr and rename the main file
Change-Id: I751359d65735b1be9b3e6b27946c23c278a78a6e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-05-09 10:55:55 +00:00
Alessandro Portale
1d4228dfda ProjectExplorer: Prevent context menu on ProjectSelector
The context menu on the ProjectSelector (outside the "SelectorTree")
does not make much sense and pops up with an offset.

Change-Id: I79aa3157e04b9d343077fdbc87b8f7cd891426b4
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-09 09:22:07 +00:00
hjk
d3ef8aa9ad Copilot: Use functor to apply settings
Change-Id: Ie17273a4fd55c2144b2751166fb69bd523033321
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-05-09 09:08:45 +00:00
hjk
3003b6cb2b GitLab: Shift responsibility to signal changes
... from the option pasge (factory) to the settings (storage).

This will help with removing the QObject base from IOptionPage

Change-Id: I04a6b499bdca6065bf8f742b4624beabe7d8f8cc
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-09 08:34:14 +00:00
Christian Kandeler
372ce469fa CppEditor: Remove SendDocumentTracker
This was forgotten in the clangbackend removal.

Change-Id: I73a3016504ee4af5d921e387f1502d8906161c1a
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-09 07:56:23 +00:00
hjk
c8608e5d9f Help: Use functors and layouting in FilterSettingsPageWidget
Change-Id: Ib163a41feeafebf4a80b587b6cebbf83cc8e97cb
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-05-09 06:56:44 +00:00
Christian Stenger
be25db429e Debugger: Fix compatibility for debugger engine states
..when switching back to an older version of QC.
Amends e0219fad4d.

Change-Id: I3662eb95cf1ae72f92688f12cc15b7a42fb1452c
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-09 06:50:16 +00:00
hjk
dfaebde520 ProjectExplorer: Simplify a complex translatable string
Change-Id: I51a3f18b2c05eb7371d77c18f3f390f5809e2920
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-09 06:46:29 +00:00
David Schulz
b2226c99d4 VCS: fix compile of CommonVcsSettings
Remove undeclared operator definition

Amends 65281429d4

Change-Id: I30ffd5d7b4a50acd9db7acef1668a26c942cc50c
Reviewed-by: hjk <hjk@qt.io>
2023-05-09 06:20:20 +00:00
Jarek Kobus
3f7e92e052 Utils: Introduce QTC_STATIC_SCOPED_TIMER()
This macro, similar to QTC_SCOPED_TIMER(), measures
the time spent in a block of code. In addition, the
time spent in a block is saved in a static variable.

This macro enables measuring a cumulative time
spent inside a certain block of code for all invocations.
When a long freeze is being tracked, and QTC_SCOPED_TIMER()
indicates that the most of the freeze is spent inside a loop
with a big amount of iterations, placing
QTC_STATIC_SCOPED_TIMER() inside the loop may detect
the part of the loop that composes in total for the
longest freeze.

In contrary to the QTC_SCOPED_TIMER(), this macro
it doesn't print the message when it's entered.
It prints the output at first hit, and later,
as not to clog the debug output, only at 10ms resolution.

Change-Id: I3360a3ab9147d544f90ce914fb78359f7179c767
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-09 05:18:41 +00:00
hjk
65281429d4 VcsPlugin: shift signalling of settings changes
To allow removing the QObject ineritance of IOptionPage

Change-Id: Id230ee9230dd1bee094b19b5a22d61d37e650d27
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-05-09 04:58:19 +00:00
Tim Jenssen
5a88c3ffc1 QmlDesigner: improve ModuleScanner
handle empty path and paths better

Task-number: QDS-9847
Change-Id: I9dc6f7972835a366a046d06641fbb64494c734fc
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-05-08 15:29:27 +00:00
Tim Jenssen
a946eebd43 QmlDesigner: fix unterminated access to data()
SmallString is not null terminated.

Change-Id: I92346f1befce8afadcf0d5532c17906a7908fff2
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-05-08 15:29:21 +00:00
Tim Jenssen
1d183e4de7 QmlDesigner: use GTEST_INTERNAL_HAS_STRING_VIEW for str compare
constData() was a workaround for the tests

Task-number: QDS-9847
Change-Id: I23fcca794ab50101ae70034079af46303c98c648
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-05-08 15:29:16 +00:00
Tim Jenssen
ed6008c1c2 QmlDesigner: fix warning
Change-Id: I94d99489ff8f5b33df415bdb51fe8171405e744e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2023-05-08 15:29:11 +00:00
hjk
72093746ac Git: Use LayoutBuilder in Gerrit options page
Move towards using aspects and away from IOptionPage's QObject
base.

Change-Id: I07850a6b8e9fa7d2591efc6f76a23f249dfc164f
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-05-08 15:06:02 +00:00
Cristian Adam
a8f288fc9e CMakePM: Store CMake Autorun state for all tools
Amends 2f39b51bdc

The default tool's value is taken as default global value,
then will be saved for all tools.

This fixes the case when the false Autorun value for the default
CMake tool would always be set as global autorun with no option
to actually set global Autorun value due to the "upgrade" path
mechanism.

Change-Id: I17076bc0c77b087c5d4048fdfe74ddf91d837fd4
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-05-08 14:52:48 +00:00
hjk
5a318df0ee Perforce: Don't use Option page as guard object
There's a plan to remove the QObject base from IOptionPage

Change-Id: I142d2323f86e46d7758f8bd9a65c988988a18ed1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-08 14:01:41 +00:00
hjk
1b4aa44e89 QmlDesignerBase: Remove the dependency on IOptionPage's QObject base
The base will be cut soonish, and the only use here was tr() with
a (wrong) context. Use StudioSettingsPage for that now.

Change-Id: I41e4b737713591e002c126bbf97226de7c3f784f
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2023-05-08 13:39:59 +00:00
hjk
3f1a75eacc Git: Small simplification to Gerrit "plugin" setup
The indirection is not needed. It's not really stand-alone, and not
touched before GitPlugin::initialize().

Change-Id: If8552dc69ff9efa18a3f1d6d998a8f28ab65e501
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-05-08 13:25:48 +00:00
Christian Kandeler
7808195f74 CppEditor: Refactor "insert member from use" quickfixes
The interfaces make much more sense now, and the coding style is taken
into account (except for the fallback case where the user enters the
type).

Change-Id: If08dfc41ebd63287fb5b0b187944e7fdf08b0823
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-08 13:09:44 +00:00
hjk
80a425acba Core: Remove QObject inheritance of IOptionsPageProvider
This was not really used.

Change-Id: I86049697d211d88827a9633b367d2121fa8d1f1c
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-08 12:40:26 +00:00
David Schulz
e3e17c4586 Editor: Fix initial enabled state of margin settings
Change-Id: I0adff884743dd8301a9c7f8b7a44f94658af4b5f
Reviewed-by: hjk <hjk@qt.io>
2023-05-08 12:31:47 +00:00
hjk
851f317199 Core: Remove parent pointer from IOptionPage constructor
Not used anymore.

Change-Id: Ic44ce021b1f952337a3193454b5b6649d5847446
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-05-08 12:27:32 +00:00
Eike Ziller
bd660aaf27 CMake: Fix setting additional project files for file watching
Amends d8be2491a5

The change above introduced FileApiReader::takeCMakeFileInfos and uses
it to move the information about additional CMake files out of the
FileApiReader. But that now emptied variable was later used to inform
the project about these additional files. So, that broke the automatic
running of CMake when project files (except the toplevel one) changes.
Instead use the list of additional files that now lives in the
CMakeBuildSystem for that purpose.

Change-Id: I1062593029880af9d4c70e72e1bd101d40ad0c00
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-05-08 12:23:10 +00:00
Tim Jenssen
4b26269131 QmlDesigner: ModelNode model can be null
Change-Id: Ie73bc1346805cf6137edeea5550d0ba5288ecdb4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-05-08 12:01:10 +00:00
hjk
6f253b0694 VcsBase: Move some private pieces off vcsplugin.h
By themselves not worth a pimpl, but since we have one already...

Change-Id: I867e68c5e82f71ebbe16a55eb190d87f981a550b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2023-05-08 11:58:38 +00:00
Eike Ziller
4a2a1c2978 FakeVim: Fix build with Qt 6.6
The connect doesn't work with incomplete type FakeVimHandler::Private
anymore, so move the code.

Change-Id: I686cd19a985f965cebf7d0a927cff4dc80ae746d
Reviewed-by: hjk <hjk@qt.io>
(cherry picked from commit e56e3b6f37)
2023-05-08 11:39:03 +00:00
Marco Bubke
b91279e8d0 QmlDesigner: Remove constructor implementation in import
Change-Id: I4cf5207ac0fd5fd17466f08367061f43c9ed9196
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-05-08 11:37:03 +00:00
Marco Bubke
4be3f6b5e9 QmlDesigner: Improve version handling
Consolidate version handling in imports. It has drawbacks if we copy
code to different places in our code base. Having tests for the version
conversion has advantages too.

The invalid version has not anymore using -1 but the maximum integer as
indicator because an empty version is higher than any other version.

Change-Id: I8608b9509660f4253e8e5ba7397d964defe35e51
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-05-08 11:35:59 +00:00
Marco Bubke
1e84065123 QmlDesigner: Improve major version conversion
It handles now the case that it cannot covert to integer and it is not
anymore allocating memory.

Change-Id: Ie00a7abb5d3e8c6307c5ae6528dca29ebc47ba45
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-05-08 11:34:48 +00:00
hjk
aa8a76c357 GitLab: Use apply functor in GitLabOptionsWidget
Babystep towards removing QObject inheritance of IOptionsPage

Change-Id: Ib36b8ce4dd1f6878abdfe20c0c4e3ddb95e927dd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-05-08 11:29:51 +00:00
Christian Kandeler
de859dfd43 CppEditor: Do not call Snapshot::filesDependingOn()
... in document processor callback. The dependency table seems to get
rebuilt more often than expected, making this operation expensive.
Amends 6d805195f6.

Change-Id: I1eace180b2428756b648fa1c58eb0fb66cce3c0c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-05-08 11:28:25 +00:00