Commit Graph

1150 Commits

Author SHA1 Message Date
Eike Ziller
9d8a419d10 Remove qmake build files
Removes qmake as a build system for building Qt Creator itself.
Keep them for some tests that are not completely moved to CMake yet.

Change-Id: I846c6ef65626b6dfae6375fdc85d00677aa8c2fb
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-20 12:18:15 +00:00
Christian Kandeler
ead181e385 ClangFormat: Move tests into plugin
That's where they belong

Change-Id: I78e33e76a2f42f05961f6fab31da5f3dd583a2e9
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2022-01-20 10:27:13 +00:00
Marco Bubke
704f239b55 Sqlite: Update to 37.2
Change-Id: I43087c35249af1abee5a2172f29dc998c7babd0d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-01-19 12:14:54 +00:00
Marco Bubke
68ac61193c QmlDesigner: Refresh preview image every hour
It is to assumed that the preview image will be changed and we don't need
to collect the time stamps of the files.

Task-number: QDS-5924
Change-Id: Icf5540d7bcc9da17a1497641f6189f35eb47f5d2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-12 16:27:08 +00:00
Marco Bubke
7ce13691ff QmlDesigner: Remove generator from AsynchronousImageFactory
The generator was introduced to decouple the generation thread from the
fetch thread. But for the factory you only generate the image so you
can use the factory thread for the collector.

Change-Id: If569defba0c52dd85b19451a78f0daf5043b4d01
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-12 16:26:43 +00:00
Marco Bubke
3d0d9e8e0c QmlDesigner: Don't save null image for preview collector
Change-Id: I01ad1c12c25a734107b359461508c037a2f23bb2
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-12 16:26:31 +00:00
Eike Ziller
80e0cb56ec Fix build with macOS deployment target < 10.14
As is used for the Qt 5 based prebuilt binaries.
std::optional is only fully supported out of the box since
10.14.

Change-Id: Ide8bd9ac8b66b05e1bb6e9b350edf3e7ffdaf97e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-10 10:28:11 +00:00
Marco Bubke
3cf01fbf07 QmlDesigner: AsynchronousImageFactory generates if the image is null
If the image is update but null we still generate a new image. This
is a ugly workaround for the flaky generation process. Hopefully
we can fix it after all hidden dependencies are removed.

Change-Id: I0e344002a1952fb849393d3e245e31612c69d7bd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-06 22:09:39 +00:00
Marco Bubke
b2e1bcc4e5 QmlDesigner: Add fetchHasImage to ImageCacheStorage
Change-Id: Ieb148abb02527bb84eda4f00af85a66d98731f03
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-06 14:36:19 +00:00
Eike Ziller
1df8dd3c93 Revert "Revert "Use QtcProcess for clangbackend""
This reverts commit d65e47b5c6.
Reverts the quickfix for the performance regression of code completion.
Followed by a minimal fix.

Task-number: QTCREATORBUG-26829
Change-Id: I1afe71c24ee94caadd4fa849c29f6fc030fb1a8b
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2022-01-06 14:34:35 +00:00
Cristian Adam
ec07bf8f7c Revert "UnitTests: Disable some ClientServerOutsideProcess tests"
This reverts commit c22c22c3d6.

Reason for revert: With d65e47b5c6 the tests are passing.

Change-Id: Ide9c12e38c229315364489123f687b50632ffed8
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-01-04 18:58:05 +00:00
Cristian Adam
d65e47b5c6 Revert "Use QtcProcess for clangbackend"
This reverts commit 8724a4efbb.

The above commit made code completion 3-4x slower on Windows, and
8x slower on macOS.

Fixes: QTCREATORBUG-26754
Change-Id: I02424a40e10de2baf3fd01f19f9094c8e82f684a
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2022-01-04 18:01:57 +00:00
Marco Bubke
3e585483c9 QmlDesigner: Check if callback is not null
The AsynchronousImageFactory is not interested in any callback. So it
is providing null callbacks. If they are called there will be a crash.

Change-Id: I252301e4289185e50720849a7cb148d8f1da3e7d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-04 17:38:17 +00:00
Marco Bubke
24087bd8b6 QmlDesigner: Add AsynchronousImageFactory
Task-number: QDS-5861
Change-Id: I3d938b3ddaa965da2105a326ea68f498dbb60fa0
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-01-04 12:00:11 +00:00
Marco Bubke
d479047275 QmlDesigner: Use optional for ImageCache*
There are now matcher in google test for optional.

Change-Id: Ib3389fb0f537fd19a2930e7108483736bbba1628
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-01-04 12:00:04 +00:00
Marco Bubke
3816250f27 QmlDesigner: Add AsynchronousExplicitImageCache
Task-number: QDS-5859
Change-Id: I962be68f22ba0c0118c14149a0d0ecf395934db5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-01-04 11:59:59 +00:00
Marco Bubke
ad505aad59 Sqlite: Strict table support
With Sqlite 3.37 strict tables are introduced:
https://www.sqlite.org/stricttables.html

The introduce strict column types. So you can not add a text to an
integer column anymore. Additionally they introduce the "any" column
which is a dynamic type.

Change-Id: I43c0410821aa154e7de83e24bd221a232f98e910
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-12-14 16:50:10 +00:00
Marco Bubke
90bb92f327 QmlDesigner: Fix broken test ListModelEditor.AddBooleanProperties
Task-number: QDS-5708
Change-Id: I9961838149da19e3ab8670652e9e246f92b67012
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-12-14 16:29:38 +00:00
Marco Bubke
94e91ccc25 Sqlite: Remove virtual interface dependency
With C++ 17 it is possible to deduce the template argument from the
contructor parameter(CTAD). We then do not call anymore a virtual
function but a normal function.

Change-Id: I61c3ce22322c66b256afab278e768014401b08cc
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-12-14 16:29:30 +00:00
Marco Bubke
e391ef7d3f Sqlite: Remove flacky test
Because we don't use the function we can remove it.

Change-Id: I273a9b56589257b17499f41df02d5e40345f2d4b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-14 16:29:18 +00:00
Marco Bubke
d4c6f06a63 Sqlite: Introduce BindParameterCount template parameter
The BindParameterCount is checked at compile time and then again for
the construction of the statement. So we provide an early error instead of
an some error later or even stranger behavior.

Change-Id: I860ca1f78645c222ae1accf5c7a469c77befc3bd
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-12-09 13:13:51 +00:00
Marco Bubke
596ac61872 QmlDesigner: Synchronize without updating exports
If we only update the qml file we don't have to update the exports from
the qmldir file. So if ChangeLevel::ExcludeExportedTypes is set we don't
touch the exports for that type.

Task-number: QDS-5537
Change-Id: I247228076b3f7ac7f6334d10011b408d6406df07
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-12-09 13:13:42 +00:00
Marco Bubke
c1ca2a7103 Sqlite: Fix insertUpdateDelete
Like you can read in https://www.sqlite.org/isolation.html after an
update they same value can be show up for an iterator advancement. This
would be lead to an delete. So the last value for update is saved and
then compared in the delete method. If they are equal the delete is
skipped.

Change-Id: Ic0aa6619f6a4a520eac77be4e5a83cbe533d102d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-12-08 15:01:39 +00:00
Marco Bubke
4e99b13804 QmlDesigner: Make the member of BasicId private
This prevents that it is changed by accident. It should be anyway not
accessed outside of tests and the storage.

The reinterpret cast is defined behavior.

It would be nice to make the constructor private too but it is used widely
in the tests.

Change-Id: Ib0e8393cc950a651138c1e87c1b6a7b3e5a836f2
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-08 15:01:23 +00:00
Marco Bubke
6009f65b9b QmlDesigner: Fix broken algorithm for table without rowid
It seem not to work for tables without rowids. We have to research if
it a Sqlite bug or more propable a misuse of our side.

Change-Id: Ie1e2fdba5f71595f24cad79125c37db0ec9715c3
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-08 15:01:17 +00:00
Marco Bubke
0827556621 QmlDesigner: Synchronize ProjectData to the Storage
Task-number: QDS-5644
Change-Id: Icede506974e88dd64fc866b65f4fa9d64a05aea0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2021-12-08 15:01:05 +00:00
Marco Bubke
56af8b905e QmlDesigner: Improve project storage update
Task-number: QDS-4920
Change-Id: If5a839a6862bab50fe3a3e049cb1214f04eeca1a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-12-08 15:00:44 +00:00
Marco Bubke
c22c22c3d6 UnitTests: Disable some ClientServerOutsideProcess tests
It seems QtcProcess introduced a really long timeout in the tear down
function. This makes the unit test unusable. So long it is not fixed the
tests are disabled.

Change-Id: Ibdac92f6e5cef7b5866f7e64cc163fd1052c272b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-12-07 11:55:54 +00:00
Marco Bubke
9d24d886e2 QmlDesigner: Add imports for qml document parser
Task-number: QDS-5174
Change-Id: I78b7b31108b498035eccb8385ffab621c727cd89
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-11-17 13:41:28 +00:00
Jarek Kobus
3562c5e96e Remove unneeded includes of QProcess from cpp files
QProcess wasn't used in these files.

Change-Id: I24900bcf312eb6ea1ca3bc0c753cebb505ec552b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-11-01 12:04:41 +00:00
Artem Sokolovskii
a013d75728 CppEditor: Change parsing opposite bracket
Fixed behavior:
- when comparing sign was determined as angle bracket
- when in complex combination brackets, an opposite bracket
was detected not correct
- not correct mismatch case highlightning
Added tests for the cases form bug 26395

Fixes: QTCREATORBUG-26400
Fixes: QTCREATORBUG-26395
Change-Id: Ic45566d2677f80fb9a8e4fe830307254dd1db51d
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-25 14:07:44 +00:00
Jarek Kobus
0101808407 Refactor HighlightingResultReporter
In some unlikely circumstances it may happen that
HighlightingResultReporter might be destroyed before
returning from the HighlightingResultReporter::start()
function. This may lead to undefined behavior.

Refactor the HighlightingResultReporter so that instead
of using QRunnable subclass we define simple function
returning the QFuture object directly.

Change-Id: Ib833771a7e46e87c83d10b59ca056a0147fabe88
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-10-21 07:38:53 +00:00
Marco Bubke
428a9ee509 QmlDesigner: Use one synchronization struct
The arguments of the synchronization function are changing constantly, so
all tests have to adapted even for default arguments. To reduce this
changes now a struct is used as parameter.

Task-number: QDS-5196
Change-Id: Id3b6a530bcb8ab043eccce6526088f345d746235
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-20 16:42:47 +00:00
Marco Bubke
b4fcd05451 QmlDesigner: Introduce different modules for cpp, qml and directories
There are now different modules for qml, cpp and directory imports.
Cpp imports are qml import append by "-cppnative".

Task-number: QDS-5196
Change-Id: I599b224892c5ada0224a765d0bde8b32de20b061
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-20 16:41:55 +00:00
Marco Bubke
cb946ec307 QmlDesigner: Support multiple module ids per type
The type will be use source id and name instead of module id and name as
key.

Task-number: QDS-5236
Task-number: QDS-5238
Change-Id: Ibc9c298dc0a6363b630173ec4981d574cecd02ff
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-20 16:41:34 +00:00
Marco Bubke
1b16eb209c QmlDesigner: Add QmlDocumentParser and QmlTypesParser
Task-number: QDS-5174
Task-number: QDS-5228
Change-Id: I0889e8d63b0260aeb0efae1b3c8a373c18ea1f03
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-10-14 07:40:49 +00:00
Tim Jenssen
6860e361a4 qmldom: fix output path
Change-Id: I137accdb788fa4686a0c70dfcc1b66a6c576dcff
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-10-06 08:15:19 +00:00
Eike Ziller
050af56000 Merge remote-tracking branch 'origin/6.0'
Change-Id: If773f217a9708ce0ad0b8adeefe3266ba0371a32
2021-09-29 12:54:38 +02:00
Tim Jenssen
3ed8d60756 QmlDesigner: Integrate QmlDom
Task-number: QDS-5172
Change-Id: Ib17c38ef7b89b05daababaad1f8e2dc39d53a2bf
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-09-28 11:32:34 +00:00
Jarek Kobus
7958de05f5 Introduce Utils::Singleton
Introduce Utils::Singleton class and
Utils::SingletonWithOptionalDependencies class template
that helps implementing singletons that depend on other
singletons. It's guaranteed that whenever singleton B depends
on singleton A, than A is always created before B is being
created, and that the order of destruction is always
opposite to the order of creation.

