Results 1 to 3 of 3

Thread: QGLWidget : wrong DC

  1. #1
    Join Date
    Oct 2010
    Posts
    95
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question QGLWidget : wrong DC

    Hi,

    I'm using the WGLWidget under windows 7 64 bits and when I call "wglGetCurrentDC" from the "resizeEvent" I got another value than from the "paintEvent" !
    Also, I have checked and it is the same thread !

    How is it possible ?

    Here is some code :

    Qt Code:
    1. void GLViewport::resizeEvent(QResizeEvent* e)
    2. {
    3. if (_isInitialized)
    4. return;
    5.  
    6. glInit();
    7.  
    8. _win32HDC = wglGetCurrentDC();
    9. }
    10.  
    11. void GLViewport::paintEvent(QPaintEvent *)
    12. {
    13. _win32HDC = wglGetCurrentDC();
    14. }
    To copy to clipboard, switch view to plain text mode 

  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: QGLWidget : wrong DC

    Quote Originally Posted by pl01 View Post
    when I call "wglGetCurrentDC" from the "resizeEvent" I got another value than from the "paintEvent" !
    Yeah, and?

    How is it possible ?
    QGLWidget::makeCurrent(), QGLWidget::doneCurrent()
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Oct 2010
    Posts
    95
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QGLWidget : wrong DC

    Thanks :-)

Similar Threads

  1. One QGLWidget that manage QGLWidget childs
    By polch in forum Qt Programming
    Replies: 4
    Last Post: 12th December 2012, 11:26
  2. What am I doing wrong??
    By Splatify in forum Newbie
    Replies: 3
    Last Post: 7th February 2011, 16:47
  3. What do I do wrong
    By Arif Bilgin in forum Newbie
    Replies: 12
    Last Post: 20th October 2010, 20:03
  4. i don't know what i do wrong..
    By Hardstyle in forum Newbie
    Replies: 2
    Last Post: 27th June 2010, 17:33
  5. what is wrong with my qt ?
    By lwb422 in forum Qt Programming
    Replies: 5
    Last Post: 12th April 2010, 14:07

Tags for this Thread

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.