Commit Graph

62421 Commits

Author SHA1 Message Date
Eike Ziller
253c4e55b6 CMake build: Compile QmlDesigner autotests
We cannot do this via a static library, because the tests need
to compile the same files with different defines
(QMLDESIGNER_TEST). Add a function which extends a target
with the corresponding files.

Also do not hardcode resource directories in the test -
the Qt Creator app bundle is no longer in a "bin/" subdirectory
on macOS. Use the build system provided IDE_*_PATH
variables instead.

Change-Id: I21850eba3cb47b4dcfd5e66227183b2d1ff35ff2
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-02 10:09:57 +00:00
Christian Stenger
d59f0f1051 AutoTest: Do not unnecessarily update QmlJS code model
We forgot to update the timestamp indicators which lead to several
triggered updates e.g. when modifying and storing a qml file inside
a watched directory.

Change-Id: I30858ea9e8073d648a84c7f188dff18ddef5b1c1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-02 08:43:11 +00:00
David Schulz
a111a68442 LanguageClient: stop documentHighlights timer on document changes
If the position was changed right before the document was edited the
timer might still be running.

Change-Id: Ieaa4de5cc10f25e6d58afaf9525417e11a34d1db
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-02 08:21:04 +00:00
David Schulz
dc40af5fa5 Clangd: fix opening document with client for project
Using LanguageClientManager::openDocumentWithClient function to assign a
document to a specific server. This function also takes care of
deactivating the document for the old client and opens it if necessary
in the new client.

Fixes: QTCREATORBUG-26205
Change-Id: I3c3a5fbcd3d07c2e492ebffdf7870e4d2cb517d4
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-02 08:20:39 +00:00
Cristian Adam
27f0dd134f CMakePM: Do not treat generated files as project files
This would trigger an infinite loop.

Fixes: QTCREATORBUG-26207
Fixes: QTCREATORBUG-26204
Fixes: QTCREATORBUG-25346
Fixes: QTCREATORBUG-25995
Fixes: QTCREATORBUG-25183
Fixes: QTCREATORBUG-25512
Change-Id: Iaf081a00dcf318a0ec2708e839e0ab6535e0ef4d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-02 08:04:17 +00:00
Jarek Kobus
2d412aeab5 Make a reaper usable for processes from non-main thread
The reap() method needs to be called from the same
thread as the passed process lives in.

In case we are passing a process that lives in a non-main
thread, we move it into the main thread and schedule a call
to reap it again, this time from the main thread.

In addition, make sure that Internal::d is accessed only
from the main thread.

Change-Id: I32c836584b5da3050f9254e53cee352c79e536b9
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-09-02 07:44:51 +00:00
Christian Kandeler
22823b2190 ClangCodeModel: Add debug output to soft assert
I saw this getting triggered recently, and would like to see more
information if it happens again.

Change-Id: I1c616b8126b8b5eea3709a97124968e9e706aaf3
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-09-02 07:06:30 +00:00
Alessandro Portale
cd2e164b7d WebAssembly: Append EMSDK_PYTHON to environment PATH
The wrapper scripts of emscripten 1.39.8 (required version for Qt 5.15)
do not actively use the python interpreter which -at least on Windows-
is found under EMSDK_PYTHON.

This change appends the parent path of EMSDK_PYTHON to the environment's
PATH to make wrapper scripts (e.g. emcc.bat) work.

Fixes: QTCREATORBUG-26199
Change-Id: Icbc89f6d930f1c5ac5e4e6ac919383cfdd1b913b
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2021-09-01 16:34:24 +00:00
Thiago Macieira
3dc9f709c9 QDataStream: don't stream enums that don't have explicit operators
Change-Id: I37d93a60a0d649688bddfffd1693e6b59553ad32
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-09-01 16:07:23 +00:00
Christian Kandeler
284817fae6 Merge CppTools into CppEditor
There was no proper separation of responsibilities between these
plugins. In particular, CppTools had lots of editor-related
functionality, so it's not clear why it was separated out in the first
place.
In fact, for a lot of code, it seemed quite arbitrary where it was put
(just one example: switchHeaderSource() was in CppTools, wheras
switchDeclarationDefinition() was in CppEditor).
Merging the plugins will enable us to get rid of various convoluted
pseudo-abstractions that were only introduced to keep up the artificial
separation.

