Results 1 to 6 of 6

Thread: OPENGL, draw directly on the main window view not using QWidget, possible or not ?

  1. #1
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default OPENGL, draw directly on the main window view not using QWidget, possible or not ?

    Hi everybody,

    This post is the second round of a previous one where I wonder which technology to use (QGLWidget, QWidget or QCanvasItem) in order to draw a custom widget with full opacity control (also for the widget background).

    I wonder now if it is possible to create an objet, not inherited from QWigdet or any other object used for drawing, and implements in it some drawing function using OpenGL primitives call. Thus, it will be possible to draw on a main window view with opacity control.

    I would like to know if someone has already implemented such a solution and could tell me what I should be aware of. I already know that if I developp a class that does not inherit from QWidget, I will not have the support it provides (event management functions).

    Thanks in advance for your help.

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: OPENGL, draw directly on the main window view not using QWidget, possible or not ?

    Just a small question - is Qt4 out of the question for you?

  3. #3
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: OPENGL, draw directly on the main window view not using QWidget, possible or not ?

    Unfortunately I can't use QT4 my boss is stingy.

  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: OPENGL, draw directly on the main window view not using QWidget, possible or not ?

    In theory you could render to a gl context and then render the result to a pixmap which you could then blit it to the window. But that's just theory.

  5. #5
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: OPENGL, draw directly on the main window view not using QWidget, possible or not ?

    Ok, thanks for your help.

    I think I will implement a cleaner solution as follow : I will developp my custom widget and it will inherits from QGLWidget (it will give good speed at drawing ... I have found an OpenGL forum which surely will help me to optimize my drawing code)

    This custom will be usable as it with no opacity control (because of the widget background) and integreated into a modal QDialog object (top level and without border) on which I can apply the setWindowOpacity function.

    It seems (to me) to be the best way to answer my needs (under Qt3).

    If someone have another idea ...

  6. #6
    Join Date
    Jan 2006
    Posts
    162
    Thanks
    9
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: OPENGL, draw directly on the main window view not using QWidget, possible or not ?

    Wysota, I keep your solution in mind (off screen rendering) and if I have some time I will implement it in order to compare both.

Similar Threads

  1. cannot make a main window modal
    By Dark_Tower in forum Qt Programming
    Replies: 12
    Last Post: 23rd March 2006, 11:21

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.