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

Annotation of /infoscreen/mainview.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 526 - (hide annotations) (download)
Tue Jan 5 17:19:02 2010 UTC (14 years, 4 months ago) by torben
Original Path: infoscreen/MainView.cpp
File size: 1767 byte(s)
added bugs in pictureview
1 torben 509 #include "MainView.h"
2 torben 512 #include <QApplication>
3 torben 510 #include <QPushButton>
4 torben 512 #include <QLabel>
5 torben 510 #include <QVBoxLayout>
6 torben 509
7 torben 510 #include <QTimer>
8    
9 torben 515 //#include <VideoPlayer> //Phonon
10     //#include <MediaSource> //Phonon
11 torben 511
12 torben 512 #include "MyWebView.h"
13 torben 515 #include "clientsiderender.h"
14 torben 524 #include "pictureview.h"
15 torben 511
16 torben 512
17 torben 509 MainView::MainView(QWidget* parent)
18     : QWidget(parent)
19     {
20 torben 516 this->resize(400,400);
21 torben 512 this->setWindowState( Qt::WindowFullScreen );
22 torben 516
23 torben 526 qApp->setOverrideCursor( QCursor( Qt::BlankCursor) );
24 torben 510
25 torben 511
26 torben 512 //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 torben 510
32 torben 515 render = new ClientSideRender(this);
33 torben 517 render->setVisible( false );
34 torben 524
35 torben 515 web = new MyWebView(this);
36 torben 524 web->setVisible( false);
37 torben 511
38 torben 524 picture = new PictureView(this);
39     picture->setVisible( true );
40 torben 517
41    
42 torben 524
43 torben 510 QVBoxLayout* layout = new QVBoxLayout();
44 torben 515 layout->addWidget(web,1);
45     layout->addWidget(render,1);
46 torben 524 layout->addWidget(picture,1);
47 torben 510 layout->addStretch();
48     layout->setContentsMargins(0,0,0,0);
49 torben 515 setLayout(layout);
50 torben 510
51     QTimer* timer = new QTimer(this);
52     connect(timer, SIGNAL(timeout() ), this, SLOT(onTimer() ));
53 torben 511 timer->start(1000);
54 torben 517
55     web->start();
56 torben 509 }
57    
58    
59     void MainView::onTimer()
60     {
61 torben 524 static int count = 0;
62 torben 512 screenManager.timerTick();
63 torben 524
64     if ( (count%10) == 0) {
65    
66     int t = count / 10;
67     qDebug() << t;
68     if ( (t%2) == 0) {
69 torben 526 picture->loadFromUrl("http://87.104.25.138/infoscreens/data/images/image1.jpg");
70 torben 524 } else {
71 torben 526 picture->loadFromUrl("http://87.104.25.138/infoscreens/data/images/image2.jpg");
72 torben 524 }
73     }
74     count++;
75 torben 509 }

  ViewVC Help
Powered by ViewVC 1.1.20