千月星跡

アイをも求めて彷徨っている孤独なヒーロー

last_impressionID:Last_Impression
10796次访问,排名9784好友0人,关注者2
Last_Impression的文章
原创 49 篇
翻译 3 篇
转载 76 篇
评论 1 篇
最近评论
mohroq:wow gold,
文章分类
收藏
    相册
    存档
    订阅我的博客
    XML聚合  FeedSky
    订阅到鲜果
    订阅到Google
    订阅到抓虾
    订阅到BlogLines
    订阅到Yahoo
    订阅到GouGou
    订阅到飞鸽
    订阅到Rojo
    订阅到newsgator
    订阅到netvibes

    转载 (转)3.8启动画面(Splash Screens)收藏

    新一篇: (转)4.1中央控件(The Central Widget) | 旧一篇: (转)3.7多文档(Multiple Documents)

    许多应用程序在启动时显示一个画面。在程序启动很慢时,程序员用这种方法可以让启动时间感觉不那么长,还有用这个画面满足市场的一些要求。给Qt应用程序加一个启动画面很简单,需要使用的类是QSplashScreen。
    在窗口没有显示之前,QSplashScreen显示一个图片,他还可以在图片上显示文字信息提示用户当前程序初始化的进度。一般情况下,启动画面代码放在main()函数中,加在QApplication::exec()调用之前。
    下面的一个程序的main()函数使用QSplashScreen显示一个启动画面,同时显示加载的模块信息和网络连接情况。
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
        QSplashScreen *splash = new QSplashScreen;
        splash->setPixmap(QPixmap(":/images/splash.png"));
        splash->show();
        Qt::Alignment topRight = Qt::AlignRight | Qt::AlignTop;
        splash->showMessage(QObject::tr("Setting up the main window..."),
                            topRight, Qt::white);
        MainWindow mainWin;
        splash->showMessage(QObject::tr("Loading modules..."),
                            topRight, Qt::white);
        loadModules();
        splash->showMessage(QObject::tr("Establishing connections..."),
                            topRight, Qt::white);
        establishConnections();
        mainWin.show();
        splash->finish(&mainWin);
        delete splash;
        return app.exec();
    }
    Spreadsheet程序的用户界面部分我们已经完成了。在下一章中我们将会实现表格的核心功能

    发表于 @ 2008年05月06日 21:12:48|评论(loading...)|编辑

    新一篇: (转)4.1中央控件(The Central Widget) | 旧一篇: (转)3.7多文档(Multiple Documents)

    评论:没有评论。

    发表评论  


    登录
    Csdn Blog version 3.1a
    Copyright © Last_Impression