Commit Graph

22 Commits

Author SHA1 Message Date
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