Hy there,
i am new to Qt and Creator and have the following problem.
I whant to add an OpenGL QGLWidget to a QGuiApplication that i have created with the new project wizard. Then I add a new QTWidget (QT Designer Form Class) also over the wizard and change
class gl : public QWidget {
To copy to clipboard, switch view to plain text mode
to
class gl : public QGLWidget {
To copy to clipboard, switch view to plain text mode
in .h and .cpp
i alos add
#include "QGLWidget"
#include "QGLWidget"
To copy to clipboard, switch view to plain text mode
in the .h file
Now i need to create a new instance of my class here and connect it to the ui
{
// have to add it here
ui->setupUi(this);
// or here and how ?
}
GLTest::GLTest(QWidget *parent)
: QMainWindow(parent), ui(new Ui::GLTest)
{
// have to add it here
ui->setupUi(this);
// or here and how ?
}
To copy to clipboard, switch view to plain text mode
But i do not get it to work.
Can you give me an smale example?
I know that i have to add it to the CentraWidget.
Bookmarks