diff options
| author | MohammadHossein Qanbari <mohammad.qanbari@qt.io> | 2024-09-19 14:09:28 +0200 |
|---|---|---|
| committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-09-20 07:41:39 +0000 |
| commit | 361264c29cecc83bd53a48c7797d45cbe5958a49 (patch) | |
| tree | 4b976260ef407f4a735bad3015e2e2f78dd255ea | |
| parent | 02ac9409e2d6932ec85c9778e2534c4165c89e0b (diff) | |
QML Previewer Example: Fix saving the default file's changes
When changes to the default loaded file were saved, the address bar
displayed an incorrect path and the view failed to update.
The issue stemmed from an improper transition from the Dirty state to
the Open state. The correct transition is changesSaved(). The
setDirty(false) method is reserved for when changes are discarded (e.g.,
after an undo operation).
Change-Id: Iafee4bf7c0eeae6f2fc7fdb0d32a555a99824249
Reviewed-by: Doris Verria <doris.verria@qt.io>
(cherry picked from commit fa878707fbee8b0c5449c101991f488786a6c248)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 2fe3eefd2a201cde46086d5e53d30a77c832c3ff)
| -rw-r--r-- | examples/quick/quickwidgets/qmlpreviewer/widgets/editorwidget.cpp | 2 |
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..4090ad0c2f 100644 --- a/examples/quick/quickwidgets/qmlpreviewer/widgets/editorwidget.cpp +++ b/examples/quick/quickwidgets/qmlpreviewer/widgets/editorwidget.cpp @@ -228,7 +228,7 @@ void EditorWidget::onFileSelected(const QString &filePath) closeFile(); break; case StateController::DirtyState: - stateController->setDirty(false); + stateController->changesSaved(filePath); closeFile(); break; default: |
