Commit Graph

45 Commits

Author SHA1 Message Date
Tim Jenßen
feabda3aa7 Merge remote-tracking branch 'origin/10.0' into qds/dev
bigger conflicts resolved at:
  src/plugins/qmldesigner/CMakeLists.txt
  src/plugins/qmlprojectmanager/qmlprojectrunconfiguration.cpp

Change-Id: I08e2a109d8e37cbd77225129854e9e633725bfc7
2023-03-26 16:26:18 +02:00
Thomas Hartmann
8d02bbf075 QmlDesigner: Add display name more feedback popup
Task-number: QDS-8870
Change-Id: Id8d1c98dec71e962b63a144c234642417e1df602
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2023-01-23 15:12:20 +00:00
Kai Köhne
56baf8c058 Remove GPL-3.0+ from license identifiers
Since we also license under GPL-3.0 WITH Qt-GPL-exception-1.0,
this applies only to a hypothetical newer version of GPL, that doesn't
exist yet. If such a version emerges, we can still decide to relicense...

While at it, replace (deprecated) GPL-3.0 with more explicit GPL-3.0-only

Change was done by running

  find . -type f -exec perl -pi -e "s/LicenseRef-Qt-Commercial OR GPL-3.0\+ OR GPL-3.0 WITH Qt-GPL-exception-1.0/LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0/g" {} \;

Change-Id: I5097e6ce8d10233993ee30d7e25120e2659eb10b
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2023-01-06 11:15:13 +00:00
Marco Bubke
78cf5051f5 QmlDesigner: Merge cmake files
To improve testability external dependencies are now broken with an
interface. It is a first step to test individual units without injection
of source files.

Task-number: QDS-7571
Change-Id: I4255c8668022f1097947e4ea5788f2a6b605365d
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>
2022-10-07 13:15:41 +00:00
Marco Bubke
0be4de69d8 QmlDesigner: Remove parent from abstract view
We apply not very often the parent to views. So it can lead to dangling
pointer if the parent is used by other objects and does not handle the
null pointer case. It can lead to double deletion if the parent is
deleted before the object when it is on the stack or handled by smart
pointer.

If you really want to use it there is still setParent.

Change-Id: I1fc6b145a50f037a0e9d415fb36e7970ea7296ed
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2022-09-22 19:08:12 +00:00
Marco Bubke
68f27f3f04 QmlDesigner: break dependency to Core::IContext
Move the dependency from the abstract view into the plugin class. The
abstract view is now only returning the id.

Change-Id: I4f508c907bcdc8f717817fd40ef9c933e5fe2211
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-09-22 17:00:32 +00:00
Tim Jenssen
80e2eddd95 Merge remote-tracking branch 'origin/8.0'
resolved conflicts:
	share/qtcreator/qml/qmlpuppet/qml2puppet/instances/qt5rendernodeinstanceserver.cpp
	src/plugins/qmldesigner/components/formeditor/formeditorview.cpp
	src/plugins/qmldesigner/designercore/exceptions/exception.cpp

Change-Id: I13a5248415fa1ae03e1c6d0972d9b3bb8c80a3b0
2022-09-22 10:32:40 +02:00
Tim Jenssen
a527ceff60 qmldesigner: make DesignerSettings thread save
Change-Id: I07074b35456533e9729644ef3647803d477bd6f1
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
2022-09-21 14:01:23 +00:00
Lucie Gérard
a7956df3ca Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.

Task-number: QTBUG-67283
Change-Id: I708fd1f9f2b73d60f57cc3568646929117825813
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2022-08-26 12:27:18 +00:00
Marco Bubke
c13e2b89f5 QmlDesigner: Add type enumeration to auxiliary data
Auxiliary data so far used naming conventions to declare the kind of the
data. Now an enumeration is used. The auxiliaryData(...) is returning an
optional too so that it is known if a value exists. There is now
auxiliaryDataWithDefault(...) which is returning an invalid
QVariant instead.

The instance cache is now disabled because there is not notification for
information changes. So if we get the real data from the node instances
there will be no information changes because nothing changed. So the
form editor is a strange state of being reset but not all data
arrived. Before this patch there were still changes happen because of
some side effects that auxiliary properties were sent which were never
intended to be sent. If we re-enable the cache we need to send
information changes or every view must expect that the information is
already there.

