aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick
diff options
context:
space:
mode:
authorMohammadHossein Qanbari <[email protected]>2024-09-02 12:29:26 +0200
committerMohammadHossein Qanbari <[email protected]>2024-09-03 23:23:06 +0200
commit130fac9911b7fdf973c86e3ab50463133e893260 (patch)
tree1f98ade36c3ba48f767568defe830007d2cb5386 /examples/quick
parent91f0226c3c5311fbe89f001a8284f8426b815790 (diff)
QML Previewer Example: Fix bug when saving new file
When saving content as a new file, the application saved the changes but nothing changed in the quick widget. The problem was that the state was not changed correctly, and the current state wouldn't transition to the open state. To fix this issue, when saving the content, the transition from the new state to the open state is `changesSaved()`, while `setDirty(false)` was incorrectly changing the new state back to the init state. Pick-to: 6.8 Change-Id: I20707046bc17044a18c95ce77e6e56c4a8c21627 Reviewed-by: Oliver Eftevaag <[email protected]>
Diffstat (limited to 'examples/quick')
-rw-r--r--examples/quick/quickwidgets/qmlpreviewer/widgets/editorwidget.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/quick/quickwidgets/qmlpreviewer/widgets/editorwidget.cpp b/examples/quick/quickwidgets/qmlpreviewer/widgets/editorwidget.cpp
index c77fd5fa70..eba2cab98b 100644
--- a/examples/quick/quickwidgets/qmlpreviewer/widgets/editorwidget.cpp
+++ b/examples/quick/quickwidgets/qmlpreviewer/widgets/editorwidget.cpp
@@ -222,7 +222,7 @@ void EditorWidget::onFileSelected(const QString &filePath)
switch (stateController->currentState()) {
case StateController::NewState:
- stateController->setDirty(false);
+ stateController->changesSaved(filePath);
break;
case StateController::OpenState:
closeFile();