Steff
18th November 2009, 08:45
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
class gl : public QGLWidget {
in .h and .cpp
i alos add
#include "QGLWidget"
in the .h file
Now i need to create a new instance of my class here and connect it to the ui
GLTest::GLTest(QWidget *parent)
: QMainWindow(parent), ui(new Ui::GLTest)
{
// have to add it here
ui->setupUi(this);
// or here and how ?
}
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.
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
class gl : public QGLWidget {
in .h and .cpp
i alos add
#include "QGLWidget"
in the .h file
Now i need to create a new instance of my class here and connect it to the ui
GLTest::GLTest(QWidget *parent)
: QMainWindow(parent), ui(new Ui::GLTest)
{
// have to add it here
ui->setupUi(this);
// or here and how ?
}
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.