Task-number: QDS-7338
Change-Id: I0cafd149c53df552c7c8442f1e8ba87f5451dbd1
Reviewed-by: Aleksei German <aleksei.german@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2022-08-09 17:52:03 +00:00
Fawzi Mohamed
fd89043de2 qmljs: (QString -> Utils::FilePath)++
convert more QString containing paths to Utils::FilePath

Change-Id: I1219d7d147993e48cfa641dc9bea72ab38c90f51
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-07-13 17:13:23 +00:00
Thomas Hartmann
106f034caf QmlDesigner: Rename text editor view from "Text" to "Code"
Change-Id: Ic279e33d051c071417ae9ea1bf45027c7f9d2c04
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Mats Honkamaa <mats.honkamaa@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-07-05 07:47:28 +00:00
Thomas Hartmann
866f16adb1 QmlDesigner: Fix TextEditorView::reformatFile
* Updating the document only if it actually changed
* Using the text cursor of the widget
* We can rely on the widget to exist
* Simplify how the cursor is restored

Task-number: QDS-6410
Change-Id: Idaa384533f12b9b7ad7078bcdc37c1afaf651662
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-07-01 17:30:21 +00:00
Thomas Hartmann
648e659356 QmlDesigner: Simplify naming of views
* Curve Editor -> Curves
* 3D Editor -> 3D
* Form Editor -> 2D
* Text Editor -> Text
* Transition Editor -> Transitions

Most view titles are now a single word and all superfluous "Editor"
as part of the title have been removed.
"File System" and "Open Documents" stay as they are.

Task-number: QDS-6325
Change-Id: I8fb6477f9e07c324f76a49796f550a8b8799fedd
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-03-21 10:04:08 +00:00
Eike Ziller
8259df00d0 Merge remote-tracking branch 'origin/7.0'
Conflicts:
	src/plugins/mcusupport/mcupackage.cpp
	src/plugins/mcusupport/mcusupportoptions.cpp
	src/plugins/mcusupport/mcusupportoptions.h
	src/plugins/mcusupport/mcusupportoptionspage.cpp
	src/plugins/mcusupport/mcusupportplugin.cpp
	src/plugins/mcusupport/mcusupportsdk.cpp

Change-Id: Ib423e9f23877176f01b188104b0a179ed32c4770
2022-02-22 14:06:41 +01:00
Mahmoud Badri
c8481710c9 QmlDesigner: Enable searching in the text editor
Also hide the bottom status bar when it is empty.

Task-number: QDS-6187
Change-Id: I053771243c268ea20df8e127831b789b854021aa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-02-17 10:45:01 +00:00
Knud Dollereder
381bfd623c Remove ToolBarWidgetFactoryInterface from WidgetInfo
Since it is sometimes created with new but never used,
it leaked memory.

Change-Id: I5adfb71f9c773be37c1cefc619236bad9f34aad1
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-02-08 10:05:49 +00:00
Alessandro Portale
a3857a996a Don't access static functions/fields via instance
Courtesy of readability-static-accessed-through-instance

Amends: b2a766a79a

Round #2: This time done with Qt Creator's Analyzer, which
found other occurences than run-clang-tidy.py

Change-Id: I479e280c7abcf2d24baccbb0af69ae4bda05198e
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
2020-11-27 13:26:07 +00:00
Thomas Hartmann
d098016bd9 QmlDesigner: Avoid jumping cursors in integrated text editor
If the curser changes this should not trigger an update in
the other direction.

Change-Id: Ie20914f5587525f46f2941de21374f4373cec47f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2019-04-02 13:10:13 +00:00
Eike Ziller
443931c1da Help: Move resolution of help from multiple candidate IDs to HelpItem
No need for code duplication.

Change-Id: I3d2c795d072b8de5818e1844b8126e526339c0da
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-02-01 11:28:02 +00:00
Eike Ziller
1ee005aef4 Qt Quick Designer: Adapt to naming change in IContext
Since context help is no longer based solely on an ID.