Change-Id: Iafc3bce625b4794f6d4aa03df6cddc7f2d26716a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 14:53:58 +00:00
Aleksei German
3e1fa0f170 QmlDesigner: Annotation List
- Annotation Dialog structure was reworked
 - Added ListView to Global Annotation Dialog
 - Added Apply button to all Annotation dialogs

Task-number: QDS-2243
Change-Id: I2f271d4ae91d33b26a050287b20a86050e081830
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-01 13:54:58 +00:00
Cristian Adam
830aeb8010 CompilationDatabasePM: Fix crash at loading project
If rootPath is empty, QtCreator will crash.

Fixes: QTCREATORBUG-26126
Change-Id: Iac0d29d84d7203c0ec2ac8f5e3035816f52d7cdc
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
2021-09-01 13:33:03 +00:00
Henning Gruendl
04c36419f7 QmlDesigner: Fix ColorEditor
* Change the look of the picker cross
* Cleanup custom RGB, HSL, HSV and Alpha value storage and handling
* Fix issue of alpha not updating when selecting gradient stops
* Fix initial color not shown correctly
* Fix ComboBox warning about parameter injection
* Add checkerboard image to GradientLine
* Remove GradientPopupIndicator
* Add signals to RealSpinBox in order to react to user interaction
* Cleanup code
* Change how porperty editor value emits value if old and new color are
  equal

Task-number: QDS-4755
Change-Id: I1a8095664fc8ed53c52659ac20557c03b89704c9
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-01 13:20:36 +00:00
hjk
ebf0917b9f Utils: Start adding some asynchronous API to FilePath
Especially with the "remote" scenarios synchronous operations cannot
be expected to work reasonably well.

This here starts with adding asynchronous versions to some of the
FilePath member functions, taking additional "Continuation" style.

This is not necessarily the final syntax (sugar like .then(...) comes
to mind...), but is simple enough for now for the few uses we have,
and it is too early to see what will be needed in the end.

Change-Id: Idf4dde1b77d04cafb81b6c024031145bdd91a762
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 11:21:30 +00:00
The Qt Project
3c4e7321bf Merge "Merge remote-tracking branch 'origin/5.0'" 2021-09-01 10:56:08 +00:00
hjk
5830641d0f Valgrind: Make callgrind work on docker
Callgrind on Remote Linux did not work for years, so its safe to ignore
the remains from the previous remote support and start over.

This here now handles the local case and the case where callgrind
runs together with the debuggee in the same docker container.

Guessing at the output file name is replaced by specifiying it in
advance.

Cross-setups are not yet supported.

Change-Id: I97edeb4eab7475727eddb26d25f8bec650a7eeb9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 09:27:24 +00:00
Jarek Kobus
1acda50e7f Compile fix
Amends cc940d52be

Change-Id: I8e498a43b3e081415e449d1347398fb01433882d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-09-01 08:42:07 +00:00
Eike Ziller
47de984972 Merge remote-tracking branch 'origin/5.0'
Change-Id: I712fce3cc0171327de122a1cd53b5bae67541084
2021-09-01 10:10:33 +02:00
Jarek Kobus
cc940d52be Measure the time spent on starting and waiting for start
Measure it on demand. The printout will appear when
QTC_MEASURE_PROCESS env variable is set. It may be easily
combined with QTC_USE_QPROCESS to compare the time spent
on freezing Creator when starting Creator or when loading
a big project, like Creator project.

In order to compare the measurement between
old implementation (using directly QProcess) and
new implementation (using process launcher) of QtcProcess
do the following (linux):

1. To measure the new implementation:
QTC_MEASURE_PROCESS= ./bin/qtcreator

