diff --git a/sources/editor/ui/qetelementeditor.cpp b/sources/editor/ui/qetelementeditor.cpp index a46c56aa5..38fb6a8b7 100644 --- a/sources/editor/ui/qetelementeditor.cpp +++ b/sources/editor/ui/qetelementeditor.cpp @@ -967,11 +967,9 @@ void QETElementEditor::readSettingsState() QVariant state = settings.value("elementeditor/state"); if (state.isValid()) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - restoreState(state.toByteArray()); -#else - restoreState(state.toByteArray()); -#endif + if (!restoreState(state.toByteArray())) { + settings.remove("elementeditor/state"); + } } } diff --git a/sources/qetdiagrameditor.cpp b/sources/qetdiagrameditor.cpp index 4ad6de7e7..d33426aa4 100644 --- a/sources/qetdiagrameditor.cpp +++ b/sources/qetdiagrameditor.cpp @@ -2224,13 +2224,9 @@ void QETDiagramEditor::readSettingsState() // etat de la fenetre (barres d'outils, docks...) QVariant state = settings.value("diagrameditor/state"); if (state.isValid()) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) if (!restoreState(state.toByteArray())) { settings.remove("diagrameditor/state"); } -#else - restoreState(state.toByteArray()); -#endif } } diff --git a/sources/titleblock/qettemplateeditor.cpp b/sources/titleblock/qettemplateeditor.cpp index 4195c30ba..e3a44ecbb 100644 --- a/sources/titleblock/qettemplateeditor.cpp +++ b/sources/titleblock/qettemplateeditor.cpp @@ -661,11 +661,9 @@ void QETTitleBlockTemplateEditor::readSettingsState() QVariant state = settings.value("titleblocktemplateeditor/state"); if (state.isValid()) { -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) - restoreState(state.toByteArray()); -#else - restoreState(state.toByteArray()); -#endif + if (!restoreState(state.toByteArray())) { + settings.remove("titleblocktemplateeditor/state"); + } } }