summaryrefslogtreecommitdiff
path: root/src/plugins/qmldesigner/components/formeditor
Commit message (Collapse)AuthorAgeFilesLines
* QmlDesigner: Change selection in the release eventThomas Hartmann2017-09-131-7/+6
| | | | | | | | | | | | We already change the selection currently in the press event, which leads wo weird behaivour if e.g. shift is pressed. In this case the item is immediately unselected which is unexpected and cannot be moved anymore. Generally reacting to the event in the release event is the correct way to do it. Change-Id: Ib765f97f85e5dbeb6148d48f8640f1798a057b48 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fix shift modifer in layout caseThomas Hartmann2017-09-133-4/+10
| | | | | | | | | | | The move tool normally does not reparent, but by pressing shift the user can enforce reparenting. In the drag tool we prefer to reparent to layouts. The shoft modifer disables this heuristic. Task-number: QTCREATORBUG-18737 Change-Id: Ic8041aed537619b16b892a791c0d2bc2390af204 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Adjust margings for "move zone"Thomas Hartmann2017-08-311-2/+2
| | | | | | | | | | | | | I introduced a zone around the boarder of each item where it can always be dragged, instead of selection another overlapping item. The area is now a lot smaller, but the 4px seem enough for me when testing it. This zone is slightly to big. I keep the size of 20px at the top so the label/gizmo is always dragable. Change-Id: Ia1b8afb822b506f5322b952d5537eafc73b52ea2 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fix crashThomas Hartmann2017-08-111-5/+5
| | | | | | | | | This was introduced when adjusting the selection behaivour. We have to check for the empty list before we call itemList.first(). Change-Id: I12a12bc17f1f513304c8df738e76db999267854a Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
* QmlDesigner: Fix crashThomas Hartmann2017-08-111-2/+2
| | | | | | | | | | | | | This was introduced when adjusting the selection behaivour. When we change to the selection tool we might delete items. This item could be in itemlist we forward to AbstractFormEditorTool. Therefore we change to the selection tool after calling mouseReleaseEvent(). Change-Id: I5cab902b8560780c6ee4edc3466e7087d719f1ef Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
* QmlDesigner: Some cleanupThomas Hartmann2017-08-091-14/+0
| | | | | Change-Id: Ic89c578474d7cdf1f72a61a91d0cdf32f7b70a7f Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner fix parentheses warningNikita Baryshnikov2017-07-261-2/+2
| | | | | | | | | | | | | | | /src/plugins/qmldesigner/components/formeditor/selectiontool.cpp:145: warning: suggest parentheses around '&&' within '||' [-Wparentheses] || selectedItemCursorInMovableArea(event->scenePos()) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ && !event->modifiers().testFlag(Qt::ControlModifier) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ && !event->modifiers().testFlag(Qt::ShiftModifier)) { ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Change-Id: Iea6018d885b9bad13363a39e2aee0e6e229f93c4 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Increase the size of resize handleThomas Hartmann2017-07-211-1/+1
| | | | | | | | This makes it less likely to accidentally move an item instead of resizing it. Change-Id: I6102a05c50a68d50ea9e4a316f48089186b3a373 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fix flickering move cursorThomas Hartmann2017-07-211-6/+9
| | | | | | | | | | The check for selectedItemCursorInMovableArea has to be the first check, because otherwise we might change back to the selection tool if e.g. the item list is empty. This leads to a flickering cursor and bad usabilty. Change-Id: I0ea82cd1c4bf83cde0b173ab08f19bd04b1128c0 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Refine selectionThomas Hartmann2017-07-199-8/+82
| | | | | | | | | | | | | | This is a major overhaul of the slection logic. We do not change to the move tool automatically once the curser enters the selected item. This allows selection of items that are at the same position as the current selected item. The selected item can still be moved if there is no pissible candidate for selection. Also the border and gizmo always allows an item to be moved, if the item is fully covered by another item. Change-Id: Ic97a2bf23f33fcc5e209248aeb2f97df67bd23e1 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* Add Q_FALLTHROUGH for Qt < 5.8Christian Kandeler2017-07-171-0/+2
| | | | | | | | | | | | | | ... and make use of it. With gcc 7, the new option -Wimplicit-fallthrough is introduced and added to the -Wextra set, triggering dozens of warnings in our sources. Therefore, we annotate all obviously intended fall-throughs. The ones that are still left are unclear and need to be checked by the respective maintainer. Change-Id: I44ead33cd42a4b41c28ee5fcb5a31db272710bbc Reviewed-by: Nikita Baryshnikov <nib952051@gmail.com> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: Eike Ziller <eike.ziller@qt.io>
* QmlDesigner: Turn FormEditor item into QGraphicsItemThomas Hartmann2017-07-128-17/+14
| | | | | | | | | | QGraphicsObject is a QObject and significantly heavier then QGraphicsItem. There is no need to use QGraphicsObject in our case. Using QGraphicsItem instead is simply good practice. Change-Id: I65f9db85eace25fd0e7873093e903d923eb338dc Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fix rubberbandThomas Hartmann2017-07-061-2/+1
| | | | | | | | | Everyone agreed that the rubberband selection should be inclusive. There is no need to require that all items are sub children of the same item. This seems confusing. Change-Id: I5fffbc72e0ef15a82fc9f0ab589c865581359775 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fix invert selectionThomas Hartmann2017-07-061-3/+7
| | | | | | | InvertSelection was not properly implemented. Change-Id: I101105b33f8e2b9ed7b62a06d6330cbbfd87879a Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Adjust colorThomas Hartmann2017-05-101-1/+4
| | | | | | | The rectangle that indicates selection has now the selection color. Change-Id: I59bcd070bfb8b16f297e648ff53d83c8953b4896 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: add init root element size settingsTim Jenssen2017-04-281-2/+5
| | | | | | | Task-number: QTCREATORBUG-17965 Change-Id: Id2a3bef8d4becdecc9f358021a18feb2353743b5 Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: use initilizer_lists for pairsTim Jenssen2017-04-281-11/+13
| | | | | Change-Id: I3a1ef67d8af255604494695807331576540b8afa Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: use initializer listsTim Jenssen2017-04-263-8/+8
| | | | | Change-Id: Ibdc46d30ad3f2b703d4cbdd796a1032030bd17cd Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Turn Q_ASSERT into QTC_ASSERTThomas Hartmann2017-04-241-1/+2
| | | | | | | I had this a couple of times and this does not seem fatal. Change-Id: Id6d2101a5dc1bdc652e6ca8557c7dd8450399be4 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Crash fixThomas Hartmann2017-04-201-1/+2
| | | | | | | | | | | | | | | This is a nasty one. The text item that triggers the crash is part of a delegate and therefore, does not have an item in the scene. The rewriter is now setting the id again, when reading the file after the Rectangle is removed. we get a crash. Since delegates are currently not shown in the navigator, this crash could not happen before we introduced the integrated text editor. Task-number: QTCREATORBUG-17970 Change-Id: Ica16dec5bb2f852324de179c4a2b4d43dcf27aa9 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fix warningThomas Hartmann2017-03-211-1/+1
| | | | | Change-Id: Iaa207dec5ea869833750eb9fc18f70f404d08572 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Only show warnings when opening documentThomas Hartmann2017-03-212-5/+0
| | | | | | | | | | Otherwise the warnings become too annoying, since they are also triggered by undo/redo. Do not disable the form editor in case of warnings. Task-number: QTCREATORBUG-16306 Change-Id: Ieb1d6072269935e420e9cf988c900e1af792686f Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Use Qt5-style connectOrgad Shaneh2017-03-2012-19/+23
| | | | | | | + De-slot where possible Change-Id: Ibd2edbef7b7712aba20593bd0417940e828e0c9c Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Show initial warnings and errorsThomas Hartmann2017-03-161-5/+13
| | | | | | | | | When opening a new document the rewriter is attached first and the documentMessage notifers are send before the form editor is attached. Change-Id: I85d91534fd4b0f9fca55829af36dfeec5a284d57 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Disable caching for form editor itemsThomas Hartmann2017-03-131-1/+1
| | | | | | | | This just wastes memory. We already cache the content in a pixmap. Anything we render on top is cheap. Change-Id: Ieecb689aa001ec8948b76c454e0b5217ff20be4f Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Block graphics view update during reset and attachThomas Hartmann2017-03-136-0/+51
| | | | | | | | | This reduces/minimizes flickering when reseting the puppet. With layouts items have the tendency to jump around. We just block any updates on the view for one second. Change-Id: I4baa4bca3ed87a233bce41ab20bd25fc7f59fc06 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: introduce a real Theme classTim Jenssen2017-03-091-3/+3
| | | | | | | | | | | | | - 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>
* QmlDesigner: Fix forceClipThomas Hartmann2017-03-092-6/+7
| | | | | | | We have to set clipping in the right places. Change-Id: Ifc4b1a91cd488b492d1dcd5c420fc7a5ac311fdb Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Reset position if dropping item in layoutThomas Hartmann2017-03-071-0/+9
| | | | | | | If an item is dopped in a layout we reset the position. Change-Id: I22d005111b1f1d16ed81473c84ea8f9e27130e9d Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Remove dead codeThomas Hartmann2017-02-161-3/+0
| | | | | Change-Id: I11cecafb6132b4c1cbcdcca9d3eedd78ee23c83c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Do not select item if parent is invisibleThomas Hartmann2017-02-151-0/+3
| | | | | | | If already the parent is invisible do not select an item. Change-Id: I0ec667314ae7446cda5ed1f0eaa9234ab419de8c Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Show enabled status of FormEditorButtonThomas Hartmann2017-02-151-0/+4
| | | | | Change-Id: I9e35217b13627074b6732dd532ff8fbe99177ebe Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fix crashThomas Hartmann2017-02-151-1/+2
| | | | | | | The item m_labelItem might be null. Change-Id: I3c4c8c1141694a72ad7eb71498929538da55b920 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Use colors from theme the for selection indicatorThomas Hartmann2017-02-152-3/+7
| | | | | Change-Id: I3430e7c49678422811754f1c0400291cdf61c29b Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Implementing FormEditorToolButtonThomas Hartmann2017-02-154-4/+208
| | | | | | | | | This allows to show certain actions inside the selection label. This is useful for context dependent actions that do not belong in the general toolbar and gives those actiosn visibility. Change-Id: I24499d760556c5a60e108f847d39e645b8ee692f Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: simplify ZoomAction::setZoomLevelAlessandro Portale2017-02-151-8/+1
| | | | | | | | There is no need to reimplement qBound. Change-Id: I3b753f30bd183392bef88810228c2153a5edbdb5 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fix initial Ctrl+Mouse zoomAlessandro Portale2017-02-131-2/+2
| | | | | | | | The initial m_currentComboBoxIndex was wrong. Initial Zoom-in jumped to 50% instead of to 125%. Change-Id: Id090e60322a30e7d4b345fa7b8cd1a7be399fdf1 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: Improve selectionThomas Hartmann2017-02-131-0/+3
| | | | | | | | | | When an item in a stacked container is selected, then select the container instead. Usually the user is not interested in the contaienr items. They can still be selected in the navigator. Change-Id: I4d2d7d3d84d40520a91c71c5fc05c815c50d38a2 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* QmlDesigner: Refine painting of place holderThomas Hartmann2017-02-131-8/+20
| | | | | | | | | | | | | | | | Generally painting the place holder for invisble items makes sense. The logic is different for items stacked containers, since those are overlapping and we are only interested in the current visible one. Also it does not make sense to paint the placeholder if already the parent is invisible, since this just creates noise. The logic is now more complex, but the usabilty increases significantly. Change-Id: Ia25f2877c79cace475f0b99fd11ebd242c96e4bb Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* QmlDesigner: MoveManipulator::reparentTo refine behaivourThomas Hartmann2017-02-131-3/+3
| | | | | | | | | | There is special logic to prefer layouts as parents. This makes total sense, but comes in the way if the grand parent is e.g. a stack layout. Using hints to determine these cases. Change-Id: Ie93c3f99e851cf319e888cbdb8868272da53b946 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
* QmlDesigner: Adding logging to form editorThomas Hartmann2017-02-092-6/+19
| | | | | | | | | These logs are useful to debug hints and form editor behavivour. Adding more if required. I cleaned up the include order. Change-Id: I39b8c4e215ba4e6a524f4b00828156d6e56d8eb7 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Do not return invisible items as containersThomas Hartmann2017-02-091-1/+2
| | | | | | | If an item is invisible then it is not an intuitive container. Change-Id: I1f978be98b7330848e19192843188331438b98ba Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Forward events to sceneThomas Hartmann2017-02-081-3/+20
| | | | | | | | This allows items in the scene to handle mouse clicks and hover events. This is required to add e.g. a toolbar. Change-Id: I3780735f1cbe30df0481d421f2aa2646f8e270d8 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Improve selection indicatorThomas Hartmann2017-02-082-10/+70
| | | | | | | | | The indicator for a single selection now has a label. I also adjusted the color a bit. The selection indicator now has a width of 2. Change-Id: I541e8d3ab3f648af8b1fc6b0c005ddd538bb7de8 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: Fixing crash if FormEditorItems have custom childrenThomas Hartmann2017-02-081-6/+7
| | | | | | | | | If any FormEditor item has non FormEditor item children the current code will crash. While currently FormEditor items do not have such children, we might add such children in the future. Change-Id: I894324a4b247e91eb3fd0db30eb4d9f198f7474a Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: The items of the form editor should not accept buttonsThomas Hartmann2017-02-083-0/+3
| | | | | | | The mouse buttons are handled by the tools. Change-Id: Ie47818e7acfe32db69d9258175580c7cdb05ed5e Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: fix ResizeHandle penTim Jenssen2017-02-081-0/+4
| | | | | Change-Id: I6b5733714a6d0cbf6d20dd74be88cdbdf7d7bd54 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* QmlDesigner: remove empty lineTim Jenssen2017-02-071-1/+0
| | | | | Change-Id: If8ad086bed95d051661fe834a6cfb3883bed5269 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
* QmlDesigner: avoid temp QListTim Jenssen2017-01-271-2/+1
| | | | | Change-Id: I9eb5cc5a3e5527308a4371bc2b6add47d1b3ed7f Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
* white space only changesTim Jenssen2017-01-241-2/+0
| | | | | Change-Id: Ib78ea3244594320f54a2feb04f639caa83e1ba84 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>