Qt 6.5 - The current style does not support customization of this control
-
When I use customization TextField,the backGround are not invalid
my code is
TextField { id: control placeholderText: qsTr("Enter description") background: Rectangle { implicitWidth: 200 implicitHeight: 40 color: control.enabled ? "transparent" : "#353637" border.color: control.enabled ? "#21be2b" : "transparent" } }
this code can run ok on Qt5.15;
This is error info:
QML Rectangle: The current style does not support customization of this control (property: "background" item: QQuickRectangle -
I have the same problem. Did you find any solution?
-
When I use customization TextField,the backGround are not invalid
my code is
TextField { id: control placeholderText: qsTr("Enter description") background: Rectangle { implicitWidth: 200 implicitHeight: 40 color: control.enabled ? "transparent" : "#353637" border.color: control.enabled ? "#21be2b" : "transparent" } }
this code can run ok on Qt5.15;
This is error info:
QML Rectangle: The current style does not support customization of this control (property: "background" item: QQuickRectangleHi, and welcome!
@one-rabbit said in Qt 6.5 - The current style does not support customization of this control:
QML Rectangle: The current style does not support customization of this control (property: "background" item: QQuickRectangle
The full error message is (emphasis added):
QML Rectangle: The current style does not support customization of this control (property: "background" item: QQuickRectangle(0x20b9522db40, parent=0x0, geometry=0,0 0x0)). 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
Your app will use a native style by default, or if you do something like
import QtQuick.Controls.Windows
/import QtQuick.Controls.macOS
. As the error message says, these native styles cannot be customized.You can use a non-native style by importing a non-native style (for example,
import QtQuick.Controls.Fusion
orimport QtQuick.Controls.Basic
) -
Hi, and welcome!
@one-rabbit said in Qt 6.5 - The current style does not support customization of this control:
QML Rectangle: The current style does not support customization of this control (property: "background" item: QQuickRectangle
The full error message is (emphasis added):
QML Rectangle: The current style does not support customization of this control (property: "background" item: QQuickRectangle(0x20b9522db40, parent=0x0, geometry=0,0 0x0)). 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
Your app will use a native style by default, or if you do something like
import QtQuick.Controls.Windows
/import QtQuick.Controls.macOS
. As the error message says, these native styles cannot be customized.You can use a non-native style by importing a non-native style (for example,
import QtQuick.Controls.Fusion
orimport QtQuick.Controls.Basic
)@JKSH Hey, thanks for the response. I have found that I can just set my style to "Basic" in my main.cpp and it solves the warnings. Is that a valid approach?
-
@JKSH Hey, thanks for the response. I have found that I can just set my style to "Basic" in my main.cpp and it solves the warnings. Is that a valid approach?
@Creaperdown said in Qt 6.5 - The current style does not support customization of this control:
Hey, thanks for the response. I have found that I can just set my style to "Basic" in my main.cpp and it solves the warnings. Is that a valid approach?
You're welcome.
Yes, that is exactly what the error message recommends.