void ConnectFriendWizard::updateStylesheet() { /* add stylesheet to title */ QList<int> ids = pageIds(); for (QList<int>::iterator pageIt = ids.begin(); pageIt != ids.end(); ++pageIt) { QWizardPage *p = page(*pageIt); QString title; QMap<QWizardPage*, QString>::iterator it = mTitleString.find(p); if (it == mTitleString.end()) { /* Save title string */ title = p->title(); mTitleString[p] = title; } else { title = it.value(); } QString stylesheet = "<span style=\""; if (mTitleFontSize) { stylesheet += QString("font-size:%1pt; ").arg(mTitleFontSize); } if (mTitleFontWeight) { stylesheet += QString("font-weight:%1; ").arg(mTitleFontWeight); } if (!mTitleColor.isEmpty()) { stylesheet += QString("color:%1; ").arg(mTitleColor); } stylesheet += QString("\">%1</span>").arg(title); p->setTitle(stylesheet); } }
ConnectFriendWizard::ConnectFriendWizard(QWidget *parent) : QWizard(parent), ui(new Ui::ConnectFriendWizard) { ui->setupUi(this); /* add stylesheet to title */ QList<int> ids = pageIds(); for (QList<int>::iterator it = ids.begin(); it != ids.end(); ++it) { QWizardPage *p = page(*it); p->setTitle(QString("<span style=\"font-size:16pt; font-weight:500; color:white;\">%1</span>").arg(p->title())); } // this define comes from Qt example. I don't have mac, so it wasn't tested #ifndef Q_WS_MAC setWizardStyle(ModernStyle); #endif setStartId(Page_Intro); // at this moment I don't know, what information should be in help // setOption(HaveHelpButton, true); // connect(this, SIGNAL(helpRequested()), this, SLOT(showHelp())); setPixmap(QWizard::LogoPixmap, QPixmap(":/images/connect/connectFriendLogo.png")); // we have no good pictures for watermarks // setPixmap(QWizard::WatermarkPixmap, QPixmap(":/images/connectFriendWatermark.png")); setPixmap(QWizard::BannerPixmap, QPixmap(":/images/connect/connectFriendBanner1.png")); /* register global fields */ ui->ErrorMessagePage->registerField("errorMessage", ui->messageLabel, "text"); /* disable not used pages */ ui->foffRadioButton->hide(); ui->rsidRadioButton->hide(); connect(ui->acceptNoSignGPGCheckBox,SIGNAL(toggled(bool)), ui->optionsFrame,SLOT(setEnabled(bool))) ; connect(ui->addKeyToKeyring_CB,SIGNAL(toggled(bool)), ui->acceptNoSignGPGCheckBox,SLOT(setChecked(bool))) ; }