[Qt-interest] Making part of QWebView as transaparent
Nitin Mahajan
nitinm76 at yahoo.com
Thu Dec 17 12:44:14 CET 2009
Hello,
--- On Thu, 17/12/09, Samuel Rødal <sroedal at trolltech.com> wrote:
> From: Samuel Rødal <sroedal at trolltech.com>
> Subject: Re: [Qt-interest] Making part of QWebView as transaparent
> To: nitinm76 at yahoo.com
> Cc: qt-interest at trolltech.com
> Date: Thursday, 17 December, 2009, 5:10 PM
> >>> I wrote the child
> widget's paint event like this, and
> >> it does most of the job the way I wanted.
> >>> void MyWidget::paintEvent(QPaintEvent *event)
> >>> {
> >>>
> QWidget::paintEvent(event);
> >>> QPainter
> p(this);
> >>>
> >>
> p.setCompositionMode(QPainter::CompositionMode_Source);
> >>>
> p.fillRect(rect(),
> >> Qt::transparent);
> >>> }
> >>>
> >>> Only problem is my mouse, which is a PNG image
> appears
> >> with a very dirty square background in the
> transparent area.
> >> Am I missing something here?
> >>
> >> Are you drawing the mouse pointer manually? Make
> sure it
> >> has a sensible alpha channel and that you're
> using
> >> CompositionMode_SourceOver and not
> CompositionMode_Source to draw it (source should only be
> >> used for the background transparency).
> >
> > I am changing the mouse image like this.
> >
> > QImage image;
> > image.load(abc.png);
> > QScreenCursor *screen =
> QScreenCursor::instance();
> > screen->set(image, 18 ,18);
>
> Hmm, sounds like a potential bug in the QScreenCursor
> blending then. What is the color depth or the display, 16 or
> 32 bit?
>
ARGB32 mode.
regards
-Nitin
> --
> Samuel
>
New Email names for you!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
More information about the Qt-interest-old
mailing list