• 6845阅读
  • 4回复

(c++ GUI Qt 4编程)第3章58页 启动程序画面问题 [复制链接]

上一主题 下一主题
离线weitaotao110
 

只看楼主 倒序阅读 楼主  发表于: 2009-10-16
按照书上说的,在主函数中这样子写
#include <QApplication>
#include <QObject>
#include <QSplashScreen>

#include "mainwindow.h"

int main(int argc, char *argv[])
{

    QApplication app(argc, argv);
    //添加程序启动的画面
    QSplashScreen *splash = new QSplashScreen;
    splash->setPixmap(QPixmap(":/image/splash.png"));
    splash->show();
    Qt::Alignment toRight = Qt::AlignRight|Qt::AlignTop;
    splash->showMessage(QObject::tr("Setting up the main window..."),
                        toRight,Qt::white);


    MainWindow mainWin;
    splash->showMessage(QObject::tr("Loading modules..."));
   loadModules();

    splash->showMessage(QObject::tr("Establishing connections..."),
                        toRight,Qt::white);
    establishConnections();

    mainWin.show();
    splash->finish(&mainWin);
    delete splash;
    return app.exec();
}

编译出现问题:
main.cpp:22: 错误: ‘loadModules’在此作用域中尚未声明
main.cpp:26: 错误: ‘establishConnections’在此作用域中尚未声明

各位高手如何解决这个问题。谢谢拉!
My blog: www.hacktao.com
走好每一天!
离线weitaotao110

只看该作者 1楼 发表于: 2009-10-16
自己顶!
My blog: www.hacktao.com
走好每一天!
离线finder
只看该作者 2楼 发表于: 2009-10-16
这两个函数并没有实现,你需要注释掉这两个函数,或者是实现它们
离线似水无华
只看该作者 3楼 发表于: 2009-11-01
这个启动画面不错    能不能给启动画面定个时啊   不如说让它一分钟以后切换到工作画面?
离线deng560
只看该作者 4楼 发表于: 2009-12-15
可以加上QTest  Qwait(),里面是ms级别的。延时3000,你就会看到效果。而且还可以在上面加上进度条哦
wo
快速回复
限100 字节
 
上一个 下一个