Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Qt OpenGL Widget as a view port for qcustomPlot
QtWS25 Last Chance

Qt OpenGL Widget as a view port for qcustomPlot

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
qt5openglqcustomplotc++rendering
14 Posts 5 Posters 7.0k Views
  • 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.
  • Q Offline
    Q Offline
    Qudor Eng
    wrote on 5 Mar 2016, 10:38 last edited by
    #1

    I'm working on project to plot the data from file. I use Qt5.4 and qcustomPlot library to plot the data as X,Y graph, as known the Qt5 don't support OpenGL. I google this problem and found this code:

    QDeclarativeView mainwindow;
    mainwindow.setSource(QUrl::fromLocalFile("./qml/app.qml"));
    QGLFormat format = QGLFormat(QGL::DirectRendering); // you can play with other rendering formats like DoubleBuffer or SimpleBuffer
    format.setSampleBuffers(false);
    QGLWidget *glWidget = new QGLWidget(format);
    glWidget->setAutoFillBackground(false);
    mainwindow.setViewport(glWidget);
    

    from this thread

    but I'm new in Qt and C++ and do not know how to implment this code in my program. the source code of my program on GitHub in this link
    please help me

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 5 Mar 2016, 21:33 last edited by
      #2

      Hi,

      Qt has support for OpenGL since way before Qt 5.

      Changing the viewport is only available to a small subset of class which doesn't include QMainWindow.

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

      Q 1 Reply Last reply 6 Mar 2016, 07:19
      0
      • S SGaist
        5 Mar 2016, 21:33

        Hi,

        Qt has support for OpenGL since way before Qt 5.

        Changing the viewport is only available to a small subset of class which doesn't include QMainWindow.

        Q Offline
        Q Offline
        Qudor Eng
        wrote on 6 Mar 2016, 07:19 last edited by
        #3

        @SGaist
        thank you for replay. Do you suggest me to use QWT ? I think it support opengl

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SGaist
          Lifetime Qt Champion
          wrote on 6 Mar 2016, 21:21 last edited by
          #4

          I don't suggest anything since I don't know what you are trying to plot and why you would need OpenGL as a viewport for it.

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

          Q 1 Reply Last reply 7 Mar 2016, 13:02
          0
          • S SGaist
            6 Mar 2016, 21:21

            I don't suggest anything since I don't know what you are trying to plot and why you would need OpenGL as a viewport for it.

            Q Offline
            Q Offline
            Qudor Eng
            wrote on 7 Mar 2016, 13:02 last edited by
            #5

            @SGaist
            I need to plot real-time signal and I want to use openGL because this plot will be run on raspberry pi "as known the pi CPU very very slow to plot real-time data"

            1 Reply Last reply
            0
            • T Offline
              T Offline
              tekojo
              wrote on 7 Mar 2016, 13:41 last edited by
              #6

              Hi, I moved the topic to "Mobile and Embedded" as it is about doing embedded.

              1 Reply Last reply
              1
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 7 Mar 2016, 20:03 last edited by
                #7

                In that case you should rather look for a solution that can be power by OpenGL e.g. QtCharts

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

                Q 1 Reply Last reply 8 Mar 2016, 07:03
                0
                • S SGaist
                  7 Mar 2016, 20:03

                  In that case you should rather look for a solution that can be power by OpenGL e.g. QtCharts

                  Q Offline
                  Q Offline
                  Qudor Eng
                  wrote on 8 Mar 2016, 07:03 last edited by
                  #8

                  @SGaist
                  I think, I have to buy Qt licence to install QtCharts, isn't it?

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 8 Mar 2016, 07:44 last edited by
                    #9

                    It will be available to both Commercial and GPLv3 since 5.6. See this article. So if your application is GPLv3 then your good to go.

                    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
                    • M Offline
                      M Offline
                      Muzab
                      wrote on 12 Mar 2016, 16:51 last edited by
                      #10

                      I am using Qt 5.6 Creator but

                      QT += charts
                      

                      gives me an error:

                      Project ERROR: Unknown module(s) in QT: charts

                      1 Reply Last reply
                      0
                      • V Offline
                        V Offline
                        vish
                        wrote on 12 Mar 2016, 18:38 last edited by
                        #11

                        I have used qwt. It is coolest open source lib for chart, I would strongly recommend. Check it out if it meets your requirement.

                        Development is possible at any level.

                        1 Reply Last reply
                        0
                        • S Offline
                          S Offline
                          SGaist
                          Lifetime Qt Champion
                          wrote on 12 Mar 2016, 20:42 last edited by
                          #12

                          Because it's not part of Qt 5.6, you have to compile it by hand.

                          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
                          • M Offline
                            M Offline
                            Muzab
                            wrote on 14 Mar 2016, 09:25 last edited by
                            #13

                            The documentation here mentions that I can use Package Manager in Maintenance Tool. But for Qt Creator there is no option there to install add-ons. CAn you suggest me something?

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 14 Mar 2016, 12:35 last edited by
                              #14

                              Again: currently it's not yet part of Qt's OpenSource offering so you have to clone it using git and built it by hand. The repository is here

                              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/14

                              5 Mar 2016, 10:38

                              • Login

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