5 |
#include <QVBoxLayout> |
#include <QVBoxLayout> |
6 |
|
|
7 |
#include <QTimer> |
#include <QTimer> |
8 |
|
#include <QKeyEvent> |
9 |
|
|
10 |
#include "MyWebView.h" |
#include "MyWebView.h" |
11 |
#include "clientsiderender.h" |
#include "clientsiderender.h" |
20 |
{ |
{ |
21 |
this->resize(400,400); |
this->resize(400,400); |
22 |
this->setWindowState( Qt::WindowFullScreen ); |
this->setWindowState( Qt::WindowFullScreen ); |
23 |
|
this->grabKeyboard(); |
24 |
|
|
25 |
qApp->setOverrideCursor( QCursor( Qt::BlankCursor) ); |
qApp->setOverrideCursor( QCursor( Qt::BlankCursor) ); |
26 |
|
|
53 |
|
|
54 |
} |
} |
55 |
|
|
56 |
|
void MainView::keyPressEvent ( QKeyEvent* event ) |
57 |
|
{ |
58 |
|
int key = event->key(); |
59 |
|
if (key == ' ' || key == Qt::Key_Return || key == Qt::Key_Enter) { |
60 |
|
qApp->quit(); |
61 |
|
} |
62 |
|
} |
63 |
|
|
64 |
void MainView::onTimer() |
void MainView::onTimer() |
65 |
{ |
{ |
104 |
bool found = false; |
bool found = false; |
105 |
int tries = 0; |
int tries = 0; |
106 |
|
|
107 |
|
if (screenItems.size() > 0) { //only try if we have a any screens |
108 |
while (found == false && tries <= screenItems.size()) { //find next with valid display time |
while (found == false && tries <= screenItems.size()) { //find next with valid display time |
109 |
tries++; |
tries++; |
110 |
currentItemIdx = (currentItemIdx+1) % screenItems.size(); |
currentItemIdx = (currentItemIdx+1) % screenItems.size(); |
111 |
currentItem = screenItems.at(currentItemIdx); |
currentItem = screenItems.at(currentItemIdx); |
112 |
|
|
113 |
if (currentItem.start <= now && now <= currentItem.stop ) |
if (currentItem.start <= now && now <= currentItem.stop ) |
114 |
found = true; |
found = true; |
115 |
|
} |
116 |
} |
} |
117 |
|
|
118 |
if (found) { |
if (found) { |