qtdeclarative/examples/quick/quickwidgets/qmlpreviewer/states
MohammadHossein Qanbari bd3ad6c71b QML Previewer Example: Prevent unnecessary state changes
Previously, when setting a new file address and pressing the close
button, the focus would move to the quick widget due to
QLineEdit::editingFinished() being called. This triggered an attempt
to close the old file and open the new one, causing unintended state
transitions.

To resolve this, we now reload the file content and update the quick
widget's source without transitioning to CloseState and OpenState. This
is achieved by updating the file path and emitting stateChanged() from
OpenState to OpenState in the StateController, notifying other widgets
to reload their content.

Pick-to: 6.8
Change-Id: Ic623d320fe1736e11fd538a6735632b19c507394
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Reviewed-by: Doris Verria <doris.verria@qt.io>
2024-10-09 16:23:15 +02:00
..
statecontroller.cpp QML Previewer Example: Prevent unnecessary state changes 2024-10-09 16:23:15 +02:00
statecontroller.h QML Previewer Example: Prevent unnecessary state changes 2024-10-09 16:23:15 +02:00