Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Guide - Qt 5 + OpenGL
Forum Updated to NodeBB v4.3 + New Features

Guide - Qt 5 + OpenGL

Scheduled Pinned Locked Moved General and Desktop
5 Posts 3 Posters 2.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zeh32
    wrote on 23 Apr 2014, 19:45 last edited by
    #1

    *Hello everyone!

    I need to develop a new application using Qt and OpenGL to render some 3D geometrys.
    I downloaded the lastest version of these softwares in the "Downloads" section of this website. The file name is Qt 5.2.1 for Windows 64-bit (VS 2012, OpenGL, 553 MB), and I am using the Visual Studio Add-in 1.2.2 for Qt5 too, because I'm using VS2012.

    Googling for tutorials in the internet and in the YouTube, a found a lot these. But almost ever using the QGLWidget class, wich belongs to QtOpenGl module. But now, the Qt website recommends to use the QtGui library instead off this module. So, my questions:

    1 - Is there a way to use the QtGui library (OpenGL) with QtDesigner? I couldn't find a way to do that. If positive, could you show me a tutorial or exemple?

    2 - Could you show another guide, tutorial or exemple to learn how to use the QtGui library to work with OpenGL? This website only shows one exemple and the Dr. Sean Harmer Video didn't help me. Using QtGui instead of OpenGL add-in, is a new approach (I think), and there are few exemples in the internet.

    Thanks for the help.

    1 Reply Last reply
    0
    • C Offline
      C Offline
      ChrisW67
      wrote on 24 Apr 2014, 06:26 last edited by
      #2

      You can place QGLWidget into a Designer layout by placing a QWidget and using the "Promote To..." functionality to promote it to your QGLWidget subclass. The content of the GL widget is provided by your subclass paintGL() function.

      See the examples, particularly the Hello GL Example, here:
      http://qt-project.org/doc/qt-5/examples-widgets-opengl.html

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        Zeh32
        wrote on 28 Apr 2014, 11:42 last edited by
        #3

        Thank you for your reply!

        But is there a way to use QtGui library and QGLWidget together? Could you show me some exemples?

        1 Reply Last reply
        0
        • X Offline
          X Offline
          Xander84
          wrote on 28 Apr 2014, 12:32 last edited by
          #4

          Hi, what do you mean with QtGUI lib? the GUI lib in Qt 5 is just the windowing stuff and OpenGl integration etc and without it you can't display anything so of course you can just integrate that with OpenGL.

          If you mean Qt widgets lib, that works like always you can use widgets the same way in layout and the QGLWidget can be used to draw custom OpenGL code. If you want to use widgets on top of your QGLWidget that might be a little tricky, but maybe you elaborate your question a little first.

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            Zeh32
            wrote on 28 Apr 2014, 14:50 last edited by
            #5

            Maybe the way I talked was not right.

            Resuming, could you show me some exemples using the QOpenGL classes in Qt GUI (just like this exemple: http://qt-project.org/doc/qt-5/qtgui-openglwindow-example.html) intead of exemples using the QtOpenGL Add-in (not recommended anymore)?

            1 Reply Last reply
            0

            1/5

            23 Apr 2014, 19:45

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved