[Qt-interest] Transparent QGraphicsView
Enrico Ros
enrico.qt at email.it
Fri Aug 21 20:52:28 CEST 2009
QGraphicsView is a QAbstractScrollArea that is a QWidget.
Being a Scroll Area, it has an internal "viewport" widget, and you have to
look there for making the QGW completely transparent. So try to set a
transparent palette on the qgv->viewport() and issue
'setAutoFillBackground(false)' to the viewport too.
I just found out that the viewport uses the 'base' palette color to fill the
background, so just setting:
Enrico
P.S:
This will make the QGraphicsView to not paint any background. If it's a top-
level-widget (also known as 'a window') and you want to see behind it, make
sure to set the Qt::WA_TranslucentBackground attribute like this:
qgv->setAttribute(Qt::WA_TranslucentBackground, true)
On Friday 21 August 2009 15:22:49 Giuliano Vilela wrote:
> Hello,
>
> I'm wondering if it's possible to have a QGraphicsView with a
> transparent background. I tried setting the background brush of both
> the QGraphicsView and the QGraphicsScene to Qt::NoBrush and it didn't
> work. Any toughts?
>
> Thanks!
>
--
Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f
Sponsor:
Posta Elettronica Certificata con valore legale e notifica via SMS: scopri legal.email.it
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=8977&d=21-8
More information about the Qt-interest-old
mailing list