--- infoscreen/MainView.cpp 2009/12/12 18:59:28 509 +++ infoscreen/MainView.cpp 2010/01/05 14:03:06 524 @@ -1,17 +1,75 @@ #include "MainView.h" +#include +#include +#include +#include + +#include + +//#include //Phonon +//#include //Phonon + +#include "MyWebView.h" +#include "clientsiderender.h" +#include "pictureview.h" + MainView::MainView(QWidget* parent) : QWidget(parent) { - this->resize(400,400); - red = new QWidget(this); - red->setPalette( QPalette( Qt::red) ); - red->setStyleSheet("QComboBox { background-color: blue; }"); - red->resize(200,200); + this->resize(400,400); + this->setWindowState( Qt::WindowFullScreen ); + +// qApp->setOverrideCursor( QCursor( Qt::BlankCursor) ); + + + //Phonon::VideoPlayer* video; + //video = new Phonon::VideoPlayer(Phonon::VideoCategory, this); + //video->load( Phonon::MediaSource("http://todic.dk/ps3cache/Inglourious_Basterds_2009.avi") ); + //layout->addWidget(video,1); + //video->play(); + + render = new ClientSideRender(this); + render->setVisible( false ); + + web = new MyWebView(this); + web->setVisible( false); + + picture = new PictureView(this); + picture->setVisible( true ); + + + + QVBoxLayout* layout = new QVBoxLayout(); + layout->addWidget(web,1); + layout->addWidget(render,1); + layout->addWidget(picture,1); + layout->addStretch(); + layout->setContentsMargins(0,0,0,0); + setLayout(layout); + + QTimer* timer = new QTimer(this); + connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() )); + timer->start(1000); + + web->start(); } void MainView::onTimer() { - + static int count = 0; + screenManager.timerTick(); + + if ( (count%10) == 0) { + + int t = count / 10; + qDebug() << t; + if ( (t%2) == 0) { + picture->loadFromUrl("http://10.210.210.200/infoscreens/data/images/image1.jpg"); + } else { + picture->loadFromUrl("http://10.210.210.200/infoscreens/data/images/image2.jpg"); + } + } + count++; }