Change-Id: I34bb81b70632df9fb75bdcf28b022418d4aa764b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-01-29 15:58:06 +00:00
Eike Ziller
282805b66d Rename IContext::HelpIdCallback -> IContext::HelpCallback
It no longer takes an ID but a HelpItem.

Change-Id: I0aa738549fea4fcfd0151adc2dfd642c63f0f60d
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-29 07:58:19 +00:00
Eike Ziller
418dcfbcbb Help: Avoid multiple lookups of help id for context help
Context help would first query the database with potential IDs, and
afterwards the help plugin would look up the links for the resulting ID
again.
Pass the HelpItem (which potentially contains the cached links) directly
to context help.

Change-Id: I73bddcd3cd4eacaea412b98d53c5e5354a31f3d5
Reviewed-by: David Schulz <david.schulz@qt.io>
2019-01-29 07:57:19 +00:00
Alessandro Portale
859d847769 QmlDesigner: Modernize
modernize-use-auto
modernize-use-nullptr
modernize-use-override
modernize-use-using
modernize-use-default-member-init
modernize-use-equals-default

Change-Id: Ic42b5c59fed5a4a01853138542d8156471e86f58
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-07-25 12:53:26 +00:00
Tim Jenssen
5d98899ffd widget as a std::unique_ptr is bad
- a widget is often used as a raw pointer and in most cases
   the parent will take care of destructing it
 - here the context is also destructing the widget
 - so move back to QPointer and keep deleting to the context

Change-Id: Ief5c4faa08d5e76f723b35d33d09fafc502c2d8a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-10 09:01:15 +00:00
Eike Ziller
7c3cfa166d Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/coreplugin/helpmanager.cpp

Change-Id: I2feb60ec0afb2f22f75dc137a01c3fa217b299d8
2018-02-23 10:56:52 +01:00
Thomas Hartmann
7081ec8bec QmlDesigner: Ensure the semantic info is not outdated
When reformating we have to ensure the semantic info is not
outdated. If the semantic info is outdated we loose the latest changes.
We had a similar bug in the QmlJSTextEditor.

Change-Id: I38bb74c7db6d0449b692b3975d3e9eb89b7c3364
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-02-13 13:27:16 +00:00
David Schulz
0eb7bab20c Core: make useMacShortcut constexpr
Change-Id: I293b96428784b6efecac6dae4f2f9690af0027da
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-02-02 13:15:55 +00:00
Thomas Hartmann
a7515d25a9 QmlDesigner: Avoid detachs
The non const overloads of first() and last() do detach
if the reference count is higher than 1.
Therefore we use constFirst() and constLast() instead.

Change-Id: I737cfc428f1c21f16185b9b51175e181c0ec7068
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-01-23 10:14:12 +00:00
Nikolai Kosjar
dd06a4188d Core: Return context help id by callback
...to support asynchronous providers.

Change-Id: I483489c74e7886d5bc2bf00b65540c3d2c7afee0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2018-01-18 13:54:02 +00:00
Tim Jenssen
668c87ffd9 QmlDesigner: reduce editor changed signals
- detaching the TextEditView already emits the TextEditor change signal
   -> so removing the call from QmlDesignerPlugin::deactivateAutoSynchronization()
 - in case the user closed explicit the editor we do not want to emit any
   signals anymore

Change-Id: Idb5c2cdde583f7d32f2a9ef5628d1b6d3fc7bb3f
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2017-10-18 14:16:30 +00:00
Tim Jenssen
19203ebbf7 QmlDesigner: clear texteditor view statusbar
- when puppet is restarted
 - when the view is attached (switching document, switching mode)

Change-Id: I06a4acf78a18b893bca9f7cd3d2bae74dc3459aa
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-10-17 08:35:49 +00:00
Friedemann Kleint
b7cdd90e55 QmlDesigner: Fix spelling of API
CurserSelectionSyncronisation -> CursorSelectionSynchronisation

Change-Id: I1370d0153d566e1c54f1e00f8c2339bfc9e33a5c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-09-13 11:53:15 +00:00
Thomas Hartmann
970496b24c QmlDesigner: Fix help
The designer used a over simplified lookup,
that did not distinguish between e.g. Controls 1 and Controls 2.
Instead of fixing the lookup we simply use the working lookup from
the QmlJSEditor.

