Commit Graph

188 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
Alessandro Portale
3d3f14e3fe Prefer using 'override' instead of 'virtual'
warning: prefer using 'override' or (rarely) 'final' instead of
'virtual' [modernize-use-override]

Change-Id: I6dac7a62b627fa1353b4455e1af92f869c2571cc
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-07-11 16:31:35 +00:00
Thomas Hartmann
a7bf5fae72 QmlDesigner: Stretch factor has to be set after inserting widgets
Change-Id: I90c48c6ca5d7eee51b0d0192ab045ff11a8a7c97
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-04-11 10:59:23 +00:00
Thomas Hartmann
8f583631f8 QmlDesigner: Fix black bar
The color was not renamed in this inline css.

Change-Id: Ib23977fcc9f3c5925ef5183dba0fc2c0216ab465
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2018-04-10 08:55:23 +00:00
hjk
4286a4d507 QmlDesigner: Fix NavigationWidgetFactory retrieval
They aren't in the global object pool anymore.

Change-Id: I4f0ae69ebabe33f0276dbfd7137a4f8adbaad489
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
2018-02-22 12:53:09 +00:00
hjk
e30c872e61 QmlDesigner: Avoid use of global object pool
Plus some code cosmetics.

Change-Id: I6fde62da5a99e750131d20336d35565280ac7bef
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-02-07 16:22:02 +00:00
Eike Ziller
5432dd1f5c Merge remote-tracking branch 'origin/4.6'
Conflicts:
	src/plugins/coreplugin/locator/locator.cpp
	src/plugins/imageviewer/imageviewerplugin.cpp
	src/plugins/remotelinux/remotelinuxplugin.cpp
	src/tools/clangbackend/source/tokeninfo.cpp
	tests/unit/unittest/data/highlightingmarks.cpp

Change-Id: I74cc3ba3a2836cb9d0e65d3380d8c4f88d720c67
2018-02-07 11:58:23 +01:00
Thomas Hartmann
99da7ef2b3 Add project tab to navigator
This makes navigation the project a lot easier
and the layout of the side bars can be locked.

Change-Id: I3ad7b85cb8704aedf8f5ec9ea9b2930c5a0986d1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-02-02 11:01:49 +00:00
Eike Ziller
ecb9fae785 Merge remote-tracking branch 'origin/4.6'
Conflicts:
	share/qtcreator/qml-type-descriptions/qmlproject.qmltypes
	src/plugins/clangcodemodel/clangeditordocumentprocessor.cpp

Change-Id: I35fb652f29a98a798be7c8b4b4c2e581eb175fb6
2018-02-01 09:58:36 +01:00
Thomas Hartmann
e7bc21e912 QmlDesigner: Allow adding of resources
* Allows adding of multiple files
 * Files are copied
 * Files are added to the project
 * Supported file types can be extended

Change-Id: I41d1d18c4a3fc9c6c50e0629070d9a2cbf082976
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2018-01-26 07:59:25 +00:00
Eike Ziller
437590a999 Merge remote-tracking branch 'origin/4.6'
Change-Id: I49e8b8442e2b5edffbea19cb2bba97443ebc3d2a
2018-01-23 17:06:59 +01:00
hjk
33184a1e29 QmlDesigner: Use more direct access to NavigationWidgetFactories
Change-Id: Ib3871131f03f92ffc5e427a09cb5bb26c55268bd
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2018-01-23 10:14:44 +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
Alessandro Portale
078ced511d QmlDesigner: Proper background for crumble bar
Using Utils::StyledBar, and getting rid of one stylesheet.

Change-Id: Idf4db461e6beb60e15cae9b295f13ec489146f4f
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-11-13 09:49:51 +00:00
Tim Jenssen
9cb56f4d73 QmlDesigner: just color the background
Keep the style responsibility add the widget. So coloring the
background with a helper widget is enough here.

Change-Id: I24bb82786e2a8ef4af01b9719d2bad4aa1997f1f
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-11-09 08:26:37 +00:00
Knud Dollereder
4baa34ec60 Assign the stylesheet to the tab-bar that contains the timeline
Change-Id: Idd0e16bd6557bff7fd956e60b8b991b35feb5ea0
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-11-01 13:29:39 +00:00
Tim Jenssen
a5625f2f9d QmlDesigner: initialize actions only at show
Change-Id: Iff6438daf70840116f02fcc439a6327c9401c32c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-08-29 16:35:16 +00:00
Tim Jenssen
0de18abbc2 QmlDesigner: use initializer lists
Change-Id: Ibdc46d30ad3f2b703d4cbdd796a1032030bd17cd
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-04-26 14:18:48 +00:00
Thomas Hartmann
6f1d23711d QmlDesigner: Keep background color in integrated text editor
Applying a .css style overrides the text editor background color
from the theme.
To avoid this we cannot apply any .css on the integrated text editor or
its parents:

 * Only apply the center widget .css to the tab bar.
 * Apply the scrollbar.css only to the scrollbars.

Change-Id: Id9b009a208ea2830c64be8174dbb548ada692560
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-04-03 12:23:02 +00:00
Thomas Hartmann
ddad6866eb QmlDesigner: Remove warning widget from DesignModeWidget
The form editor is now handling even initial warnings.
There is no need for an extra warning widget in the DesignModeWidget.

Change-Id: Iac85c1968e8040ee5f11435fa2876ce2d152c194
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-03-28 12:30:25 +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
Tim Jenssen
1de5bbd378 QmlDesigner: introduce a real Theme class
- rename Theming -> Theme
 - made derived colors as Q_INVOKABLE methods available
 - rename registerIconProvider -> setupTheme
 - inside *.qml files use a singleton import instead of a context

Before this change, every request for a theme value copied the map into the
Qml context including the convert of values QVariant -> QJSString

Change-Id: I1c483fb591336b519d5adab8ad37b42bc5a06720
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-03-09 17:20:36 +00:00
Tim Jenssen
5667fdc46a QmlDesigner: introduce SwitchSplitTabWidget as center widget
Change-Id: I2ab91c3a6c68bb64c6875c37fa6fe2b4abc8b82d
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-02-22 10:12:59 +00:00
Thomas Hartmann
b8ea84adcf QmlDesigner: Polish actions in QmlDesignerPlugin::integrateIntoQtCreator()
Before it was done in DesignModeWidget and the design mode had to be
opened once to show the actions in the Qt Creator options.

Change-Id: I62de2dcab66149b8470261002b019894fb345c8b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-02-15 11:56:11 +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
Tim Jenssen
97a0d62c8e QmlDesigner: move outputPlaceholder to the bottom
Change-Id: Id4b3e47b513bcd9097ff884d7cc9a647715e2734
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2017-01-24 11:34:44 +00:00
Thomas Hartmann
bcc1b56187 QmlDesigner: Move states view to the bottom
Change-Id: I9c46c41d1ac42377c7b552cb8b518ed277e28a0b
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2017-01-12 17:42:31 +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
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
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
Tim Jenssen
2908d42b60 QmlDesigner: keep centralTabWidget for later use
Change-Id: I564e178ba049d963af9a7b5ab8e208c50bcba12c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2016-11-30 10:56:45 +00:00
Orgad Shaneh
7b3642cce4 Merge remote-tracking branch 'origin/4.2'
Change-Id: I259a402bc896fc2e359cc96b7510453ac9a9a552
2016-11-28 15:27:51 +02:00
Tim Jenssen
f7c04cd9b9 QmlDesigner: initialize warningWidget on use
Change-Id: If165a3a8a4adfae166424dcf4a6257f483043f8c
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
2016-11-25 14:22:06 +00:00
Tim Jenssen
bb4b0c8af8 QmlDesigner: hide tabwidget for one central widget
Change-Id: Icafd8cffec042b09993aeea40a86ddd7eb349b0b
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-11-21 15:43:51 +00:00
Tim Jenssen
55db42fe2c QmlDesigner: remove styling of the output pane
Setting objectnames to reduce possible influence to other
widgets.
Introduce a background QWidget to set the background color.
AutofillBackground was not working for unclear reason.

Change-Id: I4acd5b7ed5ff9d63b5320b133a82099c5888b839
Task-number: QTCREATORBUG-17172
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-10-26 16:33:08 +00:00
Tim Jenssen
a0f1473dc1 QmlDesigner: remove unnecessary code
Change-Id: Ib10fa0513f326b3047b93f8cbedc1a11f2bd1f90
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-10-26 16:02:59 +00:00
Tim Jenssen
dafdf290d0 QmlDesigner: prepare centerWidget to use styled QTabWidget
Change-Id: Ibcc6e7d5866df50448b54ecc4f2aff340b353f77
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-10-24 12:47:22 +00:00
Tim Jenssen
4dffc26cd1 QmlDesigner: use Utils::FileName
No behavior change.

Change-Id: I7e8bc51bf1fed99159945c656402bb315aebc3f0
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-10-13 09:51:32 +00:00
Tim Jenssen
c27c9a3123 QmlDesigner: fix gotoCode in error/warning case
The QmlDesignerPlugin::hideDesigner() jumped again to selected node,
which came after the DocumentWarningWidget already set it.

Change-Id: I6e84342208c6405e8b25b516cd411b30bc48fcdb
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-10-05 11:49:44 +00:00
Tim Jenssen
bb55a510cf QmlDesigner: make gotoCodeClicked more safer
Change-Id: I2861cf0e1f1c173b548e586a4fa43e8bc9f9c4da
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
2016-08-01 13:10:50 +00:00
Thomas Hartmann
c0da4e7d80 QmlDesigner: Use QTC_ASSERT instead of Q_ASSERT
This assert is not critical and just indicates
an unnormalised file path.

Change-Id: I3ed7dbe8daae034e5faf44f1bc5aee7ba30e44d0
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-07-18 14:58:44 +00:00
Thomas Hartmann
a017138e58 QmlDesigner: Adding theming support for Qt Quick Designer
With this patch the Qt Quick Designer supports:

*Flat
*Flat Dark
*Flat Light
*Classic

I did not test the dark style.

I added a template engine for the .css files. The syntax for the .css
files
is identical to the QML syntax.

Known issues:
* The icons in the property editor do not play well with the
  Flat Light style. We have to get proper Core:Icon support for the
  icons
  and most icons have to be simplified/flattened to fit the new style/
  theme.
* Some colors in the connection editor are still dark and hardcoded. But
  this looks ok together with all themes.
* The highlight colors are not taken from the theme, yet.

Change-Id: I94f2b75f92db8e131c2b15867dbabe9ae4b2f25a
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-07-12 14:23:29 +00:00
Tim Jenssen
172ea7aa6d QmlDesigner: avoid unused warning in release
Change-Id: I6213fd3555b28b14d23453c24b94acef5baeaf3a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-06-08 09:30:00 +00:00
Tim Jenssen
6512227302 QmlDesigner: merge QmlWarningDialog and DocumentWarningWidget
- fixed cases where the user got the one and the other
    dialog
  - not only the first error is shown, the user can browse

Task-number: QTCREATORBUG-15772
Change-Id: I27786b0e4f9c987646a69d8d7d9ff33e3702587a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-05-20 10:29:16 +00:00
Christian Stenger
e4b2842bf8 QmlDesigner: Fix compile with Qt5.5
Change-Id: Ib1ec04cb9baf4d936d73ceb0d80268aad882368b
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
2016-05-10 15:27:32 +00:00
Tim Jenssen
221f59e152 QmlDesigner: modernize code
- no behavior changes
 - moved a slot to a lambda
 - Using QPointer instead of raw pointer to trigger
   assert if dangling pointer is accessed.
   Refactoring the code might accidentally trigger a
   delete of the QWidget.

Change-Id: Idf711da92e13cf81dd718ae9e034bca7f6d26220
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-05-10 13:04:15 +00:00
Tim Jenssen
cacdcf7160 QmlDesigner: improve warning widget code
- the "move" code needs to be inside the warning widget,
   this also fixes the problem of wrong position at startup
 - the patch removes knowledge about the DesignModeWidget and
   uses a signal

Change-Id: I9a861ab955d16e85d7af36f1b56ddb82578b8da4
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-05-10 13:04:04 +00:00
Tim Jenssen
62e3c0dbf4 QmlDesigner: move RewriterError to an extra file
Change-Id: I453b30f45e0bc447b05694eadda60d4613e88062
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
2016-05-10 13:03:57 +00:00