Commit Graph

68845 Commits

Author SHA1 Message Date
Christian Stenger
366936e331 Utils: Fix Qt6 build
Amends 08040e4e94.

Change-Id: I8e34dc73b7449b20c7c8ea140010a4bd3b31daff
Reviewed-by: hjk <hjk@qt.io>
2021-06-03 06:36:58 +00:00
hjk
f4a529ea95 Utils: Change signature of MacroExpander::registerFileVariables
... to take a function returning a FilePath as base.

Implementation is (not) yet changed.

Change-Id: I624efab35cf38631c816b630be5296bdf696899e
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-03 05:50:18 +00:00
Christian Stenger
018dfc533c AutoTest: Sort tests case insensitive inside Tests view
Change-Id: Idd4fb818e5bac8e036dd50dbaec7db843b3cfca4
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-03 04:48:39 +00:00
Jarek Kobus
a3b5306147 Add TestStringTable scenario
This scenario is used for testing against regression in StringTable.
If the scenario went OK, the creator finishes and doesn't crash.
Later, this scenario will be invoked from additional test, so that
the second instance of creator will run and the test will
check if the subprocess finished OK. So it's going to be combined
with autotests in the follow up patch.

In order to test it, run creator with the following command line:
"-settingspath ~/.config -scenario TestStringTable". Make sure,
that you point settingspath to creator settings which have
proper kit with a toolchain and Qt setup.

The regression may be tested by restoring the
src/plugins/cpptools/stringtable.cpp to the parent of
f4ab1279fd and by applying on top of it
this patch (simple conflict may need to be resolved). In this case
running this scenario ends up with a crash (so, it confirms this test
fails on the old code form before the fix).

Change-Id: Icbb56233495047fd68bfb605fcd088f352a16323
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-02 16:56:24 +00:00
hjk
e2cf0b52a7 Android: Don't check QtcProcess exit code
This is already baked into QtcProcess::Result.

Change-Id: I02b017c7d26b5c42ea4e00cea5c3b393274edfdc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-02 14:21:23 +00:00
hjk
c756d8d2d5 BareMetal: Don't check QtcProcess exit code
This is already baked into QtcProcess::Result.

Change-Id: Ia601c633dd70be375b641208a471792b0b5eceff
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-02 14:21:04 +00:00
hjk
0ba4338467 Utils: Rename QtcProcess::Result::Finished to FinishedWithSuccess
To make clear that this is not just any finish.

Also change FinishedError to FinishedWithError, to create
symmetry.

Also adapt enum member description to reality.

Change-Id: I13e05391eb86fdb24e2ae660f14dfddb282e1104
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-02 14:16:36 +00:00
hjk
08040e4e94 Utils: Move QProcess base to QtcProcessPrivate
Change-Id: I4c6811d42e051fadfcf32edb664ff3bc09e692e6
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-02 13:21:08 +00:00
Jarek Kobus
0f535703aa Implement scenario player
A scenario player may be used for testing Creator crashes which
can't be easily tested with "-test <plugin>" option. Some crashes
are triggered when Creator unloaded plugins and left the
main function. This may happen due to some other threads may
still be running. This scenario can't be tested using plugin tests,
since when the test finishes, Creator still has its plugins loaded.
Also it's not possible to quit Creator from inside the plugin
test, as if we do it, we couldn't report the test result.

The follow up patches will introduce the first test scenario
and provide automatic test for testing against regression
in StringTable.

The scenario player may be potentially used for other purposes,
including automatic presentation of features (yeah!). However,
most probably the API should be further developed for other purposed.
This is just a starting idea.

Change-Id: I0f5c3c028f35a5cdf9130c2cf315dd4b68e81126
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-06-02 11:59:33 +00:00
Christian Kandeler
ff0301635e CppEditor: Tweak test infrastructure
... so we can re-use the "follow symbol" test cases with clangd.

Call Creator like this (clangd needs to be version 12 or later):
$ QTC_CLANGD=<path to clangd> qtcreator -test
'CppEditor,*Follow*,*Switch*' -test 'ClangCodeModel,*dummy*'

During testing, some invalid code in the test cases was uncovered and
fixed.

Change-Id: I9dc650fdba2a27600e6a550420ee873f6fb31d23
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-02 10:52:50 +00:00
Thomas Hartmann
003ab51c3d QmlDesigner: Use correct icons for formatting operations
Change-Id: Ic3f18361e46970a176a2494b0557665c20a87f16
Reviewed-by: Pekka Kaikkonen <pekka.kaikkonen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-01 15:20:57 +00:00
hjk
c2bc7b8d3c Utils: Introduce FilePath::ensureWritableDir()
Combine the test and potential creation in one operation to potentially
reduce the number of remote calls.

Change-Id: I06ffa1256593afec430eb35605ba3b249f1da97c
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-01 14:24:52 +00:00
Johanna Vanhatapio
2672bb2930 Doc: Restructure the QDS Manual
Task-number: QDS-4248
Change-Id: I8361c44eee3ea338b5625851622a45ac202737ef
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2021-06-01 14:12:42 +00:00
Miikka Heikkinen
e3c7a74f68 QmlDesigner: Do not register qml files that are part of imported 3D comp
Imported 3D components are handled via different code path, so they
shouldn't be registered for item library in generic qml file
registration.

Fixes: QDS-4404
Change-Id: I840659301a63583bc66102c56de19924830f876b
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-01 14:02:39 +00:00
David Schulz
9fb4db55be LanguageClient: set the capability for hierarchical symbols
Amends 696dedefa1

Change-Id: Id066ec6ea530b3bc50c4ca71dbfeb59d7520f7ac
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-01 11:46:43 +00:00
David Schulz
5ce704b394 Core: Fix opening files with line column postfix
Having two files with in a locator filter with the same name except one
having an addition line column postfix like
	/tmp/asd
	/tmp/asd+12
made it impossible to open the second file from the locator. Since we
already have the selected file and the locator filter string we also can
use that to parse the postfix manually and make sure to always open the
selected file from the locator widget.

Change-Id: I389603622fbdef01d09b3584192ed6d47e9e170f
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-01 10:49:11 +00:00
Eike Ziller
5dedd1fba7 Fix parsing line and column information from file paths
Amends 84ea908b2d

Change-Id: I9f203d4d4903549e220caa8e3c4b9887da68d049
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-01 10:45:48 +00:00
Thomas Hartmann
8910601b78 QmlDesigner: Allow creation without version number
Task-number: QDS-4403
Change-Id: I952de9a2a6aa345b041f890fb2d364850c25e492
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-06-01 10:44:18 +00:00
Marco Bubke
a19ff0550b QmlDesigner: Enable database sharing for image cache
Two creator can be started concurrently. This can lead to strange
behavior.

Change-Id: I0556905aba7d3a71d7b5e75daa954cb4c91b2a4f
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-01 10:22:05 +00:00
Miikka Heikkinen
f913a65405 QmlPuppet: Support multiselection transformations in 3D edit view
Add support for moving, rotating, and scaling a multiselection of 3D
nodes in 3D edit view.

Fixes: QDS-4313
Change-Id: Icf83911ac6f87fde1cb79d6f5059ae01ed434d7f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-06-01 09:38:00 +00:00
David Schulz
14067cca86 LanguageClient: filter completion results
Use the optional filter text or the label of a completion item to filter
out results that do not match the current completion prefix. Fixes
completing code with language servers that do not provide server side
filtering.

Done with: Thorbjørn Lindeijer

Change-Id: Id27b88bb4e8f0b8b68d6ee49bd1d41ec11d54c45
Reviewed-by: Thorbjørn Lindeijer <bjorn@lindeijer.nl>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-01 09:33:30 +00:00
hjk
f4a8c4590e ProjectExplorer: Fix ProcessParameters::effectiveWorkingDirectory()
... for remote setups: QDir::cleanPath() must not be used on a
fully stringified FilePath, as this also collapses the double slashs
in the :// separator.

Change-Id: I186328ecfc33665c50eda4efebe5d7a4cc3e4917
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-06-01 08:52:04 +00:00
Jarek Kobus
ba0c797e6d Compile fix
Amends: 615b37193b

Change-Id: Ic40e13320a964f20e50ddaf6a776592632361b3a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-01 08:40:14 +00:00
Christian Kandeler
b0d4fc359f ClangCodeModel: Let user choose the override
.... when following virtual function calls.
This brings us up to par with the built-in code model.
We do lose the icons, but they are of very little use in this context.

Change-Id: I29b27d538e7277d06a5af7acee07bddb6eb94c98
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-01 08:22:21 +00:00
Assam Boudjelthia
1372dfdf7f Android: Fix multiple clang clazy warnings
Change-Id: I2ea6cebd16c09a8a4502f4719d99a9d85e5e7d02
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-06-01 08:11:56 +00:00
hjk
41240ed706 Utils: Differentiate between WritableDir and ReadableFile
Brown paperbag.

Change-Id: Ice4e3760bbfc5699f7efef49919505657d731867
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-01 08:09:28 +00:00
hjk
1fb73905c1 Utils: Simplify and extend MacroExpander::expand(FilePath)
At least for the host it is imaginable that variables might be useful.

Change-Id: Ia8aeeef49c195db3877256c6726a832ec966c420
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-01 07:59:26 +00:00
Christian Stenger
615b37193b AutoTest: Support multiple test cases for Qt
Multiple testcases inside a single executable are not
supported officially, but widely used.
Detect them and handle them as appropriate as possible.
Single test functions or data tags are not selectable
as they cannot get addressed correctly and rely
strongly on the implementation of the test main.

Fixes: QTCREATORBUG-18347
Change-Id: I0f0f42579709d8896e034a6df356cb560291d2ba
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-06-01 07:36:25 +00:00
Miina Puuronen
0147fdfc8c QmlDesigner: Fix dropping assets from file explorer to Assets Library
When dropping assets from file explorer to Assets Library, user couldn't
see "Add Resources" dialog if it opened behind file explorer. Dialog was
already modal but now it's WindowState is also set to WindowActive,
giving the dialog focus.

Fixes: QDS-4450
Change-Id: I54ced0f1d51df3994cc688c926de0104d933b83d
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2021-06-01 07:28:12 +00:00
hjk
57281f10a3 Utils: Add a convenience QtcProcess::start overload
Having QtcProcess::start(const QString &cmd, const QStringList &args = {})
makes porting easier.

Change-Id: I9a028b1ad99d393d14fd9c88488c179a2daa90dd
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-01 06:47:57 +00:00
hjk
a490745ae0 Docker: Remove some toUrl/path indirection in FilePath access
Change-Id: I8528f28fe64c99d251b20d486438fcd594b55824
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-06-01 06:01:42 +00:00
Marco Bubke
da267946d9 QmlDesigner: Sync project storage
Task-number: QDS-4423
Change-Id: Ia99df711effff2909b0a57ecebfb386ca51165f8
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:19 +00:00
Marco Bubke
8603eb5ba9 Utils: Remove std::initializer_list contructor
If you write

Utils::SmallStringView view;
Utils::SmallString text{view};

it selects the std::initializer_list contructor. Not the didicated
constructore. It is much to easy to get it wrong so it is better
to make it explicit.

Change-Id: I4240eaf1f39cf71d37df4480fea1ecfa3ea83cb0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:11 +00:00
Marco Bubke
7b330d3496 Sqlite: Add insertUpdateRemove
An generic approach to merge values into a database. It is comparing
two ranges. The first range is the Sqlite select range and the second
one which are the new values. New values are inserted, change are
updated and missing values are removed. Unchanged values are not
touched. The compare function is comparing a key. Both ranges are
binary ordered.

Change-Id: I973c83677ea74f8fa62bd7ab8a73ed560c806562
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:43:02 +00:00
Marco Bubke
6fa399eccf Sqlite: Make selects even a little bit more random
Returning selects in the reverse order can find hidden bugs.

Change-Id: If06c0de368de3277e5cca02fadfd6ea3fa323847
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:42:58 +00:00
Marco Bubke
b9ea367769 Sqlite: Activate optimization SQLITE_ALLOW_COVERING_INDEX_SCAN
It is disabled by default because it can break buggy legacy code.

Change-Id: Icd3469b809b93cb9a4b9c95457ded42ea18a7c09
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:42:50 +00:00
Marco Bubke
02f794b9f4 Sqlite: Disable the non memory temp store
We don't use it anyway.

Change-Id: I6718782a4f0d3b05b40c43442b36e403ac3ff28e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:42:39 +00:00
Marco Bubke
b2cd0c32a5 Sqlite: Open Sqlite by default in exclusive locking mode
There are no extra files for the WAL in the excusive locking mode and
it can be even faster because the logging is happening on the heap.

Change-Id: I59d75dd2aa95d802ba67c8534a5cd8ab32a343df
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:42:20 +00:00
Marco Bubke
52698bf924 Sqlite: Add new sqlite compile options
Change-Id: I104bcd74f464155d8b9785f03a96b4b5d73df469
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2021-05-31 16:42:06 +00:00
Marco Bubke
494469641a QmlDesigner: Move source cache types to their own header
The namespace is now Cache for that types.

Task-number: QDS-4306
Change-Id: I479f1ca534455a41de9dc1d6a1fd891e1d8973eb
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:37:59 +00:00
Marco Bubke
b3bed53c4f QmlDesigner: Add SourcePathCache
Task-number: QDS-4306
Change-Id: I5adbf3893cb198c52c1fd433f599d21317c6881c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:37:08 +00:00
Marco Bubke
f7d09630b7 QmlDesigner: Add sqlite function unqualifiedTypeName
Task-number: QDS-4305
Change-Id: Ic9f16c6d5e9af8a3a6ffaff817c3b82af0fc8d61
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:36:35 +00:00
Marco Bubke
019d948552 QmlDesigner: Move project storage to projectstorage subdirectory
We save their not meta info related data. So it is better we move it
their own subdirectory.

Task-number: QDS-4304
Change-Id: Ib99419e992fced93fb245a8c48e02ee256823def
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:32:12 +00:00
Marco Bubke
e4fea9f159 QmlDesigner: Add project storage
Task-number: QDS-4252
Change-Id: Ic74e027b20bc41f3712e3ae155cddc64f8972cb0
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:16:48 +00:00
Marco Bubke
a79adedb90 Sqlite: Add noexcept to swap
Task-number: QDS-4289
Change-Id: I74bccb6117904773f400fbe37505de141f816895
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:14:59 +00:00
Marco Bubke
f764e4f0aa Sqlite: Change error handling for reset
Error handling in reset() is not needed because it is only repeating
the errors of step(). We do already handle them. Reset() is also mostly
called in destructors so we can not do much about error there. Reset
is only now reset the statement to a clean state again which is what
we want.

Task-number: QDS-4286
Change-Id: Ifa50859f3d47cc110ef03d7273a01d4419eca9aa
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:13:58 +00:00
Marco Bubke
ef4f2a4dcf Sqlite: Add unoptional value fetcher
There is now value, valueWithTransaction, optionalValue and
optionalValueWithTransaction. Sometimes you want to return
the default constructed value as default. So this is now possible.
This simplifies some code but can be even more optimal.

Change-Id: Ibbb6b5ca47803344ed646bfa257602b6db52e0fe
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:10:09 +00:00
Marco Bubke
c78d1c171f Sqlite: Add *WithTransaction fetcher
There are many simply fetch functions which can now be simplified.

Change-Id: Ibf542ee8b07a1b06ea3dae695da1f69065e9dd71
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-05-31 16:07:30 +00:00
Marco Bubke
5fda083436 Sqlite: Add exception if statement is called outside of a lock
Sometimes it is really hard to trace if sqlite statement is called
outside of a database connection lock. So we know throw an exception
in the unit test. So we get failing tests.

Change-Id: I71485b9473075751a2fb771ce7e2954e28d8413e
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-05-31 16:07:14 +00:00
Erik Verbruggen
943c31a5b4 Fix missing checks for GHS-Arm
Some places where ghs-specific checks were done, were not modified to
do the same for ghs-arm.

Change-Id: I484f98209188e4c160a13248ca3c3f046b342b22
Reviewed-by: <christiaan.janssen@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2021-05-31 14:52:02 +00:00