Exemplo n.º 1
0
PatientItemWidget::PatientItemWidget(QString patientId, QString patientName, QString patientCity, QString patientCode, QWidget *parent)
: QFrame(parent)
{
	this->parent = dynamic_cast<PatientSearchResultForm*>(parent);
	this->setStyleSheet("border-top: 2px dashed gray;");
	//this->setStyleSheet(" QLabel{ font-size : 18px; font-family : helvetica; color: #BE0A26; }");
	this->setContentsMargins(0, 0, 0, 0);
	
	id = patientId;
	hLayout = new QHBoxLayout();
	hLayout->setContentsMargins(0, 0, 0, 0);
	labelLayout = new QVBoxLayout();
	labelLayout->setContentsMargins(0, 0, 0, 0);
	buttonVLabel = new QVBoxLayout();
	buttonVLabel->setContentsMargins(0, 0, 0, 0);
	
	QLabel *border = new QLabel(this);
	border->setStyleSheet("border-style: hidden;");
	border->setPixmap(QPixmap(":/icons/patientItemLeftBorder.png"));
	
	QLabel *nameLabel = new QLabel("NOME  <font color=\"black\">" + patientName + "</font>", this);
	nameLabel->setStyleSheet("border-style: hidden; font-family : helvetica; color: #BE0A26;");
	QLabel *cityLabel = new QLabel("COMUNE DI RESIDENZA  <font color=\"black\">" + patientCity + "</font>", this);
	cityLabel->setStyleSheet("border-style: hidden; font-family : helvetica; color: #BE0A26;");
	QLabel *codeLabel = new QLabel("ID PAZIENTE  <font color=\"black\">" + patientCode+ "</font>", this);
	codeLabel->setStyleSheet("border-style: hidden; font-family : helvetica; color: #BE0A26;");
	
	ButtonLabel *selectPatientButton = new ButtonLabel(QPixmap(":/icons/patientSelectButton.png"), QPixmap(":/icons/patientSelectButtonPushed.png"), this);
	selectPatientButton->setStyleSheet("border-style: hidden;");
	connect(selectPatientButton, SIGNAL(released()), this, SLOT(selectPatientButtonSlot()));
	 
	labelLayout->setSpacing(1);
	//labelLayout->addSpacing(13);
	labelLayout->addStretch();
	labelLayout->addWidget(nameLabel);
	labelLayout->addWidget(cityLabel);
	labelLayout->addWidget(codeLabel);
	labelLayout->addStretch();
	
	buttonVLabel->addSpacing(25);
	buttonVLabel->addWidget(selectPatientButton);
	buttonVLabel->addStretch();
	
	hLayout->addWidget(border);
	hLayout->addSpacing(5);
	hLayout->addLayout(labelLayout);
	hLayout->addStretch();
	hLayout->addLayout(buttonVLabel);
	hLayout->addSpacing(20);
	
	setLayout(hLayout);
	}
Exemplo n.º 2
0
int PatientItemWidget::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QFrame::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        switch (_id) {
        case 0: selectPatientButtonSlot(); break;
        default: ;
        }
        _id -= 1;
    }
    return _id;
}