Details
-
Bug
-
Resolution: Duplicate
-
P1: Critical
-
5.9.0
-
None
-
Qt: qt-opensource-linux-x64-5.9.0
Build host: Ubuntu 64bit
Description
The "readonly" keyword does not work anymore. Seems like it affects all types of properties.
The readonly properties are writable and no error messages are given.
The bug was noticed in 5.9.0, but maybe it started in earlier Qt versions.
The example from the "Read-Only Properties" section at http://doc.qt.io/qt-5/qtqml-syntax-objectattributes.html fails, as shown in the code below.
Marking it as P1 bug, but it should probably be raised to P0, because it may lead to undefined or unexpected behavior of Qml code that uses "readonly" properties.
import QtQuick 2.8 import QtQuick.Window 2.2 Window { visible: true Item { readonly property int someNumber: 10 Component.onCompleted: { someNumber = 20 // "doesn't work, causes an error" <--- Not really, works like a charm! console.log(someNumber) // output: qml: 20 } } }
Attachments
Issue Links
- is duplicated by
-
QTBUG-61123 REG 5.7->5.8: aliasing issue with gcc causes test failures
- Closed