aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/src-glwidgets/gltest
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/src-glwidgets/gltest')
-rw-r--r--src-qt5/src-glwidgets/gltest/colorchange.h35
-rw-r--r--src-qt5/src-glwidgets/gltest/main.cpp26
-rwxr-xr-xsrc-qt5/src-glwidgets/gltest/testbin0 -> 50927 bytes
-rw-r--r--src-qt5/src-glwidgets/gltest/test.pro9
4 files changed, 70 insertions, 0 deletions
diff --git a/src-qt5/src-glwidgets/gltest/colorchange.h b/src-qt5/src-glwidgets/gltest/colorchange.h
new file mode 100644
index 00000000..d62fcd5c
--- /dev/null
+++ b/src-qt5/src-glwidgets/gltest/colorchange.h
@@ -0,0 +1,35 @@
+#include <QDebug>
+#include <QApplication>
+#include <QTimer>
+#include <QColor>
+
+#include "../glw-base.h"
+
+class colorchange : public QObject{
+ Q_OBJECT
+private:
+ GLW_Base *base;
+ QTimer *timer;
+
+public slots:
+ void toggle(){
+ static int current = 0;
+ if(current==0){
+ base->setBackgroundColor(QColor(Qt::red));
+ }else{
+ base->setBackgroundColor(QColor(Qt::blue));
+ current = -1;
+ }
+ current++;
+ }
+
+public:
+ colorchange(GLW_Base *parent) : QObject(){
+ base = parent;
+ timer = new QTimer(this);
+ timer->setInterval(5000);
+ connect(timer, SIGNAL(timeout()), this, SLOT(toggle()) );
+ timer->start();
+ }
+
+};
diff --git a/src-qt5/src-glwidgets/gltest/main.cpp b/src-qt5/src-glwidgets/gltest/main.cpp
new file mode 100644
index 00000000..041ee5ff
--- /dev/null
+++ b/src-qt5/src-glwidgets/gltest/main.cpp
@@ -0,0 +1,26 @@
+#include <QDebug>
+#include <QApplication>
+#include <QTimer>
+#include <QColor>
+
+#include "../glw-base.h"
+#include "../glw-widget.h"
+
+#include "colorchange.h"
+
+int main(int argc, char** argv){
+ QApplication A(argc,argv);
+ qDebug() << "Creating base widget";
+ GLW_Base base;
+ qDebug() << "Resize base widget";
+ base.resize(200,200);
+ qDebug() << "Create colorchange";
+ GLW_Widget wgt(&base);
+ wgt.setGLBase(&base);
+ wgt.setGeometry(50,50,50,50);
+ colorchange CC(&base);
+ qDebug() << "Start Event loop";
+ base.show();
+ A.exec();
+ qDebug() << " - Finished";
+}
diff --git a/src-qt5/src-glwidgets/gltest/test b/src-qt5/src-glwidgets/gltest/test
new file mode 100755
index 00000000..5a69b0c3
--- /dev/null
+++ b/src-qt5/src-glwidgets/gltest/test
Binary files differ
diff --git a/src-qt5/src-glwidgets/gltest/test.pro b/src-qt5/src-glwidgets/gltest/test.pro
new file mode 100644
index 00000000..cba315c3
--- /dev/null
+++ b/src-qt5/src-glwidgets/gltest/test.pro
@@ -0,0 +1,9 @@
+QT = core gui widgets
+
+TARGET = test
+
+SOURCES += main.cpp
+
+HEADERS += colorchange.h
+
+include(../glwidgets.pri);
bgstack15