Qt crashes because of a button background
-
Why can't I use a text or rectangle for background
Button { background: Rectangle { color: "transparent" id: rectangle_29 width: 200 height: 37 radius: 8 border.color: "#727272" border.width: 0.3 anchors.left: parent.left anchors.top: parent.top }
i get error
qrc:/qt/qml/Finbank/qml/Dashboard.qml:444:41: QML QQuickRectangle: The current style does not support customization of this control (property: "background" item: QQuickRectangle(0x600003d79ce0, parent=0x0, geometry=0,0 200x37)). Please customize a non-native style (such as Basic, Fusion, Material, etc). For more information, see: https://doc.qt.io/qt-6/qtquickcontrols2-customize.html#customization-reference
It worked well with designer studio and looked the way I wanted to. How can I achieve this look with non-native style
-
C Christian Ehrlicher moved this topic from General and Desktop on
-
At least it should not crash. Qt Version & Platform details ? Tried with Mac & 6.4.x. It works fine with above code. Not sure why this warning keeps coming. Can you paste the complete sample here ?
-
@Kiovtorov said in Qt crashes because of a button background:
quickcontrols2
QuickRectangle(0x600003d79ce0, parent=0x0, geometry=0,0 200x37))
parent is nullptr. I guess you are mixing Qt5/Qt6 QML code. Maybe try to use Qt6 QML code only. -