按照书上说的,在主函数中这样子写
#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’在此作用域中尚未声明
各位高手如何解决这个问题。谢谢拉!