/[projects]/infoscreen/MainView.cpp
ViewVC logotype

Contents of /infoscreen/MainView.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 524 - (show annotations) (download)
Tue Jan 5 14:03:06 2010 UTC (14 years, 4 months ago) by torben
File size: 1771 byte(s)
Added a plain picture viewer
1 #include "MainView.h"
2 #include <QApplication>
3 #include <QPushButton>
4 #include <QLabel>
5 #include <QVBoxLayout>
6
7 #include <QTimer>
8
9 //#include <VideoPlayer> //Phonon
10 //#include <MediaSource> //Phonon
11
12 #include "MyWebView.h"
13 #include "clientsiderender.h"
14 #include "pictureview.h"
15
16
17 MainView::MainView(QWidget* parent)
18 : QWidget(parent)
19 {
20 this->resize(400,400);
21 this->setWindowState( Qt::WindowFullScreen );
22
23 // qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );
24
25
26 //Phonon::VideoPlayer* video;
27 //video = new Phonon::VideoPlayer(Phonon::VideoCategory, this);
28 //video->load( Phonon::MediaSource("http://todic.dk/ps3cache/Inglourious_Basterds_2009.avi") );
29 //layout->addWidget(video,1);
30 //video->play();
31
32 render = new ClientSideRender(this);
33 render->setVisible( false );
34
35 web = new MyWebView(this);
36 web->setVisible( false);
37
38 picture = new PictureView(this);
39 picture->setVisible( true );
40
41
42
43 QVBoxLayout* layout = new QVBoxLayout();
44 layout->addWidget(web,1);
45 layout->addWidget(render,1);
46 layout->addWidget(picture,1);
47 layout->addStretch();
48 layout->setContentsMargins(0,0,0,0);
49 setLayout(layout);
50
51 QTimer* timer = new QTimer(this);
52 connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));
53 timer->start(1000);
54
55 web->start();
56 }
57
58
59 void MainView::onTimer()
60 {
61 static int count = 0;
62 screenManager.timerTick();
63
64 if ( (count%10) == 0) {
65
66 int t = count / 10;
67 qDebug() << t;
68 if ( (t%2) == 0) {
69 picture->loadFromUrl("http://10.210.210.200/infoscreens/data/images/image1.jpg");
70 } else {
71 picture->loadFromUrl("http://10.210.210.200/infoscreens/data/images/image2.jpg");
72 }
73 }
74 count++;
75 }

  ViewVC Help
Powered by ViewVC 1.1.20