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. QOpenGLWidgewt DirectRendering
Forum Updated to NodeBB v4.3 + New Features

QOpenGLWidgewt DirectRendering

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 312 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.
  • G Offline
    G Offline
    gfxx
    wrote on 18 Feb 2021, 15:25 last edited by gfxx
    #1

    He at all .... I update my app from qt4.8 to QT5.12 .... QGLWidget I discover is obsolete so I must use QOpenGLWidget instead.

    These is ok, but in my old code I can subcalss QGLWidget and make a direct rendering type ... now seems not possible .... these the first function of my subclass of QOpenGLWidget (is the same class of QOpenGLWidget but I add some custom function fr open and close a camera)

    GLwidg::GLwidg(QWidget *parent) :
        QOpenGLWidget(parent)
    
    {
    
        this->setAttribute(Qt::WA_DeleteOnClose); 
        //
        //QOpenGLWidget(QOpenGLFormat(Qt::DirectRendering)); /* these attribute not exist and not fins a substitute*/
        setMaximumSize(480, 360);//(352,288);
        setMinimumSize(480, 360);
        setBaseSize(480, 360);
    
    
    }
    

    All work but my widget show a webcam grab with opencv4.4. In test window of opencv I see the video with correct fps (40/50 more or less), in my app on QOpenGLWidget i see the same but at 0.1fps.

    In the old 4.8 with Qt::DirectRendering all work like a charm .... with 5.12 no.

    what's wrong?

    regards

    bkt

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 18 Feb 2021, 15:34 last edited by
      #2

      Hi
      https://forum.qt.io/topic/45653/qsurfaceformat-vs-qglformat-resolved

      it seems that one can use QSurfaceFormat instead of QOpenGLFormat

      1 Reply Last reply
      1
      • G Offline
        G Offline
        gfxx
        wrote on 19 Feb 2021, 12:20 last edited by gfxx
        #3

        QSurfaceFormat is not for rendering type .... but reading the istructions for that class I see it use "update()" function .... so because QSurfaceFormat is part of QOpenGLWidget I cancel all my "makecurrent()" call on my code and I use "update()" instead. Plus I leave from my subclass of QOpenGLWIdget resizeGL() and inizializeGL() private functions because really not utilize .... QOpenGLWidget automatize all these things.

        Any how after substitutions of all "makecurrent()" call with "update()" call my videostream on qt GUI become working. But for some reasons original video sending from opencv based thread work perfect (i can see it because from opencv thread I can call a video QT windows that show me these) , butevery now and then QOpenGLWidget shows me a 16 split screen with the video converted to the wrong colorspace. This just for a moment, then it resumes normal video and you can again in small strokes, as if a buffer is overloaded and wants to get noticed ....

        regards

        bkt

        1 Reply Last reply
        0

        1/3

        18 Feb 2021, 15:25

        • Login

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