diff options
Diffstat (limited to 'src-qt5/src-glwidgets/gltest/colorchange.h')
-rw-r--r-- | src-qt5/src-glwidgets/gltest/colorchange.h | 11 |
1 files changed, 3 insertions, 8 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: |