Closed tompollok closed 6 years ago
Hi,
This message was added after the switch to QOpenGLWidget
in version 2.7.0.
The constructor with no parameters you create should not call this method, it should call
QGLViewer(QWidget *parent = 0, const QGLWidget *shareWidget, Qt::WindowFlags flags)
instead.
Can you make sure there is no version mismatch between your headers and the library. Did you update both, and recompile everything from scratch. That would be my guess here.
Closing. Please reopen if this is still an issue.
Im sorry, I dont get your explanation. Even the accompanying examples prompt the warning that the contructor is deprecated. I subclassed QGLViewe in this fashion
ViewerWidget::ViewerWidget(QString const& path, QWidget* parent) : QGLViewer{ parent } , pathimage_{ path }
{}`
and get the warning, what am I supposed to to here?
You are absolutely right, there is a mismatch between the new QOpenGLWidget
constructor and the deprecated ones kept for backward compatibility.
A new 2.7.1 release should fix the problem. Feel free to comment if there is still an issue.
I get a warning for when i create an object from my derived QGLViewer
The constructor with a QGLFormat is deprecated, use the regular contructor instead.
class DerivedViewer : public QGLViewer { public: DerivedViewer() { //nothing }
}
DerivedViewer* viewer = new DerivedViewer();
QGLViewer::QGLViewer(const QGLFormat &format, QWidget parent, const QGLWidget shareWidget, Qt::WindowFlags flags) : QOpenGLWidget(parent, flags) { Q_UNUSED(format); Q_UNUSED(shareWidget); qWarning("The constructor with a QGLFormat is deprecated, use the regular " "contructor instead."); defaultConstructor(); }
What am i supposed to not get the warning?