Commit Graph

71 Commits

Author SHA1 Message Date
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
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
Mahmoud Badri ec565eea99 QmlDesigner: Allow deleting materials using the delete action
Fixes: QDS-7012
Change-Id: I5eb03971d33a997fc1463ec4ee70eb33a730a897
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2022-08-17 13:11:58 +00:00
Mahmoud Badri 0d3ef2489d QmlDesigner: Add some states view improvements
- Added a gray border around unselected states.
- States resize to fit view height.
- States are centered vertically in the view.
- Removed collapse option, auto collapse when space is small.
- scroll bar always at the bottom.
- Overshoot list ends.
- Added margins around the states.
- Add states button: make it small and docked to the bottom right.
- Add states button doesnt take space from the view.

Change-Id: I4fc96f4341a6e4a0c70509240b7aed9c7890ec4d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Samuel Ghinet <samuel.ghinet@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
2022-01-28 14:29:41 +00:00
Thomas Hartmann 442907bc13 QmlDesigner: Use Qt::Key_Backspace instaed of QKeySequence::Backspace
Task-number: QDS-5011
Change-Id: If3e0719389e47110b8885ab709568a8daaf0ec1d
Reviewed-by: Knud Dollereder <knud.dollereder@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
2021-09-06 18:37:42 +00:00
Eike Ziller ed5e6a4999 Add some additional shortcuts for actions
Add Cmd+Shift+- for decreasing font size on macOS.
Do not add Cmd+= for increasing size, because it conflicts with the
existing shortcut for "Replace and Find Next".

Sprinkle some Backspace shortcuts in addition to Delete for removing
items. There are (laptop) keyboards that either do not have a designated
Delete key (requiring Fn+Backspace) or where the Delete key is not
conveniently located/sized, and there is no benefit in making the
distinction in that case anyhow.

Fixes: QTCREATORBUG-706
Fixes: QTCREATORBUG-13733
Change-Id: I06274a9810b82800ec6158a883c95d2a7ae2465e
Reviewed-by: David Schulz <david.schulz@qt.io>
2020-03-17 09:39:37 +00:00
Eike Ziller 22cdc47077 Merge remote-tracking branch 'origin/4.12'
Conflicts:
	src/plugins/baremetal/debugservers/uvsc/uvtargetdevicemodel.cpp

Change-Id: I4a90920e52dbbe9eb46aef3437ee3c5a6e7b31c6
2020-03-16 08:30:33 +01:00
Mahmoud Badri 11bd2f8deb Enable Copy, Cut, and Paste in the Editor 3D
Task-number: QDS-1563
Change-Id: I22c3017b8c158d8bc084f050baef89fa8fffd365
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2020-03-13 13:25:58 +00:00
Eike Ziller a6d52a6e28 Move some actions to a "View" menu
A "View" menu seems to be what many users are looking for when they want
to show or hide panes/views, so move corresponding actions there.
Window management / split actions stay in the "Window" menu.

Fixes: QTCREATORBUG-23610
Change-Id: Id683addc681de99abb35697a735fdbc9dc0d00cd
Reviewed-by: hjk <hjk@qt.io>
2020-03-06 14:01:23 +00:00
Henning Gruendl 79612417e3 Integrate ADS in QtCreator
- Integrate DockManager in DesignModeWidget (create factory default
   workspace, create menu items, add qds constants, remove unused
   shortcuts)
 - Remove unused functions and variables due to new docking system usage
 - Add DockWidget style sheet to resources
 - Fix scrollbar style by merging base and scrollbar style sheets
 - Fix update of StatesEditorWidget when switching tabs
 - Add missing unique ids in widget info
 - Set minimum size on ItemLibraryWidget

Change-Id: I08be6d753233fc767037a33b41af335cec6d43b1
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2020-02-20 16:15:03 +00:00
Thomas Hartmann 572a3c8937 QmlDesigner: Use backspace on macOS
Change-Id: I8398d60b32e5bb65b47bf87b6309c805be4c48b5
Reviewed-by: Brook Cronin <brook.cronin@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-07-03 07:49:26 +00:00
Mitch Curtis fe21a7a77e Allow pinning files to ensure that they are always open
This patch allows pinning files within a session. Pinning a file puts
it at the top of the Open Documents list, and prevents Close All
from closing it until it is unpinned.

This is useful for files that should always be open for a given
session.

[ChangeLog] Files can now be pinned via the context menu.
Pinning a file keeps it at the top of the Open Documents list,
and prevents Close All and similar actions from closing it
until it is unpinned. This provides a way to quickly close any
open files without closing important ones.

Change-Id: If47a599fb272db4c78a71eabe6fb29215a9a8a11
Fixes: QTCREATORBUG-21899
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-04-03 09:17:55 +00:00
Tim Jenssen ca4378c499 QmlDesigner: remove not used include
Change-Id: I9a1ee2d902e672b4a066852b45d92e42ad385114
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2019-01-21 13:35:52 +00:00
Thomas Hartmann 07b96ccc37 QmlDesigner: Fix clazy warning
Do not call static member functions by instance.

Change-Id: Iacc7abd7e93b4612fcaa5288cd428a569f64615c
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-08-02 08:26:22 +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
Eike Ziller 42386dbdbc QmlDesigner/ShortcutManager: Cleanup
Remove some unneeded 0-parents, use nullptr, and do not use parameter
actions when they are not needed.

Change-Id: Ia556f83f7f1ce296fc08fa76cced7f41102d110f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-16 13:12:19 +00:00
Eike Ziller c00c4fc9c2 QmlDesigner: Do not access clipboard if not requested to by user
QClipboard documentation states for X11:

"Lastly, the X11 clipboard is event driven, i.e. the clipboard will not
function properly if the event loop is not running. Similarly, it is
recommended that the contents of the clipboard are stored or retrieved
in direct response to user-input events, e.g. mouse button or key
presses and releases. You should not store or retrieve the clipboard
contents in response to timer or non-user-input events."

So do not request the clipboard data when the QClipboard signals that
the data has changed, because that locks up if the application providing
the data is unresponsive.

Task-number: QTCREATORBUG-20262
Change-Id: Ifd10150e1de62c8153ab2bb93a3e953a36fb243a
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-04-16 13:11:47 +00:00
Eike Ziller f1e02c0826 Fix that menus didn't show ampersands in files names
And instead interpreted the ampersand + following character as an
accelerator key.

Task-number: QTCREATORBUG-17817
Change-Id: I327239499ce56e75fd12f2df5be60d4b04913acd
Reviewed-by: David Schulz <david.schulz@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2018-03-26 12:02:15 +00:00
Tim Jenssen e5d832f2cc QmlDesigner: remove "Editor" from "Status Editor"
This saves some space in the tabs.

Change-Id: I968378de7d7a6331a41c79944ce910e23e63f2fd
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-11-09 11:11:51 +00:00
Thomas Hartmann bc9cea81e9 QmlDesigner: Fix navigator context menu
Depending on the context and focus we are disabling actions.
But we did not enable actions when setting the focus/context
back to e.g. the navigator. We "simulate" a selection change
to set the proper state of the actions.

Task-number: QTCREATORBUG-19110
Change-Id: Ie4eefb498956de22d33d72bd7189bacd3177912b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-10-18 08:56:03 +00:00
Ulf Hermann 47886969cc Drop unused variables and lambda captures
Also, add context to connect() expressions where we are or were
capturing "this".

Change-Id: I6e006ba6f83d532478018550d148ee93eca59605
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2017-09-08 09:06:53 +00:00
Thomas Hartmann e2a45d0032 QmlDesigner: Fix compile
Change-Id: Id37f517fb0584f8066cc0922ed1ca18901bfa7b2
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2017-05-22 10:44:37 +00:00
Thomas Hartmann 3869af3a15 QmlDesigner: Avoid conflicts in shortcuts
Some shortcuts for the toolbar were still conflicting
with the text editor.

Change-Id: I4cad3c9a1f4978ea75b74cc58b789c12fdde871c
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-05-22 09:18:49 +00:00
Thomas Hartmann 81aac69f45 QmlDesigner: Avoid conflict on F2
F2 is also used by the text editor.
We avoid a conflict by defining F2 just in the form editor
and navigator.
To avoid conflict we remove the action from the shortcut manager,
since we already have an action in the context menu.

Change-Id: Ib4c30a271da8f106210f5a86cfe0088386b87403
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2017-05-22 09:13:20 +00:00
Thomas Hartmann 975c283ec7 QmlDesigner: Use the same usage pattern for sidebars as edit mode
Change-Id: Ia1ec631b8b486e98e957b5dbcccbc7b91baecb0f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-24 11:21:33 +00:00
Orgad Shaneh 5221d5f06a QmlDesigner: Use Qt5-style connect
+ De-slot where possible

Change-Id: Ibd2edbef7b7712aba20593bd0417940e828e0c9c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-03-20 10:42:45 +00:00
Thomas Hartmann 4b539cf560 QmlDesigner: Fixing delete action
The delete action should always be visible (not always enabled)
in the toolbar. For this, we have to use the main Qml Designer context.

We react to context changes manually to disable delete, cut, copy
and paste. Those actions should only be available in the formeditor
and navigator.

Change-Id: Ibc3b718c14e787c8451a3e84b679eb37aac814b5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-10 15:17:12 +00:00
Serhii Moroz 69da534f99 TextEditor: add right sidebar
Task-number: QTCREATORBUG-9436
Change-Id: Ic0406758a30d52c22c58433f5f35305b798cb462
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: André Hartmann <aha_1980@gmx.de>
2017-03-09 08:19:54 +00:00
Thomas Hartmann 4c5d0a6611 QmlDesigner: Never use ALT+CRTL for shortcuts
The users of certain keyboard layouts do not
like it, if e.g. their shortcut for "}" is taken by a shortcut.

Change-Id: I93db8627d23624ed3a87dd6a8bfafc037caee0a4
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-08 13:34:15 +00:00
Thomas Hartmann 7b66a7427e QmlDesigner: Crash fix
Deleting or cutting the root node is not possible.

Task-number: QTCREATORBUG-17646
Change-Id: I613179c291e744c2d2f6e44ce103bcbd2afaed28
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-07 14:47:30 +00:00
Tim Jenssen 946d66b500 QmlDesigner: refactor setup/integration code
- moved switchTextFormAction to shortcut manager
 - renamed createDesignModeWidget
 - remove unncessary DesignerSettingsKey::TEXTEDIT_IN_DESIGNMODE
   (supporting it in future would be too much effort)
 - using delayed registration inside QtCreator
   (which does not bring more speed, but more time for the codemodel
    in case of opening a qml.ui file directly)

Change-Id: I1fd05f161e4bf4659c5a2fb09705b1f67d6f8e36
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-27 13:17:05 +00:00
Thomas Hartmann 3e90447c9b QmlDesigner: Update connect syntax
Change-Id: If19e7483f86e0a92dae2bf1d4eb92387235a1cae
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-19 13:17:44 +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
Thomas Hartmann d5ac800b90 QmlDesigner: Hook up states editor expanded state to command
The expanded/collpased state of the states editor is now hooked up to
a Qt Creator command. This means there is a configurable shortcurt
and an entry in the menu under Windows/Views.

Change-Id: Ied993870fe605cfd6651b203986b009620c98f1b
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-19 10:26:21 +00:00
Christian Stenger 0af0d715b8 QmlDesigner: Fix compile
Change-Id: Iec5585376078e05b131fc942605fc642fcafe05e
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-19 09:52:40 +00:00
Thomas Hartmann f11ade3353 QmlDesigner: Implementing exporting QML file as image
Task-number: QTCREATORBUG-11494
Change-Id: Ifcfef6f9434637c0be0a727d9f80dfed1ef1c11b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-19 08:31:30 +00:00
Thomas Hartmann b872a38040 QmlDesigner: Some cleanup
Change-Id: If1369124ca694bd5313213625636cf39a14af247
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-06 15:26:25 +00:00
Thomas Hartmann e575f054db QmlDesigner: Adding a toolbar
* Icons are not the final ones.

* I fixed a couple of glitches and cleaned up the code.
   - Action for copy and paste/delete were not properly updated
   - Delete had no icon
   - Using std::function for action predicates and operations
   - The context menu has no icons. This way we avoid having to define 2
icons.

Change-Id: Ic23cbc78ba299c19e07e8de775eb813aae55db9b
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-05 16:44:32 +00:00
Orgad Shaneh fc64192312 QmlDesigner: Fix compilation with Qt 5.6
Broke by 5da074f95a.

Change-Id: Icd0400e7b19a564ba2777e1cceadd4994eb867f8
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-10-17 07:50:22 +00:00
Thomas Hartmann 5da074f95a QmlDesigner: Fix ESC issues
We do not want to switch to the editor whenever pressing ESCAPE.
Using shortcut override does not work for QQuickWidget.

Therefore we register our own action and disable it.

Change-Id: I399265a5254767d2825edf3fe823dd35177a6ce5
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-14 15:20:00 +00:00
Thomas Hartmann fafb99d910 QmlDesigner: Reformat .ui.qml files when saving
The feature can be turned off using a setting,
if there are serious issues with the reformating.

Change-Id: If90475af2db8aaade8bc52af0fb7cd14bfa1c121
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-10-10 07:13:03 +00:00
Tobias Hunger 397e7f4843 Update License according to agreement with Free Qt Foundation
* Update files in src/plugins

Change-Id: Ia5d77fad7d19d4bb3498e78661982f68729adb22
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
2016-01-19 15:57:01 +00:00
Alessandro Portale 374f84acc7 Qt Quick Designer: License change to Qt Commercial + GPLv3
Change-Id: I7f7aecd02892b6c616cd148fa5d845e7bc0d3b4f
Reviewed-by: Tuukka Turunen <tuukka.turunen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com>
2015-09-18 12:12:57 +00:00
Friedemann Kleint 54da18eaaa Clean exported headers of the Core plugin.
Change-Id: I26472d568844d5fee62323e01f5c5c12082d5450
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-03-05 07:18:14 +00:00
Friedemann Kleint fe2addf515 Clean exported headers of the TextEditor plugin.
Change-Id: I1e7dd34ba5a51fb0b34d137dc03add4457b32ed1
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2015-02-26 13:15:29 +00:00
Eike Ziller 3c85058694 Update License
Change-Id: I711d5fb475ef814a1dc9d2822740e827f3f67125
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2015-01-16 12:37:56 +01:00
Eike Ziller 9c7019f0b2 License update.
Change-Id: I0acde2c3b995693de682679471f03af85bdd0a61
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
2014-10-15 15:19:55 +02:00
Erik Verbruggen a83bf58b88 Project Explorer: fix possible nullptr derefs and remove dead
The dead store is not harmfull, but add noise when checking for dead
stores that are due to logic errors.

Change-Id: I18084c357696311b6556c7bc60832a72b3318e92
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
2014-09-11 15:36:27 +02:00
Nikolai Kosjar bb9edec99a Add copyright comment
Change-Id: Ia16f38f4823a0d740391ef4450b858d10f3184e5
Reviewed-by: hjk <hjk121@nokiamail.com>
2014-08-22 10:06:51 +02:00
Eike Ziller 6772ba622a Fix closing editor with ctrl+w or "x" or File > Close
If there are other editors on the document visible in some split, it
should not close the document, but only the editor.

Task-number: QTCREATORBUG-9346
Change-Id: Idce1ae2f518d4c6e875d86f9831d41c46c06361c
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
2014-08-22 08:54:34 +02:00