QT :: Qwizard 用法

系统 1780 0
    #include<QApplication>
#include<QWizard>
#include<QWizardPage>
#include<QLabel>
#include<QVBoxLayout>
#include<QPixmap>
/*
QWizard::WatermarkPixmap	0	The tall pixmap on the left side of a ClassicStyle or ModernStyle page
QWizard::LogoPixmap         1	The small pixmap on the right side of a ClassicStyle or ModernStyle page header
QWizard::BannerPixmap       2	The pixmap that occupies the background of a ModernStyle page header
QWizard::BackgroundPixmap	3	The 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();
}

  

QT :: Qwizard 用法

QT :: Qwizard 用法

QT :: Qwizard 用法

QT :: Qwizard 用法


更多文章、技术交流、商务合作、联系博主

微信扫码或搜索:z360901061

微信扫一扫加我为好友

QQ号联系: 360901061

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描下面二维码支持博主2元、5元、10元、20元等您想捐的金额吧,狠狠点击下面给点支持吧,站长非常感激您!手机微信长按不能支付解决办法:请将微信支付二维码保存到相册,切换到微信,然后点击微信右上角扫一扫功能,选择支付二维码完成支付。

【本文对您有帮助就好】

您的支持是博主写作最大的动力,如果您喜欢我的文章,感觉我的文章对您有帮助,请用微信扫描上面二维码支持博主2元、5元、10元、自定义金额等您想捐的金额吧,站长会非常 感谢您的哦!!!

发表我的评论
最新评论 总共0条评论