Results 1 to 4 of 4

Thread: QGLWidget without an actual Window

  1. #1
    Join Date
    Jul 2008
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default QGLWidget without an actual Window

    We are using QGLWidget, along with two shaders and some texture stuff, to do a bunch of video card texture manipulation and displaying it to a window. We also are taking these images and shipping them off over the network.

    I want to be able to run the video card texture/shader code, hopefully still in a QGLWidget, but without an actual screen attached.

    The issues I'm running into right now:

    1) glewInit() fails with "Missing GL version", so we can't call glGenFramebuffer(), etc.
    2) The context LOOKS valid (I do an isValid() check) but the OpenGL version is 1.0 (probably not correct...)
    3) initializeGL() isn't called (since the window is hidden). I call it manually instead, but we have the glewInit() issue.

    Is this possible to do? Do I need to create some fake window for the QGLWidget to be contained in?

    Thank you for any help you have!

  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 without an actual Window

    With Qt5 this should be achievable, with Qt4 you certainly need a proper display available.
    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
    Jul 2008
    Posts
    9
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QGLWidget without an actual Window

    Great, thank you for the response. Some specific questions:

    * What feature in Qt5 enables me to do this?
    * What do I have to do in Qt5 with no window attached to make sure that there is a valid OpenGL Context?
    * What should I do to call initializeGL() correctly (after the context is created)? Normally, this happens automatically.

  4. #4
    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 without an actual Window

    In Qt5 QpenGL is part of atari module which does not require X11 connection to work as all graphics operations are delegated to a platform specific QPA plugin.

    As for the second question, use QOpenGL* classes I stead of QGL* classes.

    Lastly, initializeGL should be called automatically after create() is called (explicitly or implicitly).
    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.


Similar Threads

  1. Updating QGLWidget in Qt from Main Window
    By mcodesmart in forum Qt Programming
    Replies: 0
    Last Post: 15th May 2014, 16:20
  2. How to render context of QGLWidget, outside of the window
    By KnufflPuffl in forum Qt Programming
    Replies: 1
    Last Post: 28th December 2010, 21:41
  3. Transparent Window on top of QGLWidget flicking on WinXP
    By Patrick_Bao in forum Qt Programming
    Replies: 0
    Last Post: 1st December 2010, 03:07
  4. QWidget/QGlwidget ( + window opacity )
    By medved6 in forum Qt Programming
    Replies: 0
    Last Post: 5th October 2010, 06:14
  5. Transparent window with QGLWidget
    By ultr in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2008, 07:01

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.