Commit Graph

68765 Commits

Author SHA1 Message Date
hjk
b9f9d2574e Utils/ProjectExplorer: More Key and Store
Change-Id: Ic9cc3a36b320c7413c362d1a1cdf024298d25027
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 07:33:53 +00:00
hjk
648efd6524 Utils etc: Even more Key and Store
Change-Id: Id2405d8a89c47ea766439eec91db36ed7313eb92
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-25 07:20:00 +00:00
Eike Ziller
f2da62fd22 Fix exclusion of system directories from (DY)LD_LIBRARY_PATH
We should not only exclude children of system directories, but also the
directories themselves.

Fixes: QTCREATORBUG-29478
Change-Id: I1aa18b2faa03d241b8cc43eb157b5fa49285a12b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-25 07:16:35 +00:00
hjk
788eb8a72e QtSupport: Make CodeGenSettingsPage use the standard settings pattern
Change-Id: Idf4cf50f186e79981d64d9e9567b7fcbcb9eb1cd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2023-08-25 06:15:35 +00:00
Cristian Adam
dd1c9d1b71 App: Replace QtLockedFile usage with QLockFile
We had an import of QtLockedFile from 2008. On Windows we could see a
lot of QtLockedFile cycles for qtcreator.exe. The 2008 version was using
a semaphore.

I've tried the latest QtSolutions version from 2016, which was using
only mutexes. qtcreator.exe would still show up lots of cycles for
QtLockedFile.

Then switched to QLockFile (added in Qt 5.1), and I couldn't see any
more CPU usage!

Task-number: QTCREATORBUG-29416
Change-Id: Ibfd102f3e90de39c807ff1140e597b79a7b6ca8e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
(cherry picked from commit 1fca05959f)
2023-08-24 18:06:35 +00:00
Alessandro Portale
637fdcc5ba Revert "App: Replace QtLockedFile usage with QLockFile"
This reverts commit 1fca05959f.

Reason for revert: Portale +2'ed under the assumption that this
goes into the master branch. This year old issue should definitely
be fixed, but typically not that urgently in a .3 patch release

Let's revert this and move it on master, please. I take the blame for the messy git history.

Change-Id: I8ae5a5e8e89ce38e7fe663b09cb6c2c3ab520ab0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-08-24 17:09:48 +00:00
Cristian Adam
1fca05959f App: Replace QtLockedFile usage with QLockFile
We had an import of QtLockedFile from 2008. On Windows we could see a
lot of QtLockedFile cycles for qtcreator.exe. The 2008 version was using
a semaphore.

I've tried the latest QtSolutions version from 2016, which was using
only mutexes. qtcreator.exe would still show up lots of cycles for
QtLockedFile.

Then switched to QLockFile (added in Qt 5.1), and I couldn't see any
more CPU usage!

Task-number: QTCREATORBUG-29416
Change-Id: Ibfd102f3e90de39c807ff1140e597b79a7b6ca8e
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-24 16:50:24 +00:00
Burak Hancerli
c71ebda677 QmlProject: Fix incorrect conversion of MCU property
Task-number: QDS-10376
Change-Id: Ic16d03355419281a0bf5c8bd04ba5fea317a70d4
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-08-24 15:43:23 +00:00
Mahmoud Badri
29a207c59f QmlDesigner: Add effect maker composition node color value
Since no StudioControls ColorEditor exists, using the HelperWidgets
one and adding dummy context and backend to get it to work.

Task-number: QDS-10404
Change-Id: Ifc1506b4b1f761b6abf4144791f5b0397a90cdf0
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2023-08-24 15:35:16 +00:00
Cristian Adam
6a30ebd01e CMakePM: Only set cmake reply fileWatcher after CMake has run
This avoids the case when CMake would trigger the file watcher when
generating totally different json files.

For example switching branches and doing a build on a big project, like
Qt Creator for example.

The filewatcher would be triggered and the UI would freeze for quite a
while.

Task-number: QTCREATORBUG-29416
Change-Id: I6ff47d8c2553f7718e82d92daae99036f37aca7d
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2023-08-24 15:23:21 +00:00
David Schulz
f8005cced8 Python: use internal terminal for pip install task
Change-Id: I4125f8a12c7a6d2f7d5ebaaf5150051e330b6832
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-24 13:53:43 +00:00
hjk
4943f387c7 Core: Merge editor factory classes
Mainly to simplify the implementation and naming.

