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. What's the right way to draw 2D graphics with opengl support in qt(c++)?
Forum Updated to NodeBB v4.3 + New Features

What's the right way to draw 2D graphics with opengl support in qt(c++)?

Scheduled Pinned Locked Moved Unsolved General and Desktop
7 Posts 3 Posters 1.8k Views 2 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.
  • I Offline
    I Offline
    Isolde
    wrote on 3 Dec 2017, 12:16 last edited by
    #1

    What's the right way to draw 2D graphics with opengl support in qt(c++)?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 3 Dec 2017, 21:48 last edited by
      #2

      Hi,

      What exactly do you want to draw ?
      What's your application purpose ?
      Are you going to use widgets or Qt Quick ?
      What platform are you targeting ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      I 1 Reply Last reply 4 Dec 2017, 02:27
      1
      • S SGaist
        3 Dec 2017, 21:48

        Hi,

        What exactly do you want to draw ?
        What's your application purpose ?
        Are you going to use widgets or Qt Quick ?
        What platform are you targeting ?

        I Offline
        I Offline
        Isolde
        wrote on 4 Dec 2017, 02:27 last edited by Isolde 12 Apr 2017, 02:28
        #3

        @SGaist Thank you for your reply! I'm coding a program with a large amount of moving text effect for Linux PC platform. And I think it's better not to use QML(I hate Javascript). Up to now, I'm using QLabel with QPropertyAnimation, but it has poor performance. So I wonder what the right way to draw 2D graphics with Hardware Acceleration(like OpenGL) is?

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 4 Dec 2017, 22:09 last edited by
          #4

          You can use the graphics view framework with a QOpenGLWidget as view port to get acceleration or do everything in OpenGL from Qt directly.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          I 1 Reply Last reply 5 Dec 2017, 03:11
          1
          • S SGaist
            4 Dec 2017, 22:09

            You can use the graphics view framework with a QOpenGLWidget as view port to get acceleration or do everything in OpenGL from Qt directly.

            I Offline
            I Offline
            Isolde
            wrote on 5 Dec 2017, 03:11 last edited by
            #5

            @SGaist I'm now trying with QOpenGLWidget, but I have a new question: How can I render these graphics in another thread?

            J 1 Reply Last reply 5 Dec 2017, 07:25
            0
            • I Isolde
              5 Dec 2017, 03:11

              @SGaist I'm now trying with QOpenGLWidget, but I have a new question: How can I render these graphics in another thread?

              J Offline
              J Offline
              jsulm
              Lifetime Qt Champion
              wrote on 5 Dec 2017, 07:25 last edited by
              #6

              @Isolde I don't think you can as all UI related stuff must be done in GUI thread.

              https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 5 Dec 2017, 08:02 last edited by SGaist 12 May 2017, 08:30
                #7

                You have to take special care for the context see the details of the QOpenGLContext class.

                You should also take a look at the Qt OpenGL examples, the Threaded QOpenGLWidget is likely one that you will be interested in.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                1 Reply Last reply
                0

                1/7

                3 Dec 2017, 12:16

                • Login

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