1 |
#include "MainView.h" |
#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) |
MainView::MainView(QWidget* parent) |
18 |
: QWidget(parent) |
: QWidget(parent) |
19 |
{ |
{ |
20 |
this->resize(400,400); |
this->resize(400,400); |
21 |
red = new QWidget(this); |
this->setWindowState( Qt::WindowFullScreen ); |
22 |
red->setPalette( QPalette( Qt::red) ); |
|
23 |
red->setStyleSheet("QComboBox { background-color: blue; }"); |
// qApp->setOverrideCursor( QCursor( Qt::BlankCursor) ); |
24 |
red->resize(200,200); |
|
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() |
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 |
} |
} |