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

Customizing checkbox does not fully work when using example from documentation

    XMLWordPrintable

Details

    • Windows
    • ee461e3ae2ed76c3dea190b3aaee739fa93ec17e (qt/qtdeclarative/dev) f350eb21765810f71f4cd531c436d4a0591111d3 (qt/qtdeclarative/6.2)

    Description

      I used this snipped from the documentation.

      import QtQuick
      import QtQuick.Controls
      
      CheckBox {
          id: control
          text: qsTr("CheckBox")
          checked: true
      
          indicator: Rectangle {
              implicitWidth: 26
              implicitHeight: 26
              x: control.leftPadding
              y: parent.height / 2 - height / 2
              radius: 3
              border.color: control.down ? "#17a81a" : "#21be2b"
      
              Rectangle {
                  width: 14
                  height: 14
                  x: 6
                  y: 6
                  radius: 2
                  color: control.down ? "#17a81a" : "#21be2b"
                  visible: control.checked
              }
          }
      
          contentItem: Text {
              text: control.text
              font: control.font
              opacity: enabled ? 1.0 : 0.3
              color: control.down ? "#17a81a" : "#21be2b"
              verticalAlignment: Text.AlignVCenter
              leftPadding: control.indicator.width + control.spacing
          }
      }
      

      It can be found here: https://doc-snapshots.qt.io/qt6-dev/qtquickcontrols2-customize.html

      When hovering over the Checkbox it looks like this:

      This only seems to happen if I use the default style.

      My understanding is that the default style uses the desktop/os theme from QtGui.

      Attachments

        Issue Links

          Activity

            People

              mitch_curtis Mitch Curtis
              thohartm Thomas Hartmann
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: