Details
-
Bug
-
Resolution: Duplicate
-
Not Evaluated
-
5.12.7
-
None
Description
The QML Settings [documentation|https://doc.qt.io/qt-5/qml-qt-labs-settings-settings.html|https://doc.qt.io/qt-5/qml-qt-labs-settings-settings.html] lists a `sync()` method.
However, the following code snippet
import QtQuick 2.12 import QtQuick.Window 2.12 import Qt.labs.settings 1.0 Window { id: window visible: true width: 640 height: 480 title: qsTr("Hello World") onWidthChanged: wh.sync() Settings { id: wh property alias w: window.width property alias h: window.height Component.onCompleted: wh.sync() onWChanged: sync() } }
Results in the following errors
qrc:/main.qml:20: ReferenceError: sync is not defined qrc:/main.qml:12: TypeError: Property 'sync' of object QQmlSettings_QML_0(0x2379a70) is not a function qrc:/main.qml:19: TypeError: Property 'sync' of object QQmlSettings_QML_0(0x2379a70) is not a function
This code seems to run fine on 5.14.2 though the documentation has no indication that it is only available since a specific version
Attachments
Issue Links
- duplicates
-
QTBUG-70291 Add sync method in Qt.labs.settings.Settings
-
- Closed
-