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

Changing IconImage's iconColor also affects its size

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.10.0 Alpha
    • 5.10
    • Quick: Controls 2
    • None
    • ea381fba363fcf9b9ef463f24eb90c5e5517fd01

    Description

      Can be seen by running the following code and switching between enabled and disabled:

      import QtQuick 2.9
      import QtQuick.Controls 2.3
      import QtQuick.Controls.impl 2.3
      
      ApplicationWindow {
          id: window
          width: 300
          height: 100
          visible: true
      
          Row {
              anchors.fill: parent
              anchors.margins: 8
              spacing: 20
      
              Switch {
                  id: enabledSwitch
                  text: "Enabled"
                  checked: true
              }
      
              IconImage {
                  color: enabledSwitch.checked ? "transparent" : "grey"
                  source: "qrc:/wifi.png"
                  sourceSize: Qt.size(20, 20)
                  onWidthChanged: print(width)
              }
          }
      }
      

      Attachments

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

        Activity

          People

            mitch_curtis Mitch Curtis
            mitch_curtis Mitch Curtis
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes