Force.cpp \
GestureOutput.cpp \
Peephole.cpp \
- LargeView.cpp
+ LargeView.cpp \
+ ScreenRotate.cpp
HEADERS += MenuPrincipal.h \
Options.h \
Force.h \
GestureOutput.h \
Peephole.h \
- LargeView.h
+ LargeView.h \
+ ScreenRotate.h
FORMS += menuprincipal.ui \
options.ui \
#include "ui_menuprincipal.h"
#include <QDebug>
+#include <QTimer>
#include <Tidy.h>
#include <Force.h>
#include <GestureOutput.h>
#include <Peephole.h>
-#include <QTimer>
+#include <ScreenRotate.h>
MenuPrincipal::MenuPrincipal(QWidget *parent) :
QMainWindow(parent),
connect(ui->force, SIGNAL(clicked()), this, SLOT(openForce()));
connect(ui->gestureoutput, SIGNAL(clicked()), this, SLOT(openGestureOutput()));
connect(ui->peephole, SIGNAL(clicked()), this, SLOT(openPeephole()));
+ connect(ui->screenrotate, SIGNAL(clicked()), this, SLOT(openScreenRotate()));
connectKeyboard();
void MenuPrincipal::openGestureOutput()
{
- GestureOutput * g= new GestureOutput(this);
+ GestureOutput *g= new GestureOutput(this);
g->show();
}
void MenuPrincipal::openPeephole()
{
- Peephole * p= new Peephole(this);
+ Peephole *p= new Peephole(this);
p->show();
QTimer::singleShot(Peephole::updatedelay, p, SLOT(updatescreenpos()));
}
+
+void MenuPrincipal::openScreenRotate()
+{
+ ScreenRotate *s = new ScreenRotate(this);
+ s->show();
+}
void openForce();
void openGestureOutput();
void openPeephole();
+ void openScreenRotate();
private:
Ui::MenuPrincipal *ui;
#include "ScreenRotate.h"
-ScreenRotate::ScreenRotate()
+#include <QDebug>
+#include <MenuPrincipal.h>
+#include <QGraphicsPixmapItem>
+
+ScreenRotate::ScreenRotate(QWidget *parent) :
+ QMainWindow(parent),
+ ui(new Ui::Fullscreen),
+ _window(NULL)
+{
+ ui->setupUi(this);
+ setWindowState(Qt::WindowMaximized);
+ setAttribute(Qt::WA_DeleteOnClose);
+
+ ui->image->setScene(&_background);
+ _window = new QGraphicsPixmapItem(QPixmap("../../images/desktop.jpg"));
+ _background.addItem(_window);
+ ui->image->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ ui->image->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
+ ui->image->fitInView(_window);
+
+ connect(ui->start, SIGNAL(clicked()), this, SLOT(rotateScreen()));
+ connect(ui->appbutton1, SIGNAL(clicked()), this, SLOT(setupPresentation()));
+ connect(ui->appbutton2, SIGNAL(clicked()), this, SLOT(setupCalendar()));
+ connect(ui->appbutton3, SIGNAL(clicked()), this, SLOT(setupEmails()));
+
+ MenuPrincipal * menu = dynamic_cast<MenuPrincipal *>(parent);
+ if (!menu->getScreen())
+ qDebug() << "Warning: screen not connected";
+ else
+ menu->getScreen()->rotation(90);
+}
+
+ScreenRotate::~ScreenRotate()
+{
+ delete ui;
+}
+
+void ScreenRotate::rotateScreen()
+{
+ MenuPrincipal * menu = dynamic_cast<MenuPrincipal *>(this->parent());
+ if (menu->getScreen())
+ {
+ if (_straight)
+ {
+ menu->getScreen()->rotation(180);
+ _straight = false;
+ }
+ else
+ {
+ menu->getScreen()->rotation(90);
+ _straight = true;
+ }
+ }
+}
+
+void ScreenRotate::setupEmails()
+{
+ if (_window)
+ _background.removeItem(_window);
+ _window = new QGraphicsPixmapItem(QPixmap("../../images/emailapp.png"));
+ _background.addItem(_window);
+ ui->image->fitInView(_window);
+}
+
+void ScreenRotate::setupPresentation()
+{
+ if (_window)
+ _background.removeItem(_window);
+ _window = new QGraphicsPixmapItem(QPixmap("../../images/presentationapp.png"));
+ _background.addItem(_window);
+ ui->image->fitInView(_window);
+}
+
+void ScreenRotate::setupCalendar()
{
+ if (_window)
+ _background.removeItem(_window);
+ _window = new QGraphicsPixmapItem(QPixmap("../../images/calendarapp.png"));
+ _background.addItem(_window);
+ ui->image->fitInView(_window);
}
#ifndef SCREENROTATE_H
#define SCREENROTATE_H
-class ScreenRotate
+#include <QMainWindow>
+#include <QGraphicsScene>
+
+#include <ui_fullscreen.h>
+
+namespace Ui {
+ class Fullscreen;
+}
+
+class ScreenRotate : public QMainWindow
{
+ Q_OBJECT
+
public:
- ScreenRotate();
+ explicit ScreenRotate(QWidget *parent = 0);
+ ~ScreenRotate();
+
+ public slots:
+ void rotateScreen();
+ void setupEmails();
+ void setupPresentation();
+ void setupCalendar();
+
+ private:
+ Ui::Fullscreen *ui;
+ QGraphicsScene _background;
+ QGraphicsPixmapItem *_window;
+ bool _straight;
};
#endif // SCREENROTATE_H
<rect>
<x>0</x>
<y>0</y>
- <width>800</width>
+ <width>1007</width>
<height>600</height>
</rect>
</property>
<property name="text">
<string>Start</string>
</property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../../images/start.png</normaloff>../../images/start.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeType">
+ <enum>QSizePolicy::Fixed</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>10</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QPushButton" name="appbutton1">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>140</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">text-align: left; padding:5px;</string>
+ </property>
+ <property name="text">
+ <string>Presentation</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../../images/presentation.png</normaloff>../../images/presentation.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="appbutton2">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>140</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">text-align: left; padding:5px;</string>
+ </property>
+ <property name="text">
+ <string>Calendar</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../../images/calendar.png</normaloff>../../images/calendar.png</iconset>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QPushButton" name="appbutton3">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>140</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="styleSheet">
+ <string notr="true">text-align: left; padding:5px;</string>
+ </property>
+ <property name="text">
+ <string>E-mail</string>
+ </property>
+ <property name="icon">
+ <iconset>
+ <normaloff>../../images/email.png</normaloff>../../images/email.png</iconset>
+ </property>
+ <property name="flat">
+ <bool>false</bool>
+ </property>
</widget>
</item>
<item>
</property>
</spacer>
</item>
+ <item>
+ <widget class="QLabel" name="label_3">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="pixmap">
+ <pixmap>../images/barbuttons.png</pixmap>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QLabel" name="label_2">
+ <property name="text">
+ <string>4:29</string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>21/10/2015</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
</layout>
</item>
</layout>
<x>0</x>
<y>0</y>
<width>894</width>
- <height>546</height>
+ <height>630</height>
</rect>
</property>
<property name="windowTitle">
</property>
</widget>
</item>
+ <item row="3" column="0">
+ <widget class="QPushButton" name="screenrotate">
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>150</height>
+ </size>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>30</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>Screen rotate</string>
+ </property>
+ </widget>
+ </item>
</layout>
</item>
<item>