本文整理汇总了C++中LabelWidget::setBackgroundImage方法的典型用法代码示例。如果您正苦于以下问题:C++ LabelWidget::setBackgroundImage方法的具体用法?C++ LabelWidget::setBackgroundImage怎么用?C++ LabelWidget::setBackgroundImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LabelWidget
的用法示例。
在下文中一共展示了LabelWidget::setBackgroundImage方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: QWidget
PatientSearchForm::PatientSearchForm(QWidget *parent)
: QWidget(parent)
{
ui.setupUi(this);
/* set the background image */
setBackgroundImage();
this->setContentsMargins(0,0,0,0);
creditsFooter = new CreditsFooterWidget(this);
creditsFooter->setMinimumHeight(43);
creditsFooter->setMaximumHeight(43);
creditsFooter->setBackgroundImage();
/* create the GUI object */
LabelWidget *surnameLabel = new LabelWidget("Cognome", this);
//surnameLabel->setMaximumHeight(30);
surnameLabel->setBackgroundImage();
surnameTextBox = new TextBoxWidget(QPixmap(":/icons/textBoxBg.png"));
LabelWidget *nameLabel = new LabelWidget("Nome", this);
nameLabel->setBackgroundImage();
nameTextBox = new TextBoxWidget(QPixmap(":/icons/textBoxBg.png"));
LabelWidget *cityLabel = new LabelWidget("Comune di Residenza", this);
cityLabel->setBackgroundImage();
cityTextBox = new TextBoxWidget(QPixmap(":/icons/textBoxBg.png"));
LabelWidget *codeLabel = new LabelWidget("Id Paziente", this);
codeLabel->setBackgroundImage();
codeTextBox = new TextBoxWidget(QPixmap(":/icons/textBoxLineBg.png"));
searchButton = new ButtonLabel(QPixmap(":/icons/findButton.png"), QPixmap(":/icons/findButtonPushed.png"), this);
connect(searchButton, SIGNAL(released()), this, SLOT(searchButtonSlot()));
creditsButton = new ButtonLabel(QPixmap(":/icons/creditsButton.png"), QPixmap(":/icons/creditsButton.png"), this);
connect(creditsButton, SIGNAL(released()), this, SLOT(creditsButtonSlot()));
quitButton = new ButtonLabel(QPixmap(":/icons/quitButton.png"), QPixmap(":/icons/quitButton.png"), this);
connect(quitButton, SIGNAL(released()), QApplication::instance(), SLOT(quit()));
personLogo = new QLabel(this);
personLogo->setPixmap(QPixmap(":/icons/userIcon.png"));
/* layout operations */
QHBoxLayout *headerLayout = new QHBoxLayout();
headerLayout->setContentsMargins(13, 13, 13, 0);
headerLayout->addWidget(personLogo);
headerLayout->addStretch();
headerLayout->addWidget(quitButton);
QVBoxLayout *vLayout = new QVBoxLayout();
vLayout->setSpacing(0);
vLayout->setContentsMargins(0,0,0,0);
vLayout->addLayout(headerLayout);
vLayout->addStretch(5);
vLayout->addWidget(surnameLabel);
QHBoxLayout *surnameHLayout = new QHBoxLayout();
surnameHLayout->addWidget(surnameTextBox);
surnameTextBox->setBackgroundImage();
vLayout->addLayout(surnameHLayout);
vLayout->addWidget(nameLabel);
QHBoxLayout *nameHLayout = new QHBoxLayout();
nameHLayout->addWidget(nameTextBox);
nameTextBox->setBackgroundImage();
vLayout->addLayout(nameHLayout);
vLayout->addWidget(cityLabel);
QHBoxLayout *cityHLayout = new QHBoxLayout();
cityHLayout->addWidget(cityTextBox);
cityTextBox->setBackgroundImage();
vLayout->addLayout(cityHLayout);
vLayout->addWidget(codeLabel);
QHBoxLayout *codeHLayout = new QHBoxLayout();
codeHLayout->addWidget(codeTextBox);
codeTextBox->setBackgroundImage();
vLayout->addLayout(codeHLayout);
vLayout->addStretch(1);
vLayout->addWidget(searchButton);
vLayout->setAlignment(searchButton, Qt::AlignCenter);
vLayout->addStretch(4);
vLayout->addWidget(creditsFooter);
QHBoxLayout *mainLayout = new QHBoxLayout();
mainLayout->setContentsMargins(0,0,0,0);
mainLayout->addLayout(vLayout);
mainLayout->setAlignment(Qt::AlignCenter);
setLayout(mainLayout);
/* connect the patient change signal to the close slot */
connect(MobiState::getInstance(), SIGNAL(changeCurrentPatientSignal()), this, SLOT(close()));
loadingImage = new QLabel(this);
loadingImage->setPixmap(QPixmap(":/icons/loadingBg.png"));
loadingImage->setFixedSize(360, 640);
loadingImage->setVisible(false);
}