Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Error finding a member function in QOpenGLWidget



  • Hi All,

    I trying to build a program to display Quaternion rotation. I have an QOpenGLWidget. There is a class glwidget.cpp which I included in the project. There is a member function called updateOrientation().

    I do this in order to update orientation of a 3d object using Quaternion.

      ui->glWidget->updateOrientation(quat[0],quat[1],quat[2],quat[3]);
    

    but I get an error:

    settings.cpp:223:18: error: no member named 'updateOrientation' in 'QOpenGLWidget'
    

    I dont know why this is happening , I included the class glwidget.cpp , also I make sure opengl is included in the .pro file as well.

    What might be the issue here?

    Thanks a lot


  • Lifetime Qt Champion

    Hi
    so glWidget is a QOpenGLWidget child that lives in glwidget.cpp
    and you added a new method for it and it can't see it ?

    can you show glwidget.h ?

    Im not sure are using the custom widget on as the error is
    'updateOrientation' in 'QOpenGLWidget' << but if you have a subclass then it
    should say some other name in my book.

    So i think you have a plain QOpenGLWidget in your form and
    you really wanted some custom one ?

    Like forgetting to promote it to the one in glwidget.cpp
    So its just the Qt build in and dont have this function as that is added to the derived class/custom class.



  • @mrjj Thanks a lot.! It got solved. It was problem due to I forgot to promote it to the glwidget.cpp.


  • Lifetime Qt Champion

    @viniltc
    Hehe well +1 for guessing power to me then :)


Log in to reply