Commit Graph

9 Commits

Author SHA1 Message Date
Jarek Kobus
2b2cacfc09 Fix vanishing transitions when zooming to state
The main design issue in this plugin is that
there is no clear separation between model (which
pretent to be ScxmlDocument and his childern of
ScxmlTag type) and its views (GraphicsScene
and its children of BaseItem subclasses).
When the "Zoom to State" action is invoked,
the new view is being created, showing just
a part of the ScxmlDocument model. However,
some validation is done only on the view part,
checking that BaseItems belong to the common
GraphicsScene. In case the transition was defined
from internal state node to somewhere outside,
we don't have for it an BaseItem on the gui side,
as we just show the part of the scene. That's why
the validation vanishes the transition when
viewing a zoom.

In general, all the validations should be moved
from gui to the ScxmlDocument / ScxmlTag part.
This in general would require really big refactoring,
or even rewrite.

This patch moves some checks into a model side and
disables direct modifications of the model when
it's not desired.

Fixes: QTCREATORBUG-21676
Change-Id: Ica0771f637a9802dcc0fb87ad04b0ee77a21cda2
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2021-01-14 20:48:55 +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
Alessandro Portale
24a25eed14 Use isEmpty() instead of count() or size()
Change-Id: I0a89d2808c6d041da0dc41ea5aea58e6e8759bb4
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
2020-01-20 20:56:57 +00:00
Sona Kurazyan
6f4aa0458c Remove usages of deprecated APIs (part 2)
Replace the uses of deprecated APIs listed below, while keeping in mind
that compatibility with Qt 5.12 (the latest LTS) must be kept. This
means that the new alternatives must be used only when compiling with
Qt versions where the replacement is available.

Replaced:
  QLineF::intersect() -> QLine::intersects() (since 5.14)
  QComboBox::activated() -> QComboBox::textActivated() (since 5.14)
  QWheelEvent::pos() -> QWheelEvent::position() (since 5.14)
  QList::swap() -> QList::swapItemsAt() (since 5.13)

Task-number: QTBUG-76491
Change-Id: I62adc4f0826607b0156bf4bc5648ffb0e41cd895
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-03 09:15:24 +00:00
Alessandro Portale
24ecd7fe6a ScxmlEditor: Modernize
modernize-*

Change-Id: I72a72cf5e9327956fdc0e5fc6f552bfc03d2122c
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2018-12-10 12:03:18 +00:00
Nikita Baryshnikov
0a548fe2bc ScxmlEditor.TransitionItem: fix signed overflow warning
transitionitem.cpp:247: warning: assuming signed overflow does not occur
when assuming that (X - c) <= X is always true [-Wstrict-overflow]
     if (idSnap >= 0 && idSnap < m_cornerPoints.count()) {
         ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: Icc0b21c21326663f801ffef2b82fdd4b2679bf07
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
2017-08-22 09:34:47 +00:00
Tobias Hunger
e2fb126509 Scxml: Avoid possible nullptr dereference
Change-Id: Ie70da61f1c4f05d9247eb8b729fadad59b85cc45
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-11-29 15:22:44 +00:00
Orgad Shaneh
7fbbd8f2fd ScxmlEditor: Cleanup nullptr comparisons
Change-Id: I8b61929f1d23a6a7c46043b8967c1aebe333a7e7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
2016-09-18 10:20:03 +00:00
Alessandro Portale
4ea332b062 ScxmlEditor: Initial import
Change-Id: I4701b77ebd4e2520f2616c42206ac17be3a12b60
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
2016-09-16 12:39:49 +00:00