Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QGraphicsOpacityEffect::setOpacityMask(const QBrush & mask): black not 100% transparent and transparent not 100% opaque.

    General and Desktop
    2
    6
    4262
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U
      ucomesdag last edited by

      Got an issue with QGraphicsOpacityEffect::setOpacityMask(const QBrush & mask) the mask is a pixmap set with QBrush::(const QPixmap & pixmap) it contains a gradient Qt::black to Qt::transparent. On windows the black part is transparent and the transparent part is opaque with the mask applied, as it should be.

      On Ubuntu Lucid and also with maemo with the latest qtsdk-2010.04 and latest NokiaSDK black is not 100% transparent and transparent is not 100% opaque. It seems to be the default opacity value (0.7) that gets applied to the mask it self. I tried to fix it with setting opacity to (1.0) before and after setting the mask. Result is that the black area is as it should 100% transparent, but the transparent area is totally black with the mask applied.

      @QGraphicsOpacityEffect *effect_opacity = new QGraphicsOpacityEffect;
      effect_opacity->setOpacityMask(QBrush(opacity_mask));
      //effect_opacity->setOpacity(1.0);@

      Question am I doing something totally wrong and missed something, somehow, somewhere? Or is this a bug/feature? ;-)

      Write “Qt”, not “QT” (QuickTime).

      1 Reply Last reply Reply Quote 0
      • F
        Franzk last edited by

        [quote author="ucomesdag" date="1282779969"]black is not 100% transparent and transparent is not 100% opaque.[/quote]

        Whut? I'm probably missing out on some detail here, but why would you want something that you define to be transparent (see-through) to end up opaque (not very see-through)?

        "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

        http://www.catb.org/~esr/faqs/smart-questions.html

        1 Reply Last reply Reply Quote 0
        • U
          ucomesdag last edited by

          [quote author="Franzk" date="1282801390"][quote author="ucomesdag" date="1282779969"]black is not 100% transparent and transparent is not 100% opaque.[/quote]

          Whut? I'm probably missing out on some detail here, but why would you want something that you define to be transparent (see-through) to end up opaque (not very see-through)?

          [/quote]

          Dude I'm talking about the opacity mask. A black mask applies the effect and a transparent mask lets the image as is. So with an opcity mask, black will make the image transparent and transparent will leave the image as is, opaque as in not transparent. :-)

          Write “Qt”, not “QT” (QuickTime).

          1 Reply Last reply Reply Quote 0
          • F
            Franzk last edited by

            Ah :) I knew I was missing something.

            "Horse sense is the thing a horse has which keeps it from betting on people." -- W.C. Fields

            http://www.catb.org/~esr/faqs/smart-questions.html

            1 Reply Last reply Reply Quote 0
            • U
              ucomesdag last edited by

              [quote author="Franzk" date="1282828283"]Ah :) I knew I was missing something.[/quote]

              Lol

              Write “Qt”, not “QT” (QuickTime).

              1 Reply Last reply Reply Quote 0
              • U
                ucomesdag last edited by

                Reported it as a bug: http://bugreports.qt.nokia.com/browse/QTSDK-176

                Write “Qt”, not “QT” (QuickTime).

                1 Reply Last reply Reply Quote 0
                • First post
                  Last post