Kind of follow-up to 862c9694.

There is some consolidation needed as followup as well as some potential
renamings. I'd leave that for separate patches to keep this here
somewhat self-contained.

Change-Id: I152e138a1d5baadec3f7542fed0894b8d4ffc8a3
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-24 13:51:52 +00:00
David Schulz
512da70456 LanguageClient: fill workspace configuration response
There is already a way to programmatically set the configuration for a
client, take this into account when generating the response for a
workspace configuration response.

Change-Id: Id59b643eefc59732c856c356317764e6c54af69a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-24 13:48:35 +00:00
David Schulz
7fd8df9300 Python: Allow installing requirement files
Change-Id: If4ac1470fdba4b9f1070fc37d35d5d738a18865f
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-24 13:47:42 +00:00
Miikka Heikkinen
144ec097b1 QmlDesigner: Properly delete 3D view actions
Make all actions unique pointers and members of the 3D view,
so they will get deleted once view gets deleted.

Change-Id: I20d576480a2e553d9164a51e72f9f35d9715180e
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-08-24 13:02:19 +00:00
hjk
301112adeb Fix compilation
Change-Id: I1cdf177a3f183a330c405abae7232d7a08cc0742
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-08-24 12:41:41 +00:00
hjk
6c2864bd4b ProjectExplorer: And more Key and Store
Change-Id: Id5787890bdb46bfeef8e3f37923e6dc26cb56c31
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-24 11:20:25 +00:00
Miikka Heikkinen
ef7f322487 QmlDesigner: Set a sensible initial size for various views
Fixes: QDS-10493
Change-Id: Idfb49daa60e73a5ee12da0d418d5122b1b5f6e62
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
2023-08-24 11:07:19 +00:00
Marcus Tillmanns
16454e13eb Core: Allow saving documents without filename
In case a document does not yet have a filename,
simply fall back to save as

Change-Id: I3cb30ab39e30ecba5c720d4b7d4c955f9dd4609f
Reviewed-by: David Schulz <david.schulz@qt.io>
2023-08-24 10:42:10 +00:00
Miikka Heikkinen
3d77155cea QmlDesigner: Implement snapping to increment
When ctrl is pressed during move gizmo drag, the move is snapped to
configurable increment. If the drag axes are aligned to the global
axes, the snapping can be done either to absolute grid or increment
to start position, depending on snap options selected.

If drag axes are not aligned, then drag is simply snapped to
configured increment length along the drag vector regardless of
configuration.

All snapping settings are persistent and shared by all 3D scenes.

Fixes: QDS-10463
Change-Id: I9407e558aae0ad8b72d975fb6dfa15a4e78f6ee8
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-08-24 09:37:48 +00:00
Marco Bubke
28a288d1ac QmlDesigner: Use QStringView directly
We don't need to convert to QString. Removed some ';' too.

Change-Id: I30923f73427062d70e28a5431f9a81f202e4b6a8
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-08-24 08:55:23 +00:00
Marco Bubke
23525fcde0 QmlDesigner: Use QMLDESIGNER_EXPORT instead for QMLDESIGNERCORE_EXPORT for non core
QMLDESIGNERCORE_EXPORT should be only used for core exports. It is still
a little bit messy and that is why it worked but in the long run we want
to clean it up.

Change-Id: I20e898344731fa7b36226b4c3418b336fb98dabb
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-08-24 08:55:13 +00:00
Marco Bubke
91d2c2e019 QmlDesigner: Don't remove already removed node
We call for the removal of the parent property of an already removed
node. So we test here if the node is already removed.

Change-Id: Ica0aab76e6bbd1bfb364ead6096d818ce2e32aeb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-08-24 08:55:04 +00:00
Marco Bubke
55b9d156fd QmlDesigner: Cleanup code
Auto is here much more secure because it prevent an accidental creation
of a shared pointer from a raw pointer.

Change-Id: I16abb623fbfaf2d4e205a302e5bbd667efa1bb2c
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-08-24 08:54:54 +00:00
Marco Bubke
bf5490f325 Utils: Use long small string optimization for move constructor
Change-Id: I3531c4302c7b73a006618bb8b1b3968ecc581239
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-08-24 08:54:46 +00:00
Marco Bubke
8c0402390c Utils: Add some more noexcepts
The code cannot throw any exceptions.

