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

QPushButton behaves strangely when owned by transparent background QWidget

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 4.7.4
    • GUI: Window management
    • None
    • Windows 7 - 64 bit.

    Description

      My Widget declares:

      setAttribute(Qt::WA_NoSystemBackground);

      In its paintEvent, I set:

      painter.setOpacity(0.75);

      This gives me the ability to project a png on its entire background with some transparency. This works well.

      PROBLEM: I am adding a QPushButton with a transparent png on top of my widget. The opaque portion of the button's image (derived from Qt CSS) is shown correctly, and the transparent areas remain with my widgets' own drawn background, which is already somewhat transparent. That's okay too. The problem begins when I HOVER over the button image. My css dictates that my QPushButton changes image. When that happens, the opaque portion of the button image is shown correctly, but for the transparent areas, it's as if my own widget is re-drawing the background image, only with full opacity as if my Button image's transparent png portion, amplifies everything underneath it, making it opaque.

      This happens only on Windows. On OS X is works fine. I was wondering whether there was a bug in Windows in that respect and if there's a workaround for it.

      Attachments

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

        Activity

          People

            earthdomain Earth Domain (Inactive)
            ronm71 ronen magid
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes