diff options
author | Ken Moore <ken@ixsystems.com> | 2017-09-26 23:18:34 -0400 |
---|---|---|
committer | Ken Moore <ken@ixsystems.com> | 2017-09-26 23:18:34 -0400 |
commit | 04069af07a667fb6b677f1655978853c42410b2f (patch) | |
tree | 3d587999b4206aa80fa7b96e96224685935864a4 /src-qt5/src-glwidgets/gltest/main.cpp | |
parent | Merge branch 'master' of github.com:trueos/lumina (diff) | |
download | lumina-04069af07a667fb6b677f1655978853c42410b2f.tar.gz lumina-04069af07a667fb6b677f1655978853c42410b2f.tar.bz2 lumina-04069af07a667fb6b677f1655978853c42410b2f.zip |
Update some more of the GL widget set and the test
Get the generic widget draggable (optional).
Verify that QPropertyAnimations work property on widgets in the test.
Diffstat (limited to 'src-qt5/src-glwidgets/gltest/main.cpp')
-rw-r--r-- | src-qt5/src-glwidgets/gltest/main.cpp | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/src-qt5/src-glwidgets/gltest/main.cpp b/src-qt5/src-glwidgets/gltest/main.cpp index 041ee5ff..c3edd088 100644 --- a/src-qt5/src-glwidgets/gltest/main.cpp +++ b/src-qt5/src-glwidgets/gltest/main.cpp @@ -2,7 +2,8 @@ #include <QApplication> #include <QTimer> #include <QColor> - +#include <QPushButton> +#include <QPropertyAnimation> #include "../glw-base.h" #include "../glw-widget.h" @@ -14,10 +15,28 @@ int main(int argc, char** argv){ GLW_Base base; qDebug() << "Resize base widget"; base.resize(200,200); - qDebug() << "Create colorchange"; + qDebug() << "Create Other widgets"; + GLW_Widget wgt1(&base); + wgt1.setGLBase(&base); + wgt1.setGeometry(50,50,50,50); + wgt1.setDraggable(true); GLW_Widget wgt(&base); wgt.setGLBase(&base); - wgt.setGeometry(50,50,50,50); + wgt.setGeometry(75,50,50,50); + QPropertyAnimation anim(&wgt); + anim.setTargetObject(&wgt); + anim.setPropertyName("geometry"); + //anim.setStartValue(QRect(-50,-50,50,50)); + //anim.setEndValue(QRect(200,200,50,50)); + anim.setStartValue(QRect(100,100,0,0)); + anim.setEndValue(QRect(0,0,200,200)); + anim.setDuration(1500); + anim.setLoopCount(-1); + anim.start(); + /*QPushButton but(&base); + but.setText("button"); + but.setGeometry(100,100,50,50); + but.setStyleSheet("background: rgba(0,150,0,125)");*/ colorchange CC(&base); qDebug() << "Start Event loop"; base.show(); |