void MainScoreWidget::initButtonLayout() { m_stackedWidget = new QStackedWidget; ButtonLabel *cancleButton = new ButtonLabel; cancleButton->setText("取消体检"); connect(cancleButton, SIGNAL(labelClicked()), this, SIGNAL(cancleExamine())); QWidget *fixWidget = new QWidget; StaticButton *fixButton = new StaticButton(":/main/btn_fix_all"); connect(fixButton, SIGNAL(buttonClicked()), this, SIGNAL(oneFix())); ButtonLabel *reExamineButton = new ButtonLabel; reExamineButton->setText("重新体检"); connect(reExamineButton, SIGNAL(labelClicked()), this, SIGNAL(reExamine())); QVBoxLayout *fixVLayout = new QVBoxLayout; fixVLayout->addWidget(fixButton); fixVLayout->addWidget(reExamineButton); fixWidget->setLayout(fixVLayout); StaticButton *reStaticButton = new StaticButton(":/main/btn_reexamine"); connect(reStaticButton, SIGNAL(buttonClicked()), this, SIGNAL(reExamine())); m_stackedWidget->addWidget(cancleButton); m_stackedWidget->addWidget(fixWidget); m_stackedWidget->addWidget(reStaticButton); }
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); }
void wxMessageDialog::DoSetCustomLabel(wxString& var, const ButtonLabel& label) { int stockId = label.GetStockId(); if ( stockId == wxID_NONE ) { wxMessageDialogBase::DoSetCustomLabel(var, label); var = wxConvertMnemonicsToGTK(var); } else // stock label { var = wxGetStockGtkID(stockId); } }
void MainBottomFirstWidget::initUI() { m_safeButton = new StaticButton(":/main/safe_check"); QLabel *safeLabel = new QLabel(QStringLiteral("查杀修复")); safeLabel->setObjectName("mainBottomLabel"); QVBoxLayout *safeLayout = new QVBoxLayout; safeLayout->addWidget(m_safeButton, 0, Qt::AlignCenter); safeLayout->addWidget(safeLabel, 0, Qt::AlignCenter); m_cleanButton = new StaticButton(":/main/clean"); QLabel *cleanLabel = new QLabel(QStringLiteral("电脑清理")); cleanLabel->setObjectName("mainBottomLabel"); QVBoxLayout *cleanLayout = new QVBoxLayout; cleanLayout->addWidget(m_cleanButton, 0, Qt::AlignCenter); cleanLayout->addWidget(cleanLabel, 0, Qt::AlignCenter); m_youhuaButton = new StaticButton(":/main/youhua"); QLabel *youhuaLabel = new QLabel(QStringLiteral("优化加速")); youhuaLabel->setObjectName("mainBottomLabel"); QVBoxLayout *youhuaLayout = new QVBoxLayout; youhuaLayout->addWidget(m_youhuaButton, 0, Qt::AlignCenter); youhuaLayout->addWidget(youhuaLabel, 0, Qt::AlignCenter); QHBoxLayout *staticLayout = new QHBoxLayout; staticLayout->addLayout(safeLayout); staticLayout->addLayout(cleanLayout); staticLayout->addLayout(youhuaLayout); staticLayout->setContentsMargins(10, 20, 10, 10); QLabel *routerTitle = new QLabel(QStringLiteral("路由器卫士")); QFont font = routerTitle->font(); font.setBold(true); font.setPixelSize(15); routerTitle->setFont(font); QLabel *routerDes = new QLabel(QStringLiteral("帮您免费升级为智能路由器")); QVBoxLayout *routerTextLayout = new QVBoxLayout; routerTextLayout->addWidget(routerTitle, 0, Qt::AlignRight); routerTextLayout->addWidget(routerDes, 0, Qt::AlignRight); routerTextLayout->setContentsMargins(10, 10, 5, 15); StaticButton *routerButton = new StaticButton(":/main/routerdefender"); QHBoxLayout *routerLayout = new QHBoxLayout; routerLayout->addLayout(routerTextLayout); routerLayout->addWidget(routerButton); QStringList advIconList, advNameList; advIconList << "360SoftManger" << "360JiShi" << "360MobileMgr" << "NetSpeed"; advNameList << QStringLiteral("软件管家") << QStringLiteral("人工服务") << QStringLiteral("手机助手") << QStringLiteral("宽带测速器") ; QHBoxLayout *advLayout = new QHBoxLayout; for(int i=0; i<advIconList.size(); i++) { BackgroundButton *backButton = new BackgroundButton; backButton->setIconsInfo(":/main/" + advIconList.at(i), ":/main/all_tool_bk", 1); backButton->setText(advNameList.at(i)); advLayout->addWidget(backButton); } m_advtoolMore = new StaticButton(":/main/advtool_more"); ButtonLabel *advLabel = new ButtonLabel; advLabel->setStyleSheet("QLabel{color:blue;}"); advLabel->setText(QStringLiteral("更多")); QVBoxLayout *moreLayout = new QVBoxLayout; moreLayout->addStretch(); moreLayout->addWidget(m_advtoolMore, 0, Qt::AlignCenter); moreLayout->addSpacing(5); moreLayout->addWidget(advLabel, 0, Qt::AlignCenter); moreLayout->addStretch(); advLayout->addLayout(moreLayout); QVBoxLayout *rightLayout = new QVBoxLayout; rightLayout->addLayout(routerLayout); rightLayout->addLayout(advLayout); QHBoxLayout *mainLayout = new QHBoxLayout; mainLayout->addLayout(staticLayout); mainLayout->addStretch(); mainLayout->addLayout(rightLayout); this->setLayout(mainLayout); }