Dependencies of singleton are listed as template arguments
for SingletonWithOptionalDependencies class template.
The first argument of SingletonWithOptionalDependencies
class template is always a singleton class itself.

Prepare a common interface for all singleton subclasses:
SingletonSubClass *SingletonWithOptionalDependencies::instance();

Make instantiating singletons and its dependencies thread-safe.

Create singletons on demand (only if some code needs them).
It's not needed anymore to explicitly instantiate
all required singletons in tests.

Make it possible (and thread-safe) to instantiate ProcessReaper
and LauncherInterface singletons in non-main threads.

Make the following dependencies between existing singletons:
   SshConnectionManager depends on:
-> LauncherInterface depends on:
-> ProcessReaper

Change-Id: Iefaacab561c2b3dcf07e7fafbb87339ea6a15278
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-28 10:25:29 +00:00
Marco Bubke
9e29b602d4 QmlDesigner: Use ModuleId for Type instead of Module
We already know the module id because it's the source id of the module.

Change-Id: Ice241d38c12c7ca79a525464c53b7d552095a0fc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-27 13:00:25 +00:00
Marco Bubke
03687c1d02 QmlDesigner: Add minimal updates
Exported type names are synchronized so that old type names are removed.

Task-number: QDS-5130
Task-number: QDS-5126
Change-Id: I6e6482170c8197f37f60a57bdfb7f1b450001b4b
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-27 13:00:21 +00:00
Marco Bubke
b2a300dd60 QmlDesigner: Refactor ProjectStorageUpdater tests
Change-Id: I0174153a470ce3009945df9cd2a822150f2f19f4
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-27 13:00:18 +00:00
Marco Bubke
091f157192 QmlDesigner: Adapt project storage changes in updater
Task-number: QDS-5123
Task-number: QDS-4923
Task-number: QDS-4925
Change-Id: I79acbbdb11bf7a0529c1ef005e6b5e1fd0d12aa7
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-22 11:22:11 +00:00
Marco Bubke
6587feb3d8 Utils: Improve string conversion for Qt6
Skip the creation auf a QByteArray. Use QStringEncoder instead.

Change-Id: I3d2297b1fef27acb2136a64587c5af9099d92aa6
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2021-09-21 12:45:51 +00:00
Marco Bubke
728be60986 QmlDesigner: Change import export architecture
The new architecture should be a better abstractions for qml.
ImportedTypeNames are introduced. ModuleDependencies are now taken
over by document imports. Modules lost their version and
ExportedTypeNames gained it.

Task-number: QDS-4938
Task-number: QDS-4933
Task-number: QDS-5009
Task-number: QDS-5032
Change-Id: Ia86921c5be9107fe7d5bfd28f12bf8453769dc10
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-20 07:29:22 +00:00
Marco Bubke
13aaea197b QmlDesigner: Rename Import into Module
Task-number: QDS-4933
Change-Id: Ibc28ae731ffb27734f61eb438230fa58fe800bdc
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-20 07:29:15 +00:00
Marco Bubke
a570d53db2 QmlDesigner: Add ProjectStorageUpdater
Adding a skeleton for the ProjectStorageUpdater.

Task-number: QDS-4819
Task-number: QDS-4793
Change-Id: I230d68f71480d360d71019883510ef22dd276802
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-20 07:28:59 +00:00
Jarek Kobus
ace765c199 Move ProcessReaper into lib/utils
Reuse ProcessReaper inside process launcher.
Automatically reap all internal QProcesses of QtcProcess
(either direct child of QtcProcess in QProcessImpl
or indirectly inside process launcher).
Make ProcessReaper work again on QProcess instead of on
QtcProcess, so it may still be reused for non-QtcProcesses.

Change-Id: I950cac5cec28f17ae97fe474d6a4e48c01d6aaa2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: hjk <hjk@qt.io>
2021-09-06 21:28:19 +00:00
Jarek Kobus
8724a4efbb Use QtcProcess for clangbackend
Change-Id: Ifdcdba765409a09861f81dd3dff405115a986801
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-03 14:06:56 +00:00