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

no transparent or semi transparent widget background (on android)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.15.0
    • None
    • Android 6, Android 7 and Android 8 on different tablets, build on Windows 10 with Qt 5.15
    • Android

    Description

      I have tried in several ways to give a widget a semi-transparent background in android. Unfortunately I only got to the success via a workaround. With these variants I have tried to create a semi transparent background:

      Flags:

      • WA_TranslucentBackground is used to give the widget a alpha channel
      • WindowFlag Qt::FramelessWindowHint needed in every version for windows otherwise there is no WA_TranslucentBackground used
      • version 1 - semit transparent background in stylesheet
        -> windows: popup background is transparent
        -> android: popup background is black
      • version 2 - semit transparent background in stylesheet - without WA_TranslucentBackground flag (widget has no alpha channed)
        -> windows: popup background is green without any transparency
        -> android: popup background is green without any transparency
      • version 3 - set palette (like in: https://bugreports.qt.io/browse/QTBUG-43635)
        -> windows: popup background is transparent
        -> android: popup background is black
      • version 4 - set palette (like in: https://bugreports.qt.io/browse/QTBUG-43635) - without WA_TranslucentBackground flag (widget has no alpha channed)
        -> windows: popup background is green without any transparency
        -> android: popup background is green without any transparency
      • version 5 - use paint event and WA_TranslucentBackground
        -> windows: popup background is semi transparent green hurray
        -> android: popup background is green without any transparency
      • version 6 - use paint event and WA_TranslucentBackground and a empty QQuickWidget in mainWindow
        -> windows: popup background is semi transparent green hurray
        -> android: popup background is semi transparent green hurray

       

       

      So as you can see I can only generate a semi transparent background on android if I use a QQuickWidget in the mainWindow.

      I would happy if someone can have a look into this issue and tell us how we can create such widgets without a QuickWidget inside the parent.

      I attached the reproducible project with all variations from above - just uncomment the version you want to see.

       

      Attachments

        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
            p.steinmueller Pascal Steinmüller
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes