summaryrefslogtreecommitdiffstats
path: root/examples/qtgl/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/qtgl/main.cpp')
-rw-r--r--examples/qtgl/main.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/examples/qtgl/main.cpp b/examples/qtgl/main.cpp
new file mode 100644
index 0000000..a85d421
--- /dev/null
+++ b/examples/qtgl/main.cpp
@@ -0,0 +1,30 @@
+#include "myqgl.h"
+
+#include <qapplication.h>
+#include <qvbox.h>
+#include <qpushbutton.h>
+
+int main(int argc, char **argv)
+{
+ QApplication a(argc, argv);
+
+ if(!QGLFormat::hasOpenGL())
+ {
+ qWarning( "This system has no OpenGL support. Exiting." );
+ return -1;
+ }
+
+ QVBox *v = new QVBox;
+ QPushButton *b = new QPushButton("Show w3.bmp !", v);
+ MyQGL *gl = new MyQGL(v);
+
+ QVBox::connect(b, SIGNAL(clicked()), gl, SLOT(bind()));
+
+ v->setStretchFactor(gl, 1);
+
+ a.setMainWidget(v);
+ v->resize(512, 256);
+ v->show();
+
+ return a.exec();
+}