Results 1 to 2 of 2

Thread: Can I directly draw my screen

  1. #1
    Join Date
    May 2006
    Posts
    32
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Cool Can I directly draw my screen

    Hi,
    I post threads times in the forum one day and all my problems are got solved by
    ur help.
    thanks.

    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:

    Qt Code:
    1. QPainter pd(QApplication::desktop()->screen());
    2. pd.drawLine(0,0,500,500);
    To copy to clipboard, switch view to plain text mode 

    any suggestion please?

    Thanks.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Can I directly draw my screen

    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.

Similar Threads

  1. Replies: 3
    Last Post: 8th December 2006, 18:51
  2. Howto draw stuff
    By Morea in forum Newbie
    Replies: 16
    Last Post: 7th April 2006, 12:05
  3. clear screen function( )
    By therealjag in forum Qt Programming
    Replies: 2
    Last Post: 8th March 2006, 20:41
  4. Problem with screen update...
    By mysearch05 in forum Qt Programming
    Replies: 2
    Last Post: 27th January 2006, 18:24
  5. Drawing over content widgets? (overlay)
    By sertrem in forum Qt Programming
    Replies: 2
    Last Post: 17th January 2006, 22:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.