PDA

View Full Version : Can I directly draw my screen



iGoo
27th June 2006, 10:55
Hi,
I post threads times in the forum one day and all my problems are got solved by
ur help.
thanks. :p


Can I direct draw my screen

On windows,I can pass a NULL pointer to GetDC api to get the
screen device context and operate on it.

Is there any way I can do this in QT?
I try QApplication::desktop()->screen(),but It seems that all paintdevice can only
be drew with QPainter in paintEvent.

So I faild the code:


QPainter pd(QApplication::desktop()->screen());
pd.drawLine(0,0,500,500);

any suggestion please?

Thanks.

wysota
27th June 2006, 12:19
You can't draw directly on the desktop using Qt. Either use native system calls (which is not recommended anyway) or create a transparent widget (use QWidget::setMask) on your desktop and draw on it.