Change-Id: I735269e92458793df10f887b18a5d808070bac5b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-08-24 08:54:36 +00:00
Marco Bubke
5bdbbe81dc Utils: Make SmallStringLiteral constexpr
The whole small string has to be intialized for const expressions. But
because we don't want to pay for that all the time we use a C++ feature
to only do that at compile time. So now at runtime only the control
block and the string content code is generated but at compile time
everything is filled up with zeros.

So you can now write:

void foo(std::vector<Utils::SmallString> &v) {
    static constexpr Utils::SmallStringLiteral foo{"Some short string"};

    v.push_back(foo);
}

The advantage compared to a string_view is that it is only memory
copying the literal because it know it has to be a constant.

Change-Id: Ia0e4bac293c363ae08341d18d47ddaf78e896e6a
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-08-24 08:54:29 +00:00
Marco Bubke
4c52e5ef95 Utils: remove a copy from the SmallString default constructor
StringDataLayout() is now constexpr too. Not that is useful because we
have to wait for constexpr new.

Change-Id: I34982c8b17e1935de5c65ec6fc1b01b572170966
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-08-24 08:54:18 +00:00
Marco Bubke
1be5475f62 QmlDesgner: Add inflate property functions
Sometimes we want to have the dot properties instead of the
value(readonly) properties.

CompoundPropertyMetaInfos inflateValueProperties(PropertyMetaInfos
properties);
CompoundPropertyMetaInfos
inflateValueAndReadOnlyProperties(PropertyMetaInfos properties);

are removing the value proeprties and adding the dot properties if the
property type has properties.

Task-number: QDS-10472
Change-Id: Ia2291f77f1b38bbe62d71319bfa28cf545cbef18
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-08-24 08:54:08 +00:00
Marco Bubke
1bdbe55c28 QmlDesigner: Add NodeMetaInfo::property dot getter support
Dot and dotdot properties can be gotten but three dots or more are not
supported.

Task-number: QDS-10472
Change-Id: I5e05405cd8ce80bc321dd78b2f74158832fed0bb
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-08-24 08:53:26 +00:00
hjk
621a2850d0 Utils etc: More use of Key and Store
Change-Id: Idd2d70617f775d783aee93a2fe82544ad335a739
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-24 08:51:00 +00:00
Marco Bubke
7d948b26d7 QmlDesigner: Support dot properties in NodeMetaInfo::hasProperty
Dot and dotdot properties are supported but not three or more dot
properties.

Task-number: QDS-10472
Change-Id: Ib5e40bfca470fe7520c9caacf0f469892bb73f7c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-08-24 08:50:18 +00:00
Marco Bubke
681468051f QmlDesigner: Add type to NodeMetaInfo
If the project storage works we can access if a type is a value,
reference, sequence or non of the above.

We can even test of values has properties like QFont etc.. That is
removing quite some heuristic code.

Change-Id: Ie3447d99931c6784db178e4b48f7d2f9a4f646fc
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
2023-08-24 08:49:58 +00:00
Marco Bubke
7f9d3b302f QmlDesigner: Add path for property editor in project storage
A simple store for editor path in the project storage. So we can inquire
the path for every type. The storage is synchronized per directory. So
only entries with the updated directory id are affected.

Task-number: QDS-10391
Change-Id: Ic4d0ce17eedd374ade56abd7cab08f2b7a9830c6
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2023-08-24 08:49:31 +00:00
Marcus Tillmanns
0490266723 Utils: Add Aspects::volatileToMap
Change-Id: Ic4b77e27570485864cb4a9a412d685c400a9e7d1
Reviewed-by: hjk <hjk@qt.io>
2023-08-24 08:49:06 +00:00
Marco Bubke
90fea3ebd6 QmlDesigner: Collect panes and specifics in updater
The update is walking a path which is provided by the
QmlDesignerProjectManager paths which ends to Pane.qml or Specifics.qml.
From that paths the module and type name is extracted. That data is
synchronized with the ProjectStorage. If no directory was changed it
will skip that directory. It will to collect the directory id to update
the storage per directory.

