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.h11
-rw-r--r--src-qt5/src-glwidgets/gltest/main.cpp13
-rwxr-xr-xsrc-qt5/src-glwidgets/gltest/testbin59456 -> 58272 bytes
3 files changed, 10 insertions, 14 deletions
diff --git a/src-qt5/src-glwidgets/gltest/colorchange.h b/src-qt5/src-glwidgets/gltest/colorchange.h
index d62fcd5c..aad01f05 100644
--- a/src-qt5/src-glwidgets/gltest/colorchange.h
+++ b/src-qt5/src-glwidgets/gltest/colorchange.h
@@ -13,14 +13,9 @@ private:
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++;
+ static bool current = false;
+ base->setBackgroundColor( current ? QColor(Qt::blue) : QColor(Qt::red));
+ current = !current;
}
public:
diff --git a/src-qt5/src-glwidgets/gltest/main.cpp b/src-qt5/src-glwidgets/gltest/main.cpp
index b303cb6b..efcebea1 100644
--- a/src-qt5/src-glwidgets/gltest/main.cpp
+++ b/src-qt5/src-glwidgets/gltest/main.cpp
@@ -10,14 +10,14 @@
int main(int argc, char** argv){
- QSurfaceFormat fmt;
+ QSurfaceFormat fmt;
fmt.setRenderableType(QSurfaceFormat::OpenGL); //OpenGL, OpenGLES, OpenVG
fmt.setSwapBehavior(QSurfaceFormat::DoubleBuffer);
- QSurfaceFormat::setDefaultFormat(fmt);
+ QSurfaceFormat::setDefaultFormat(fmt);
QApplication A(argc,argv);
- qDebug() << "Creating base widget";
+ qDebug() << "Creating base widget";
GLW_Base base;
qDebug() << "Resize base widget";
base.resize(1024,768);
@@ -29,7 +29,7 @@ int main(int argc, char** argv){
GLW_Widget wgt(&base);
wgt.setGLBase(&base);
wgt.setGeometry(75,50,50,50);
- QPropertyAnimation anim(&wgt);
+ QPropertyAnimation anim(&wgt);
anim.setTargetObject(&wgt);
anim.setPropertyName("geometry");
//anim.setStartValue(QRect(-50,-50,50,50));
@@ -46,6 +46,7 @@ int main(int argc, char** argv){
colorchange CC(&base);
qDebug() << "Start Event loop";
base.show();
- A.exec();
- qDebug() << " - Finished";
+ int ret = A.exec();
+ qDebug() << " - Finished";
+ return ret;
}
diff --git a/src-qt5/src-glwidgets/gltest/test b/src-qt5/src-glwidgets/gltest/test
index 85760654..3ba6f8db 100755
--- a/src-qt5/src-glwidgets/gltest/test
+++ b/src-qt5/src-glwidgets/gltest/test
Binary files differ
bgstack15