Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-101179

Controls: customizing background problematic with native macOS style

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P2: Important
    • None
    • 6.3.0 Beta2
    • Quick: Controls 2
    • None
    • macOS

    Description

      This example yields an error message for the customized button (and other controls).

      The macOS style implementation makes assumptions about the object used as a background which are probably never met with customized controls.

      qrc:/qt-project.org/imports/QtQuick/Controls/macOS/Button.qml:47: TypeError: Property 'styleFont' of object QQuickRectangle(0x7fac25a172b0) is not a function
      
      import QtQuick
      import QtQuick.Controls
      
      Window {
        width: 640
        height: 480
        visible: true
        title: qsTr("Hello World")
      
        Button {
          text: "Click Me!"
          background: Rectangle { color: "#aa00ff00" }
        }
      }
      

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              qt.team.quick.subscriptions Qt Quick and Widgets Team
              njeisecke Nils Jeisecke
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes