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

In QML, Rectangle components with a color property that includes an alpha value do not display correctly on Android.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.5.6, 6.6.3, 6.7.2
    • Quick: 2D Renderer
    • None
    • Android Qt 6.7.2 Clang x86_64; Android SDK version: 13.0; JDK version: 17; NDK version:25.1.8937393; Android 12.0 google play x86_64 system image
    • Android

    Description

      import QtQuick
      Window {
          visible: true    
          Rectangle {
              id : rect1
              width: 100
              height: 100
              anchors.centerIn: parent        
              color: Qt.rgba(1, 0, 0, 0.5)
          }    
          
          Rectangle {
              id : rect2
              antialiasing: false
              width: 100
              height: 100
              anchors.bottom: parent.bottom
              color: Qt.rgba(1, 0, 0, 1)
          }
      }
       

      The above QML program causes rect1 to not display correctly on an Android virtual device. However, when the antialiasing property of rect2 is set to true or the alpha value of rect2's color is a decimal, it displays correctly. I tested this on two local devices, one running Windows 10 and the other running Windows 11, and the issue was consistent on both.

      Attachments

        1. 2024-06-26-untitle1-1.png
          144 kB
          Chen Bin
        2. 2024-06-26-untitle1-2.png
          145 kB
          Chen Bin
        3. 2024-06-26-untitle1-3.png
          137 kB
          Chen Bin
        4. 2024-06-26-untitle1-4.png
          137 kB
          Chen Bin
        5. untitled1.rar
          4 kB
          Chen Bin
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            janichol Andy Nichols
            chen_bin Chen Bin
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes