Ejemplo n.º 1
0
pru::pru(QWidget *parent) : QDialog(parent), tcpServer(0), networkSession(0) {
  // background image
  setStyleSheet("background-image: url(:/images/pru.png);");
  // readouts
  arm.setStyleSheet("background:transparent; font:bold 28px; color: darkblue;");
  arm.setMinimumSize(36, 36);
  SpO2.setStyleSheet("background:transparent; font:bold 28px; color: darkblue;");
  SpO2.setMinimumSize(36, 36);
  HR.setStyleSheet("background:transparent; font:bold 28px; color: darkblue;");
  HR.setMinimumSize(36, 36);
  systolic.setStyleSheet("background:transparent; font:bold 16px; color: darkblue;");
  systolic.setMinimumSize(36, 36);
  respiration.setStyleSheet("background:transparent; font:bold 28px; color: darkblue;");
  respiration.setMinimumSize(36, 36);
  etCO2.setStyleSheet("background:transparent; font:bold 28px; color: darkblue;");
  etCO2.setMinimumSize(36, 36);
  // button images
  QPixmap stopPixmap(":/images/end_case.png");
  QPixmap stopPressedPixmap(":/images/end_case_pressed.png");
  // icons
  stopIcon.addPixmap(stopPixmap); stopPressedIcon.addPixmap(stopPressedPixmap);
  // button definitions
  stopButton.setIcon(stopIcon);
  stopButton.setIconSize(stopPixmap.rect().size());
  stopButton.setStyleSheet("border:none;");

  sessionOpened();

  // connect starting socket communication
  connect(tcpServer, SIGNAL(newConnection()), this, SLOT(initConnect()));

  layout.setColumnMinimumWidth(0,420);
  layout.addWidget(&respiration, 0, 2, Qt::AlignHCenter | Qt::AlignVCenter);
  layout.addWidget(&etCO2, 0, 4, Qt::AlignHCenter | Qt::AlignVCenter);
  layout.addWidget(&SpO2, 1, 3, Qt::AlignHCenter | Qt::AlignVCenter);
  layout.setVerticalSpacing(60);
  layout.addWidget(&HR, 3, 2, Qt::AlignHCenter | Qt::AlignVCenter);
  layout.addWidget(&systolic, 3, 4, Qt::AlignLeft | Qt::AlignLeft);
  layout.addWidget(&arm, 4, 3, Qt::AlignHCenter | Qt::AlignVCenter);
  layout.setRowMinimumHeight(5,76);
  layout.addWidget(&stopButton, 6, 4, Qt::AlignLeft | Qt::AlignLeft);
  layout.setColumnMinimumWidth(5,232);

  QVBoxLayout *mainLayout = new QVBoxLayout;
  mainLayout->addSpacing(48);
  mainLayout->addLayout(&layout);
  mainLayout->addSpacing(28);
  setLayout(mainLayout);

  respiration.setText( "" );
  etCO2.setText( "" );
  SpO2.setText( "" );
  HR.setText( "" );
  systolic.setText( "" );
  arm.setText( "" );
  setWindowTitle(tr("PRU"));
}
Ejemplo n.º 2
0
void QSearchLineEdit::searchStart(bool* canceled, int min, int max)
{
//  if (searchStarted)
//  {
//      setSearchProgressText(tr("Another search in progress!"));
//      return;
//  }
    cancelPointer = canceled;
    searchStarted = true;
    if (cancelPointer) {
        *cancelPointer = false;
    }

    if (!maybeFound) {
        searchStop();
        setSearchProgressText(tr("Please try with another phrase!"));
    }

    if (!sPbar) {
        sPbar = new QProgressBar(this);
    }
    sPbar->setRange(min, max);

    if (!stopButton) {
        stopButton = new QToolButton(sPbar);
    }

    QPixmap stopPixmap(cancelButtonIcon.isEmpty() ? ":/images/cancel.png" : cancelButtonIcon);
    stopPixmap = stopPixmap.scaledToHeight((height() * 5) / 6 , Qt::SmoothTransformation);
    stopButton->setIcon(QIcon(stopPixmap));
    stopButton->setIconSize(stopPixmap.size());
    stopButton->setCursor(Qt::ArrowCursor);
    stopButton->setStyleSheet("QToolButton { border: none; padding: 0px; }");

    sPbar->setStyleSheet(QString(" QProgressBar { background: transparent; border: none; padding-top: %1px; }").arg(qMax((sizeHint().height() - sPbar->sizeHint().height()) / 2, 0)));
    sPbar->setFixedSize(width(), height());

    //stopButton->show();
    sPbar->show();

//  qDebug() << "sizeHint-TOP=" <<(sizeHint().height()-sPbar->sizeHint().height())/2;
//  qDebug() << "size-TOP=" <<(height()-sPbar->height())/2;
    sPbar->setStyleSheet(QString(" QProgressBar { background: transparent; padding-top: %1px; border: none; /* border-radius: 5px;*/}").arg(qMax((height() - sPbar->sizeHint().height()) / 2, 0)));
    sPbar->setFixedSize(width(), height());
//  qDebug() << "prog-height=" <<sPbar->height();
//  qDebug() << "prog-Hint-height=" <<sPbar->sizeHint().height();
//  qDebug() << "lineEdit-height=" <<height();
//  qDebug() << "lineEdit-Hint-height=" <<sizeHint().height();

    connect(stopButton, SIGNAL(clicked()), this, SLOT(searchStop()));
}