Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.8.0 Beta
-
None
-
3ea7f91d9bb0e74f1c49384019f22d55b2fb6263
Description
<Unknown File>: QML : Binding loop detected for property "foreground" <Unknown File>: QML : Binding loop detected for property "foreground"
In the following example, only the non-flat dark ComboBoxes are triggering the binding loop, but the rest are included just to make sure that the potential fix doesn't break the other foreground conditions.
import QtQuick 2.6 import QtQuick.Controls 2.0 import QtQuick.Controls.Material 2.0 ApplicationWindow { visible: true width: 640 height: 480 header: ToolBar { Row { spacing: 20 ComboBox { model: ["Light"] } ComboBox { flat: true model: ["Flat Light"] } ComboBox { model: ["Dark"] Material.theme: Material.Dark // <== } ComboBox { flat: true model: ["Flat Dark"] Material.theme: Material.Dark } } } Row { anchors.centerIn: parent Pane { Column { spacing: 20 ComboBox { model: ["Light"] } ComboBox { flat: true model: ["Flat Light"] } } } Pane { Material.theme: Material.Dark Column { spacing: 20 ComboBox { // <== model: ["Dark"] } ComboBox { flat: true model: ["Flat Dark"] } } } } }
For some reason, it happens to work in 5.7 with
Material.foreground: Material.foreground === Material.toolTextColor ? undefined : Material.foreground
But no longer in 5.8:
Material.foreground: flat ? undefined : Material.foreground
Notice that changing that line back to how it was in 5.7 doesn't solve the binding loop. Both branches are broken. We must not bind a property to itself.
Attachments
Issue Links
- relates to
-
QTBUG-86975 ComboBox: Binding loop for property "foreground" (5.15.1)
- Closed
- resulted from
-
QTBUG-54935 Material style ComboBox has white text (on a white background) when put in a ToolBar
- Closed