当前位置: 首页>>代码示例>>C++>>正文


C++ LabelWidget::setBackgroundImage方法代码示例

本文整理汇总了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);
}
开发者ID:,项目名称:,代码行数:98,代码来源:


注:本文中的LabelWidget::setBackgroundImage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。