Esempio n. 1
0
/*!
    \class MainWindow mainwindow.h
    \brief Class fills graphical user interface with controls.
*/
MainWindow::MainWindow()
    : QWidget(0, Qt::FramelessWindowHint), m_embedded(false)
{
    // create a widget we can access in CSS: QWidget#PatientCare
    QWidget* top = new QWidget(this);

#if defined(Q_WS_HILDON) || defined(Q_WS_S60) || defined(Q_WS_QWS) || defined(Q_OS_WINCE)
    m_embedded = true;
#endif
    if (QApplication::arguments().contains("-embedded"))
        m_embedded = true;
    if (QApplication::arguments().contains("-no-embedded"))
        m_embedded = false;

    ui.setupUi(top);

    setWindowTitle("Pulse Oximeter");
    setWindowIcon(QIcon(":/qt-logo32x32"));

    m_controller = new PatientCareController(&ui, this);

    if (!m_embedded) {
        updateDecoration();
        top->setGeometry(153, 95, 636, 476);
    } else {
        QVBoxLayout *lay = new QVBoxLayout(this);
        lay->setContentsMargins(0, 0, 0, 0);
        lay->addWidget(top);

        qApp->setOverrideCursor(Qt::BlankCursor);
        setWindowState(Qt::WindowFullScreen);
    }
}
/*!
    \class MainWindow mainwindow.h
    \brief Class fills graphical user interface with controls.
*/
MainWindow::MainWindow()
    : QWidget(0, Qt::FramelessWindowHint), m_embedded(false)
{
    // create a widget we can access in CSS: QWidget#PatientCare
    QWidget* top = new QWidget(this);

#if defined(Q_WS_HILDON) || defined(Q_WS_S60) || defined(Q_WS_QWS) || defined(Q_OS_WINCE)
    m_embedded = true;
#endif
    if (QApplication::arguments().contains("-embedded"))
        m_embedded = true;
    if (QApplication::arguments().contains("-no-embedded"))
        m_embedded = false;
    m_embOffSwitch = QApplication::arguments().contains("-embOffSwitch");

    ui.setupUi(top);
    connect(ui.switchNightMode, SIGNAL(toggled(bool)), this, SLOT(toggleNightMode(bool)));

    setWindowTitle("PatientCare (Demo)");
    setWindowIcon(QIcon(":/qt-logo32x32"));
    setSkins();

    ui.switchSystemOff->setChecked(true);
    ui.switchNightMode->setChecked(true);
    toggleNightMode(true);

    m_controller = new PatientCareController(&ui, this);

    if (!m_embedded) {
        updateDecoration();
        top->setGeometry(153, 95, 636, 476);
        QtSvgToggleSwitch* offSwitch = new QtSvgToggleSwitch(this);
        offSwitch->setSkin("Beryl");
        offSwitch->setChecked(true);
        offSwitch->setGeometry(795, 568, 50, 50);
    
        connect(offSwitch, SIGNAL(toggled(bool)), top, SLOT(setVisible(bool)));
        connect(offSwitch, SIGNAL(toggled(bool)), this, SLOT(quitDelay()));
    } else {