2. To measure the old implementation:
QTC_USE_QPROCESS= QTC_MEASURE_PROCESS= ./bin/qtcreator

How to measure (two scenarios, A and B):

A. Launch Creator (don't load any project), wait a bit
   until all processes finished. Look for the last value
   in the 11th column ([A/M] Total Measurement, A means
   all measured functions, M means in main thread only).
   This value has the greatest influence on GUI freeze -
   the higher it is, the longer the GUI is frozen.
   Measure it with 1. (new) and 2. (old) implementation
   and share your results.

B. Launch Creator and load a Creator project.
   Wait until all processes finished (taskbar should be empty).
   Look for the last value in the 11th column.
   Measure it with 1. (new) and 2. (old) implementation
   and share your results.

C* (Additional one)
   If only you notice that launching a certain QtcProcess takes
   suspiciously too long, replay your scenario that triggers
   this process with 1. and 2. and share your results of
   the 11th column.

Change-Id: I549c0a9fd0b3d6223f3d27288130553d99ab768e
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-09-01 07:32:24 +00:00
Jarek Kobus
37254cb92c Check if the executable exists before starting
Change-Id: I6d0d4e8885222cc1220c27d7d81e304887302e9b
Reviewed-by: hjk <hjk@qt.io>
2021-09-01 07:08:58 +00:00
Tony Leinonen
9891f3b268 QmlDesigner: Edit ChooseTexturePropertyDialog to accept any type
When creating a new component by dropping it to a component in the
navigator, check the parent if it contains properties that are the
same or sub type as the new created component. Those properties are
shown in a list that the created component can be binded to.

This edits the dialog that was for textures only and uses it for any
component on creation.

Task-number: QDS-4969
Change-Id: I3f1ecc6a82254f77a9bb170406ef79740359a889
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-09-01 06:23:30 +00:00
Mahmoud Badri
c8d1f32e76 QmlDesigner: Improve Welcome screen scollbar
- scroll bar only visible when needed
- change color when active
- remove useless stuff
- remove 3 warnings

Change-Id: I0fbab4ca574c060f85adb0d5b6b54381337a7eae
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-31 16:58:05 +00:00
hjk
0061555213 LanguangeClient: Use more FilePath
Change-Id: Ic849da11da646feb804717550d2a8a60d61f332d
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-31 15:16:42 +00:00
Jarek Kobus
000f5aba4f Use QtcProcess for reading version number in meson project
Change-Id: I8f7b72ae9d21fec5a7c8e9baf154dcba70a3a2b3
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: Alexis Jeandet <alexis.jeandet@member.fsf.org>
Reviewed-by: hjk <hjk@qt.io>
2021-08-31 14:15:07 +00:00
hjk
87b3de0e39 Utils: Add a code path taking care of cross-device file copies
Not optimal, but will suffice for docker callgrind.

Change-Id: Iac669fe9dd29206df2a4ffc61d659afce2f7a6c4
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-31 13:38:51 +00:00
Jarek Kobus
61dcac44b8 Use QtcProcess for running extra compilers
Change-Id: I924acb2f303ba97c864a4503ad4681454c844303
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-31 12:47:27 +00:00
Jarek Kobus
15c183fce6 Set process state to NotRunning after FailedToStart error
Remove the process in process launcher after error has appeared.
Remove unneeded stopStopProcedure as we are disconnecting from
process' signals inside removeProcess().
In order to behave as much similar to what QProcess does,
provide a test that:
- ensures the FailedToStart error is synchronously emitted
  when waitForStarted is being executed
- ensures that process state is reset to NotRunning after
  FailedToStart error
- 2nd call to start/waitForStarted doesn't block on
  waitForStarted

Change-Id: I139354421d037739f1cc1a2685b66f1e5b6170c8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-31 12:09:36 +00:00
Mahmoud Badri
0d4e7599f6 QmlDesigner: Remove warnings caused by Assets.qml
Make sure returned default QVariant() is valid.

Change-Id: I323001df3505bbe740f8f660de9c199aed05aac6
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
2021-08-31 11:18:45 +00:00
Jarek Kobus
73874980ef Don't leak BeautifierPluginPrivate on shutdown
Properly delete QtcProcess used for version on shutdown.

Change-Id: I325a267ba5bb28a82158d9c50802955804713be0
Reviewed-by: hjk <hjk@qt.io>
2021-08-31 11:16:46 +00:00
Jarek Kobus
348ef8cdd2 Remove unneeded declarations of deleted methods
QtcProcess is derived from QObject, it doesn't
have these methods anyway.

Change-Id: I7a334c97739d40b28a78ab98a322417256c1117c
Reviewed-by: hjk <hjk@qt.io>
2021-08-31 10:33:11 +00:00
hjk
abeaeeffdc Android: Replace two direct uses of Target::activeRunConfiguration
... by Target::activeBuildKey.

This is effectively the same problem under the hood, but isolates
it a bit.

Change-Id: Ie37a4d67aab3e044bb99b7b8d2bd7900198c5538
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
2021-08-31 10:22:29 +00:00
Jarek Kobus
0c8e196cb2 Use QtcProcess for reading version number in uncrustify
Change-Id: I0c39342c692d1b4a5dfcf8fa562f5f300f6fc295
Reviewed-by: Artem Sokolovskii <artem.sokolovskii@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2021-08-31 10:16:06 +00:00
Artem Sokolovskii
bf2954ffbf Qml: Use QtcProcess
Change-Id: I12ff58739db14952bdf38355f0fe3b332f57f330
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-31 09:56:59 +00:00
Jarek Kobus
99cf99579e Make access to LauncherSocket thread safe
Instead of returning a pointer to LauncherSocket instance,
which might get deleted in meantime of just after,
route all calls to the LauncherSocket through the LauncherInterface.
Make all calls to LauncherInterface secured by the
instance mutex.

Change-Id: I751228de5f4263112471098ee08cc73a5245147e
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-31 08:45:59 +00:00
Eike Ziller
b9400784a9 CMake build: Fix litehtml build if BUILD_SHARED_LIBS is forced to ON
Update qlitehtml with the fix.

Fixes: QTCREATORBUG-26192
Change-Id: I20bdd6f8f0d13064154461e6d845393df5e2d6b0
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-31 07:19:10 +00:00
Eike Ziller
e465d18215 Always set an environment for QtcProcess
Since e755094480 we have a global option
in Qt Creator to set the (base) environment for any tools run by Qt
Creator. So it is expected that any tool actually uses
Environment::systemEnvironment() as a base, which is the system
environment modified by the global option.

QtcProcess already had a fallback to Environment::systemEnvironment for
resolving environment variables in Qt Creator macros in the command
line. Also use it as a fallback for the actual environment for the
process.

Latest occurrence where the global environment setting was ignored was
for starting language servers by our LSP client.

Change-Id: Id1a4141326d8ef3239b37d7f3daf21928605ca92
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2021-08-31 06:50:15 +00:00
Eike Ziller
99399ab6ee Fix saving of MIME type settings
Was missing a slash after the userResourcePath.
Broke with 8e352af0ec

Change-Id: I2f60e3dcaa07b13cd2459ee6a3aa67b51075545e
Reviewed-by: hjk <hjk@qt.io>
2021-08-31 06:49:51 +00:00
Alessandro Portale
236074423c QmlDesigner: Fix build
Change-Id: I2ed39d84e4d83dc793dfcecbd6e34ef9d04c1e2a
Reviewed-by: hjk <hjk@qt.io>
2021-08-31 06:44:51 +00:00
Jarek Kobus
98d7261c67 Assert that when stopping the launcher no QtcProcess exists
Otherwise such a QtcProcess won't work properly anymore.

Change-Id: I9eb7c8beb864a895a60c0e60ff394e74c35a0ebb
Reviewed-by: hjk <hjk@qt.io>
2021-08-31 06:31:24 +00:00
Jarek Kobus
98de1c5544 Pass lowPriority and unixTerminalDisabled into process launcher
Amends b80624611b

Change-Id: I8a050d8e9f8b73a0e93c06fe017f16403884574b
Reviewed-by: hjk <hjk@qt.io>
2021-08-31 06:13:51 +00:00
Alessandro Portale
eb5788f00a Core: fix build (with MSVC)
coreplugin.cpp:407: error: C2664: 'QString
QString::arg(qlonglong,int,int,QChar) const': cannot convert argument 1
from 'const char [11]' to 'qlonglong'
note: There is no context in which this conversion is possible
qstring.h(444): note: see declaration of 'QString::arg'

Change-Id: I2c4122c4bf0f6b35f6f7b45b2c2d014ac7863065
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-31 05:41:13 +00:00
Thomas Hartmann
f6511fb29d QmlDesigner: Fix Model
The correct type in Qt 6 is QtQml.Models.ListModel

Change-Id: Ic6e488eea1feef150bb49d0d4f873f6bd5bac3c5
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2021-08-30 18:02:48 +00:00
The Qt Project
ea3f38e217 Merge "Merge remote-tracking branch 'origin/5.0'" 2021-08-30 14:31:22 +00:00
Alessandro Portale
a0a979a0ad Utils: Fix placeholder text color for dark themes (Qt6)
Qt 6 changed the color for QPalette::PlaceholderText to a hardcoded argb
value in qt_fusionPalette(), which does not work well with dark themes.

This change restores the rgb values for QPalette::PlaceholderText from
Qt 5 for Qt Creator's dark themes.

Task-number: QTCREATORBUG-25444
Change-Id: I197d367ac6e35085a093abfee07467291010e3ba
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-30 14:24:18 +00:00
Christian Stenger
752b967952 LanguageClient: Fix possible crash
If a restart for a client has been staged for restart the
shutdown of QC may coincide with the start of the client which
leads to a crash on exit. Correctly track clients that never
successfully started to clean them up on manager destruction.

Change-Id: I639a76318d1665653fbcd37841fcaf407f3d3a83
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2021-08-30 12:23:05 +00:00
Thomas Hartmann
870b619c85 QmlDesigner: Render effects on document level
Rendering effects requires actually rendering another item.
The effect is defined by another item that is rendered instead
of the original item.

For items that have an effect we do not render the children, since
the effect is only applied to the layer not the individual items.

We set layer.enabled temporarily to false, this ensures the effect
is not rendered as part of its parent item.

To detect the effect we use the source property an check if it points
to the ShaderEffectSource.

If one of the children inside the effect is transformed we have
to update the effect item.

If layer.enabled or layer.effect is changed we set the dirty flag
on the item and all children.

Change-Id: Iff61ef950e62a7a598b4bfa181ea70cb144368f3
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-30 12:07:06 +00:00
Jarek Kobus
cd3f82f247 Pass QFutureInterface by reference
No need for a copy.

Change-Id: I0308da77199942ef49e36fb04e81713cb9d9a901
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-30 12:06:12 +00:00
Jarek Kobus
390b214198 Pass QFutureInterface by reference
Prevent doing many copies of QFutureInterface when
running async tasks and pass it by reference instead.

Change-Id: Ic49cfd86a6c651b1b94f791d79a40c99703370ec
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2021-08-30 12:06:05 +00:00
Eike Ziller
e4995fd6c7 Remove QtScript from condition for building Qbs
It works without nowadays, and even with Qt 6, with its
bundled QtScript version.

Update Qbs to HEAD of 1.20 for a build fix.

Change-Id: I060ddec595c989852dc5861594423d5ffa5f521d
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-08-30 11:22:52 +00:00
Christian Kandeler
25ff15a1fb Add convenience functions for creating ProjectExplorer::HeaderPaths
Change-Id: I7b1f63caca6b70ba4ec1b1870b83cbf20aa6564a
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2021-08-30 10:46:56 +00:00