QT :: Qwizard 用法

來源:互聯網
上載者:User
#include<QApplication>#include<QWizard>#include<QWizardPage>#include<QLabel>#include<QVBoxLayout>#include<QPixmap>/*QWizard::WatermarkPixmap0The tall pixmap on the left side of a ClassicStyle or ModernStyle pageQWizard::LogoPixmap         1The small pixmap on the right side of a ClassicStyle or ModernStyle page headerQWizard::BannerPixmap       2The pixmap that occupies the background of a ModernStyle page headerQWizard::BackgroundPixmap3The pixmap that occupies the background of a MacStyle wizard*/QWizardPage* createOneWizard(){    QWizardPage* page = new QWizardPage;    page->setWindowTitle("The First Step");   // page->setPixmap(QWizard::WatermarkPixmap, QPixmap(":/new/prefix1/0001.jpg"));    QLabel* picLabel = new QLabel;    picLabel->setPixmap(QPixmap(":/new/prefix1/0001.jpg"));    QLabel* label = new QLabel("<h1><font color = red>this is the first Pictures</font></h1>");    label->resize(40,220);    QVBoxLayout* layout = new QVBoxLayout;    layout->addWidget(label);    layout->addWidget(picLabel);    page->setLayout(layout);    return page;}QWizardPage* createTwoWizard(){    QWizardPage* page = new QWizardPage;    page->setWindowTitle("The Second Step");    //page->setPixmap(QWizard::WatermarkPixmap,QPixmap(":/new/prefix1/0002.jpg"));    QLabel* picLabel = new QLabel;    picLabel->setPixmap(QPixmap(":/new/prefix1/0002.jpg"));    QLabel* label = new QLabel("<h1><font color = red>this is the second Pictures</font></h1>");    label->resize(40,220);    QVBoxLayout* layout = new QVBoxLayout;    layout->addWidget(label);    layout->addWidget(picLabel);    page->setLayout(layout);    return page;}QWizardPage* createThreeWizard(){    QWizardPage* page = new QWizardPage;    page->setWindowTitle("The Third Step");   // page->setPixmap(QWizard::WatermarkPixmap,QPixmap(":/new/prefix1/0003.jpg"));    QLabel* picLabel = new QLabel;    picLabel->setPixmap(QPixmap(":/new/prefix1/0003.jpg"));    QLabel* label = new QLabel("<h1><font color = red>this is the third Pictures</font></h1>");    label->resize(40,220);    QVBoxLayout* layout = new QVBoxLayout;    layout->addWidget(label);    layout->addWidget(picLabel);    page->setLayout(layout);    return page;}int main(int argc, char *argv[]){    QApplication a(argc, argv);    QWizard* wizard = new QWizard;    wizard->setWindowTitle("QWizard");    wizard->resize(240,320);    wizard->addPage(createOneWizard());    wizard->addPage(createTwoWizard());    wizard->addPage(createThreeWizard());    wizard->show();        return a.exec();}

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.