Results 1 to 2 of 2

Thread: Share content between two QGLWidgets

  1. #1
    Join Date
    Jul 2015
    Posts
    1
    Platforms
    Unix/X11 Maemo/MeeGo

    Default Share content between two QGLWidgets

    Hi I have the following scenario. I've got a QGLWidget which displays contents of a VM's framebuffer in real time. This basically shows the VM's screen in fullscreen mode in my QT application. On another tab in my QT application, I want to show a sort of "preview" of this VM's framebuffer. This is implemented using another QGLWidget which is basically supposed to "stream" the contents of the first big QGLWidget, but scaled down to a fixed smaller size. E.g. the VM's screen in 1024x768 while the preview is just 400x200. (The numbers are just an example).

    Now my question. What is the best way to implement this? I have seem that it is possible to pass a shareWidget parameter to a QGLWidget when constructing it, but I don't yet understand how I can access the content of the first widget from the second widget? And also, is it possible to scale down this content on the second widget without actually affecting what is drawn in the first widget? Is it maybe a better way to use overlays for this?

    I cannot find any similar examples in the QT documenation.

  2. #2
    Join Date
    Oct 2014
    Posts
    81
    Thanks
    20
    Thanked 9 Times in 9 Posts
    Qt products
    Qt5
    Platforms
    Windows
    Wiki edits
    7

    Default Re: Share content between two QGLWidgets

    I think it's possible to use a QGLPixelBuffer object to generate QImages that you draw as the preview window(s).
    http://doc.qt.io/qt-5/qglpixelbuffer.html#details

    This way you wouldn't need to share the OpenGL contexts, and the widget in that other tab can be just an ordinary QWidget that draws the QImages generated.

Similar Threads

  1. How to share textures between QGLWidgets
    By jshafferman in forum Qt Programming
    Replies: 2
    Last Post: 28th April 2015, 09:52
  2. QGLWidgets + QAXWidget
    By Pablo in forum Newbie
    Replies: 0
    Last Post: 22nd January 2010, 14:03
  3. QSettings and QGLWidgets
    By Rayven in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2008, 18:01
  4. Share a 3D texture in four QGLWidgets
    By jp-deivis in forum Qt Programming
    Replies: 6
    Last Post: 21st October 2007, 19:44
  5. QGLWidgets
    By ToddAtWSU in forum Qt Programming
    Replies: 4
    Last Post: 21st August 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.