diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-02-15 17:40:38 +0200 |
---|---|---|
committer | Tomi Korpipää <tomi.korpipaa@qt.io> | 2018-02-16 05:42:28 +0000 |
commit | b8cc53b732480fa3f2fb89f3d661489ba1c888b3 (patch) | |
tree | 6cb76c1e74e35787ceec2c7f8ebf125f0ba15d49 | |
parent | d6f594359c29cd1f726a04350352a2d17255194c (diff) |
Fix broken undo/redo stack
Datainput controls for timeline and slides used transactions for
querying values, which broke the undo stack. There is no need to use
transaction for querying a value.
Task-number: QT3DS-1074
Change-Id: I57a426c126b4638e858ef3256b64bd8494248e4a
Reviewed-by: Janne Kangas <janne.kangas@qt.io>
Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io>
-rw-r--r-- | src/Authoring/Studio/Palettes/Slide/SlideView.cpp | 20 | ||||
-rw-r--r-- | src/Authoring/Studio/_Win/UI/TimeLineToolbar.cpp | 20 |
2 files changed, 16 insertions, 24 deletions
diff --git a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp index 00617c52..c53b120c 100644 --- a/src/Authoring/Studio/Palettes/Slide/SlideView.cpp +++ b/src/Authoring/Studio/Palettes/Slide/SlideView.cpp @@ -275,11 +275,9 @@ void SlideView::onDataInputChange(const QString &dataInputName) Q_ASSERT(false); } - qt3dsdm::Option<qt3dsdm::SValue> controlledPropertyVal - = Q3DStudio::SCOPED_DOCUMENT_EDITOR( - *doc, - QObject::tr("Get DataInput control"))->GetInstancePropertyValue(slideRoot, - ctrldProp); + qt3dsdm::SValue controlledPropertyVal; + doc->GetStudioSystem()->GetPropertySystem()->GetInstancePropertyValue( + slideRoot, ctrldProp, controlledPropertyVal); // To indicate that slide transitions are controlled by data input, // we set "controlled property" of this scene to contain the name of @@ -287,7 +285,7 @@ void SlideView::onDataInputChange(const QString &dataInputName) // If we have existing slide control in this root element, replace it. // Otherwise just append slide control string to controlledproperty // (it might already contain timeline control information) - auto existingCtrl = qt3dsdm::get<QString>(controlledPropertyVal.getValue()); + auto existingCtrl = qt3dsdm::get<QString>(controlledPropertyVal); if (existingCtrl.contains("@slide")) { int slideStrPos = existingCtrl.indexOf("@slide"); // find the controlling datainput name and build the string to replace @@ -333,13 +331,11 @@ void SlideView::updateDataInputStatus(bool isViaDispatch) Q_ASSERT(false); } - qt3dsdm::Option<qt3dsdm::SValue> controlledPropertyVal - = Q3DStudio::SCOPED_DOCUMENT_EDITOR( - *doc, - QObject::tr("Get DataInput control"))->GetInstancePropertyValue(slideRoot, - ctrldProp); + qt3dsdm::SValue controlledPropertyVal; + doc->GetStudioSystem()->GetPropertySystem()->GetInstancePropertyValue( + slideRoot, ctrldProp, controlledPropertyVal); - auto existingCtrl = qt3dsdm::get<QString>(controlledPropertyVal.getValue()); + auto existingCtrl = qt3dsdm::get<QString>(controlledPropertyVal); if (existingCtrl.contains("@slide")) { int slideStrPos = existingCtrl.indexOf("@slide"); int ctrStrPos = existingCtrl.lastIndexOf(" ", slideStrPos - 2); diff --git a/src/Authoring/Studio/_Win/UI/TimeLineToolbar.cpp b/src/Authoring/Studio/_Win/UI/TimeLineToolbar.cpp index 2d8c460f..f0bb7d2c 100644 --- a/src/Authoring/Studio/_Win/UI/TimeLineToolbar.cpp +++ b/src/Authoring/Studio/_Win/UI/TimeLineToolbar.cpp @@ -170,12 +170,10 @@ void TimeLineToolbar::updateDataInputStatus(bool isViaDispatch) Q_ASSERT(false); } - qt3dsdm::Option<qt3dsdm::SValue> controlledPropertyVal - = Q3DStudio::SCOPED_DOCUMENT_EDITOR( - *doc, - QObject::tr("Get Timeline control"))->GetInstancePropertyValue(timeCtxRoot, - ctrldProp); - auto existingCtrl = qt3dsdm::get<QString>(controlledPropertyVal.getValue()); + qt3dsdm::SValue controlledPropertyVal; + doc->GetStudioSystem()->GetPropertySystem()->GetInstancePropertyValue( + timeCtxRoot, ctrldProp, controlledPropertyVal); + auto existingCtrl = qt3dsdm::get<QString>(controlledPropertyVal); if (existingCtrl.contains("@timeline")) { int slideStrPos = existingCtrl.indexOf("@timeline"); @@ -254,13 +252,11 @@ void TimeLineToolbar::onDataInputChange(const QString &dataInputName) else Q_ASSERT(false); - qt3dsdm::Option<qt3dsdm::SValue> controlledPropertyVal - = Q3DStudio::SCOPED_DOCUMENT_EDITOR( - *doc, - QObject::tr("Get DataInput control"))->GetInstancePropertyValue(timeCtxRoot, - ctrldPropertyHandle); + qt3dsdm::SValue controlledPropertyVal; + doc->GetStudioSystem()->GetPropertySystem()->GetInstancePropertyValue( + timeCtxRoot, ctrldPropertyHandle, controlledPropertyVal); - auto existingCtrl = qt3dsdm::get<QString>(controlledPropertyVal.getValue()); + auto existingCtrl = qt3dsdm::get<QString>(controlledPropertyVal); if (existingCtrl.contains("@timeline")) { int slideStrPos = existingCtrl.indexOf("@timeline"); // find the controlling datainput name and build the string to replace |