diff options
author | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-12-11 21:29:10 +0200 |
---|---|---|
committer | Mahmoud Badri <mahmoud.badri@qt.io> | 2019-12-13 12:40:43 +0000 |
commit | f97de35dd4af80fa5f3d4229ac4aa8519d9e1d38 (patch) | |
tree | ebc8244942f8014726a7166464f3cc8153d6de21 /src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp | |
parent | c2bfdff70b4d539e719d7eb78a59ed4214b683f4 (diff) |
Improve edit view 3D "on top" logicqds/v1.4.0-rc1
- Proxy dialog removed
- When the QDS window is minimized/maximized, the edit view 3D follows.
The opposite is not true (edit view 3D can be minimized separately).
- Edit view 3D is always on top of QDS window. Only exception is when
a popup is shown (so that the user can handle the popup).
- External apps go normally on top of the edit view 3D.
Known (non critical) issues:
- Activating the edit view 3D doesn't raise() the QDS window, so if an
external app is on top of the edit view 3D then the view is clicked,
the external app will be in between the view and the QDS window.
- Closing the edit view 3D from the x button doesnt work (causes a
restart). This is not in the scope of this commit.
Task-number: QDS-1179
Change-Id: I1dd72590037be295b94735de96772307ba14c59c
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
Diffstat (limited to 'src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp')
-rw-r--r-- | src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp index 9aa8d2f41c..9528328754 100644 --- a/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp +++ b/src/plugins/qmldesigner/designercore/instances/nodeinstanceview.cpp @@ -48,7 +48,8 @@ #include "clearscenecommand.h" #include "changefileurlcommand.h" #include "reparentinstancescommand.h" -#include "change3dviewcommand.h" +#include "update3dviewstatecommand.h" +#include "enable3dviewcommand.h" #include "changevaluescommand.h" #include "changeauxiliarycommand.h" #include "changebindingscommand.h" @@ -979,20 +980,6 @@ ClearSceneCommand NodeInstanceView::createClearSceneCommand() const return {}; } -Change3DViewCommand NodeInstanceView::createChange3DViewCommand(ViewAction action, const QPoint &pos, const QSize &size) const -{ - InformationName informationName = InformationName::ShowView; - - if (action == ViewAction::Move) - informationName = InformationName::MoveView; - else if (action == ViewAction::Hide) - informationName = InformationName::HideView; - - const qint32 instanceId = 0; - - return Change3DViewCommand({ InformationContainer(instanceId, informationName, pos, size) }); -} - CompleteComponentCommand NodeInstanceView::createComponentCompleteCommand(const QList<NodeInstance> &instanceList) const { QVector<qint32> containerList; @@ -1473,21 +1460,22 @@ void NodeInstanceView::selectedNodesChanged(const QList<ModelNode> &selectedNode nodeInstanceServer()->changeSelection(createChangeSelectionCommand(selectedNodeList)); } -void NodeInstanceView::move3DView(const QPoint &position) +void NodeInstanceView::mainWindowStateChanged(Qt::WindowStates previousStates, Qt::WindowStates currentStates) { - nodeInstanceServer()->change3DView(createChange3DViewCommand(ViewAction::Move, position)); + if (nodeInstanceServer()) + nodeInstanceServer()->update3DViewState(Update3dViewStateCommand(previousStates, currentStates)); } -void NodeInstanceView::hide3DView() +void NodeInstanceView::mainWindowActiveChanged(bool active, bool hasPopup) { - nodeInstanceServer()->change3DView(createChange3DViewCommand(ViewAction::Hide)); + if (nodeInstanceServer()) + nodeInstanceServer()->update3DViewState(Update3dViewStateCommand(active, hasPopup)); } -void NodeInstanceView::show3DView(const QRect &rect) +// enable / disable 3D edit View +void NodeInstanceView::enable3DView(bool enable) { - nodeInstanceServer()->change3DView(createChange3DViewCommand(ViewAction::Show, - rect.topLeft(), - rect.size())); + nodeInstanceServer()->enable3DView(Enable3DViewCommand(enable)); } void NodeInstanceView::timerEvent(QTimerEvent *event) |