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

Inconsistent Behavior of QML Switches on macOS Dark Theme: Text Inside Switch Isn't Visible

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P1: Critical
    • 6.5
    • 6.2.9, 6.2.10
    • None
    • iOS/tvOS/watchOS, macOS

    Description

      When using the provided QML code snippet in a Qt application on macOS dark theme, the text inside the button is not visible.

      Steps to Reproduce:

      1. Launch a Qt application that includes the following QML code snippet on a macOS system with the dark theme enabled:
        import QtQuick
        import QtQuick.Window
        import QtQuick.Controls
        
        Window {
            id: window
            width: 640
            height: 480
            visible: true
            title: qsTr("Hello World")
            Switch {         
            id: liveSwitch         
            width: parent.width
            checked: true
            text: qsTr("Enabled")
            } 
        }
      1. Observe the appearance of the Switch, specifically the visibility of the text.

      Expected Outcome: The text with the QML Switch should be clearly visible, irrespective of the system's theme.

      Actual Outcome: On macOS dark theme, the text inside the QML Switch is not visible, blending in with the button's background or lacking sufficient contrast.

      Additional Information:

      1. This issue is specific to macOS dark theme and does not occur on other platforms or themes.
      2. The problem persists even after restarting the application or the system.
      3. Screenshots depicting the issue are attached for reference.

      Attachments

        1. Actual.png
          Actual.png
          6 kB
        2. expected.png
          expected.png
          9 kB

        Issue Links

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

          Activity

            People

              axelspoerl Axel Spoerl
              alrizwan Alber Rizwan
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes