Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 5

Qt-interest Archive, August 2006
Draw directly on the screen


Message 1 in thread

Hi,

Is it possible to draw directly on the screen, ie. without a widget
frame and background ? I tried this :

QDesktopWidget* d = new QDesktopWidget();
QWidget* w = d->screen();
QPainter p(w);
// painting ...
p.end();

But nothing appears even if the application doesn't terminate.

I am working on Windows XP.

Thanks
Kwakanar

--
 [ signature omitted ] 

Message 2 in thread

Hi,
   I don't think you're supposed to draw directly to  QDesktopWidget. It's only there to provide information about the desktop. I think you'll need to fake it
by making your top level widget frameless (Qt::FramelessHint, I think) and grabbing the background with:
QPixmap::grabWindow(QApplication::desktop()->winId()); // stolen from screenshot example.

Supposedly, kde4 will have true desktop transparency but I doubt it'll apply to winXP. (maybe vista though)

Cheers,
Ben

> -----Original Message-----
> From: Raphaël Kolm [mailto:kwakanar@xxxxxxxxx] 
> Sent: Sunday, August 20, 2006 9:02 PM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Draw directly on the screen
> 
> Hi,
> 
> Is it possible to draw directly on the screen, ie. without a 
> widget frame and background ? I tried this :
> 
> QDesktopWidget* d = new QDesktopWidget();
> QWidget* w = d->screen();
> QPainter p(w);
> // painting ...
> p.end();
> 
> But nothing appears even if the application doesn't terminate.
> 
> I am working on Windows XP.
> 
> Thanks
> Kwakanar
> 
> --
> To unsubscribe - send a mail to 
> qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the 
> subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
> 
> 

--
 [ signature omitted ]