The current style does not support customization of this control (property: "background"..
-
I've a qml code which executes fine when build in QT 6.0.4 but prompt me a runtime error when i build it using QT 6.2.3.
The complete error is the following:
"QML Rectangle: The current style does not support customization of this control (property: "background" item: QQuickRectangle(0x22c49ddefc0, parent=0x0, geometry=0,0 100x40)). Please customize a non-native style (such as Basic, Fusion, Material, etc)"Here is the portion of code in which the background style is present.
Button { id: listen_btn text: "Press Me" font.pixelSize: 18 background: Rectangle { implicitWidth: 100 implicitHeight: 40 border.width: 1 }
-
I've a qml code which executes fine when build in QT 6.0.4 but prompt me a runtime error when i build it using QT 6.2.3.
The complete error is the following:
"QML Rectangle: The current style does not support customization of this control (property: "background" item: QQuickRectangle(0x22c49ddefc0, parent=0x0, geometry=0,0 100x40)). Please customize a non-native style (such as Basic, Fusion, Material, etc)"Here is the portion of code in which the background style is present.
Button { id: listen_btn text: "Press Me" font.pixelSize: 18 background: Rectangle { implicitWidth: 100 implicitHeight: 40 border.width: 1 }
@johndummy from the docs:
Note: The macOS and Windows styles are not suitable for customizing...
As the error message says, you'll need to change your style to something customizable. I do this in main.cpp:
QString styleName = (platform == "android") ? "Material" : (platform == "windows") ? "Universal" : "Fusion"; QQuickStyle::setStyle(styleName);