Change-Id: I2d31e633eaadc67e211d44bad307b26993f21fc9
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-23 16:41:10 +00:00
Thomas Hartmann
bfb2248f39 QmlDesigner: Deactivate integrated text editor in detach
We delete the integrated text editor and set the original
text editor as the current one.

Change-Id: I2dd6c7421d4d3078dda8ca9dae8fb04553723240
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-16 10:57:26 +00:00
Thomas Hartmann
aa451eecbc QmlDesigner: Block cursor updates by ModelToTextMerger
When we update the text we have to block the cursor
selection synchronization.

Change-Id: I79c3589482f2ca884bc4980b295b18b0a8e8ef2e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-08 11:23:05 +00:00
Thomas Hartmann
64b8bd0924 QmlDesigner: Fixing context in TextEditorView
The context of the text editor is not automatically set
on the widget. This is usually handled by the editor manager.

Unfortunately the completion action is handled using the editor
manager. This means the completion assist widget position depends
on the cursor position in the original text editor managed by the
editor manager.
To fix this we have to register our own action that overrides the default
completion action and triggers the completion on the correct text editor
widget.

Change-Id: I4d7524f2d5ad2374af23f886d7fd08505a3c857f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-19 15:59:27 +00:00
Thomas Hartmann
f23c0db1a2 QmlDesigner: Simplify reading a setting
Change-Id: I754b3ac1635699e5d9ceab376ae70752a966082f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-19 13:16:02 +00:00
Thomas Hartmann
7eda9ecb56 QmlDesigner: Remove superfluous deleteLater calls
All those QObjects are part of the parent child hierarchy
and do not have to be deleted manually.
This slicences two QCoreApplication::postEvent: Unexpected null receiver,
because the graphics scene is now created lazily.

Change-Id: Ibfe4aaed2173f591e90186b570f8c8bb9e708494
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-19 13:07:00 +00:00
Thomas Hartmann
cba001eff8 QmlDesigner: Do not move cursor when reformating
When saving a .ui.qml file the complete file is reformated.
Without this patch the cursor is moved to the bottom.

The cursor is still moved, but they line is kept.
Since we reformat the complete file this should be fine.

Change-Id: Ia1ef003e2e6ca7497dcad7e0e8044ffb99c80ea3
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-19 12:34:49 +00:00
Tim Jenssen
fa84524c0c QmlDesigner: rename RewriterError -> DocumentMessage
Change-Id: I8cbb1b8b83ec10c33e416de96a09281208be8773
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-10 16:22:23 +00:00
Thomas Hartmann
759db2b7b6 QmlDesigner: Polish error handling for integrated text editor
The integrated text editor requires a couple of fixes and features
in the error handling.

The errors are now handled by the model and not the document management
anymore.
The text editor does not get disabled if there is an error. Instead
we show the error in a status bar.
The form editor is blocked if there is a QML an error and we show the
error message inside the form editor.

Change-Id: I4bfb9b33b09e444ec1de31dd531ce83b32cbcf88
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-10 15:58:36 +00:00
Thomas Hartmann
c27d7c00d6 QmlDesigner: Move cursor to selected item
When an item is selected in the navigator we move the cursor.

Change-Id: Ia6d41e4d7bdf38688cf0cd73f134c349126eb68e
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-06 12:30:12 +00:00
Thomas Hartmann
79d8b9c133 QmlDesigner: Refactoring TextEditorView
* Using smart pointers
* Renaming DummyWidget to TextEditorWidget
* Moving TextEditorWidget to separate file

Change-Id: Idbe0e50f976bf39beac8632d4254d6d9a5afd5b2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-06 11:47:03 +00:00
Tim Jenssen
d83a52338d QmlDesigner: add new TextEditorView
This is the first iteration but the text editor is not connect
to the others view in all expected cases.

Change-Id: I2fa29a23f9ce1d98d3d6cc8eabddb788525e39cd
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2016-12-22 10:37:07 +00:00