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. The current style does not support customization of this control (property: "background"..
Forum Updated to NodeBB v4.3 + New Features

The current style does not support customization of this control (property: "background"..

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
2 Posts 2 Posters 753 Views 1 Watching
  • 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.
  • J Offline
    J Offline
    johndummy
    wrote on last edited by johndummy
    #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
        }
    
    mzimmersM 1 Reply Last reply
    0
    • J johndummy

      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
          }
      
      mzimmersM Offline
      mzimmersM Offline
      mzimmers
      wrote on last edited by mzimmers
      #2

      @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);
      
      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