Binding with Qt.locale()
Unsolved
QML and Qt Quick
-
Should binding with Qt.locale() works?
Example (2 states):
Binding works with this declaration:
import QtQuick 2.4 import QtQuick.Controls 2.1 import QtQuick.Window 2.1 Window { id: window visible: true width: 320 height: 240 signal translationAsked(string language) Column { anchors.centerIn: parent spacing: 20 Label { text: Qt.locale().name + " " + Qt.locale().dateFormat(Locale.ShortFormat) } ComboBox { model: ["English","Русский"] onCurrentIndexChanged: translationAsked(model[currentIndex]) } Label { text: new Date().toLocaleDateString(Qt.locale(),Locale.ShortFormat) } Label { text: any_not_defined_name // throws 'qrc:/main.qml:28: ReferenceError: fgh is not defined' } } }
But stops to work if I comment last label (that causes ReferenceError). Does anybody know why? And how bind with Qt.locale() in right way?