Task-number: QDS-10390
Change-Id: I3aaf5528133cf5e5c15f38a9720fbbf540d24eca
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-24 08:49:03 +00:00
hjk
91c1fdb457 Android: Three more simple aspects for AndroidBuildApkStep
Change-Id: Ida4012ab21aa6a05d2222f41350065a38618b9b0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-24 08:44:05 +00:00
hjk
5254765e16 ProjectExplorer: Re-organize KitAspect layouting related functions
Less obscure as it's fairly close to the standard pattern now.

Change-Id: I4680465fbdb9fb6a458c18ef0534e4d8a4a31d1e
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2023-08-24 08:40:32 +00:00
hjk
0667bdaedc Utils/TextEditor: More use of Store and Key
Change-Id: I2feb47b2e6af7a299912b0c73a0c5d8a0e18a8aa
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-24 06:51:20 +00:00
hjk
2bf886ed73 Utils: Use a bit more Key and Store
Also, separate the Key into a separate header to minimiz impact
on #include load.

Change-Id: I4f719cad4d23a71a9c228d0b7f5c2409fd6e24d5
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-24 05:58:05 +00:00
hjk
6e307be365 Utils: Rename the new Storage to Store
Apparently that's what the young people on the web use for such a thing.

Change-Id: I75d5396ff3cb3c26efd6008b5f2261354c4f7896
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-24 05:56:57 +00:00
Friedemann Kleint
14d21f4f2c Designer plugin: Simplify connections
Connect to members instead of using lambdas.
Amends 93de403391.

Change-Id: I401f550ee3f2e3a12086b064f698ec2fc8b5aca6
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2023-08-23 18:50:31 +00:00
hjk
ff647966e5 RemoteLinux: Disable private key path chooser unless key use is selected
Fixes: QTCREATORBUG-29534
Change-Id: I55b0869083ad10a43b635c79c33466b016540a41
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-08-23 16:28:15 +00:00
hjk
5aa503d3d3 Utils: Compile fix
Change-Id: I7b3298313d16b778ba471330d4d019f7e6d92b92
Reviewed-by: hjk <hjk@qt.io>
2023-08-23 15:04:01 +00:00
hjk
753c00543d Utils: Introduce a Storage class
... mapping Keys (currently QString) to Data (currently QVariant),
i.e. effectively an oddly named QVariantMap.

Plan is to

    1. make QVariantMap using loading/saving related functions to use
       Storage instead of QVariant map,
    2. replace QString by a UTF-8 container (QByteArray for starters)
    3. add/remove parts of the map interface so that neither decoration
       of string literals in user code are needed, nor that
       unnecessary allocations happen.

Long term Storage could cover some of the current JSON uses, with
Storage's implementation possibly switching over to something
based on JSON (or CBOR?) directly, to be closer what we typically
send over the wire.

Change-Id: Ic33b8e95fed5268d6298b5391ff42cbb582b56c4
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-23 14:58:52 +00:00
hjk
dc6b40a5c0 Use Utils::Storage instead of QVariantMap in a few places
Change-Id: I02833cf2bc3caaadc22ff93ae530e4aebe4c3868
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
2023-08-23 14:30:50 +00:00
Marco Bubke
22166404f3 QmlDesigner: Use system includes for google test
System includes are silencing warnings.

Change-Id: I7d7954e01a28f94aa5983cfc44eba976d97b0311
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2023-08-23 10:50:09 +00:00
hjk
55b5b8a975 CMakeProjectManager: Fix connection to save tools settings
Amends 4e23f2a6eb.

This should actually not be needed in the end, and rather steered
by the auto registration and settings page apply.

Change-Id: I7f94e776fec4394f539e32e5c527c367251654a8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2023-08-23 10:47:10 +00:00
David Schulz
6e6587c528 ProjectExplorer: allow adding expanding project settings widgets
Change-Id: I27dee2a8d1b14d1dcc535669e3dc9c5369ec2c81
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2023-08-23 09:14:44 +00:00
Marco Bubke
e0314c8204 QmlDesigner: Prefer std::get_if to std::get for variants
It cannot not throw, so no exceptions code is generated. And it is quite
often shorter too.

Change-Id: Icd555cedb880a1547b0ddcbcdd74fc21feb83ccb
Reviewed-by: Ali Kianian <ali.kianian@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-08-23 07:57:55 +00:00