Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt 6.5 - The current style does not support customization of this control

Qt 6.5 - The current style does not support customization of this control

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
5 Posts 3 Posters 2.5k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • one-rabbitO Offline
    one-rabbitO Offline
    one-rabbit
    wrote on last edited by
    #1

    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

    JKSHJ 1 Reply Last reply
    0
    • C Offline
      C Offline
      Creaperdown
      wrote on last edited by
      #2

      I have the same problem. Did you find any solution?

      1 Reply Last reply
      0
      • one-rabbitO one-rabbit

        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

        JKSHJ Online
        JKSHJ Online
        JKSH
        Moderators
        wrote on last edited by
        #3

        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 or import QtQuick.Controls.Basic)

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        C 1 Reply Last reply
        1
        • JKSHJ JKSH

          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 or import QtQuick.Controls.Basic)

          C Offline
          C Offline
          Creaperdown
          wrote on last edited by
          #4

          @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?

          JKSHJ 1 Reply Last reply
          0
          • C Creaperdown

            @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?

            JKSHJ Online
            JKSHJ Online
            JKSH
            Moderators
            wrote on last edited by
            #5

            @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.

            Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved