Added a splashscreen to on application startup.

git-svn-id: http://svn.osgeo.org/qgis/trunk@448 c8812cc2-4d05-0410-92ff-de0c093fc19c
This commit is contained in:
timlinux 2004-01-10 02:58:47 +00:00
parent ba77db4560
commit d738ab9af3
4 changed files with 33125 additions and 2 deletions

View File

@ -76,6 +76,8 @@ qgis_SOURCES = qgisapp.cpp \
qgssymbol.h\
qgsmapserverexport.cpp \
qgsmapserverexport.h \
splashscreen.h \
splashscreen.cpp \
qtiffio.cpp \
qtiffio.h \
$(qgis_UI)\
@ -104,7 +106,8 @@ qgis_MOC = qgisappbase.moc.cpp \
qgsshapefilelayer.moc.cpp \
qgsmapserverexportbase.moc.cpp \
qgsmapserverexport.moc.cpp \
qgshelpviewer.moc.cpp
qgshelpviewer.moc.cpp \
splashscreen.moc.cpp
qgis_UI = qgisappbase.h\
qgisappbase.cpp\
qgslegenditembase.h\

View File

@ -21,6 +21,8 @@
#include <qtextcodec.h>
#include <qtranslator.h>
#include <qstyle.h>
#include <qpixmap.h>
#include <splashscreen.h>
//#include "qgis.h"
#include "qgisapp.h"
@ -29,6 +31,12 @@ int main(int argc, char *argv[])
QApplication a(argc, argv);
//
// Set up the splash screen
//
SplashScreen *mySplash = new SplashScreen( );
mySplash->setStatus("Loading QGis...");
// a.setFont(QFont("helvetica", 11));
QTranslator tor(0);
// set the location where your .qm files are in load() below as the last parameter instead of "."
@ -45,7 +53,11 @@ int main(int argc, char *argv[])
qgis->show();
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
mySplash->finish( qgis );
delete mySplash;
//
//turn control over to the main application loop...
//
int result = a.exec();
return result;

33062
src/splashscreen.cpp Normal file

File diff suppressed because it is too large Load Diff

46
src/splashscreen.h Normal file
View File

@ -0,0 +1,46 @@
/***************************************************************************
splashscreen.h - description
-------------------
begin : Sat May 17 2003
copyright : (C) 2003 by Tim Sutton
email : tim@linfiniti.com
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* Based on an example by Trolltech *
***************************************************************************/
#ifndef SPLASHSCREEN_H
#define SPLASHSCREEN_H
#include <qpixmap.h>
#include <qwidget.h>
/**A splash screen to show on application startup. Based on code found at: http://doc.trolltech.com/qq/qq04-splashscreen.html
*@author Tim Sutton
*/
class SplashScreen : public QWidget
{
Q_OBJECT
public:
SplashScreen();
void setStatus( const QString &message, int alignment = AlignLeft, const QColor &color = black );
void finish( QWidget *mainWin );
void repaint();
protected:
void mousePressEvent( QMouseEvent * );
private:
QPixmap image0;
};
#endif