mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
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:
parent
ba77db4560
commit
d738ab9af3
@ -76,6 +76,8 @@ qgis_SOURCES = qgisapp.cpp \
|
|||||||
qgssymbol.h\
|
qgssymbol.h\
|
||||||
qgsmapserverexport.cpp \
|
qgsmapserverexport.cpp \
|
||||||
qgsmapserverexport.h \
|
qgsmapserverexport.h \
|
||||||
|
splashscreen.h \
|
||||||
|
splashscreen.cpp \
|
||||||
qtiffio.cpp \
|
qtiffio.cpp \
|
||||||
qtiffio.h \
|
qtiffio.h \
|
||||||
$(qgis_UI)\
|
$(qgis_UI)\
|
||||||
@ -104,7 +106,8 @@ qgis_MOC = qgisappbase.moc.cpp \
|
|||||||
qgsshapefilelayer.moc.cpp \
|
qgsshapefilelayer.moc.cpp \
|
||||||
qgsmapserverexportbase.moc.cpp \
|
qgsmapserverexportbase.moc.cpp \
|
||||||
qgsmapserverexport.moc.cpp \
|
qgsmapserverexport.moc.cpp \
|
||||||
qgshelpviewer.moc.cpp
|
qgshelpviewer.moc.cpp \
|
||||||
|
splashscreen.moc.cpp
|
||||||
qgis_UI = qgisappbase.h\
|
qgis_UI = qgisappbase.h\
|
||||||
qgisappbase.cpp\
|
qgisappbase.cpp\
|
||||||
qgslegenditembase.h\
|
qgslegenditembase.h\
|
||||||
|
14
src/main.cpp
14
src/main.cpp
@ -21,6 +21,8 @@
|
|||||||
#include <qtextcodec.h>
|
#include <qtextcodec.h>
|
||||||
#include <qtranslator.h>
|
#include <qtranslator.h>
|
||||||
#include <qstyle.h>
|
#include <qstyle.h>
|
||||||
|
#include <qpixmap.h>
|
||||||
|
#include <splashscreen.h>
|
||||||
//#include "qgis.h"
|
//#include "qgis.h"
|
||||||
#include "qgisapp.h"
|
#include "qgisapp.h"
|
||||||
|
|
||||||
@ -29,6 +31,12 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
|
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
//
|
||||||
|
// Set up the splash screen
|
||||||
|
//
|
||||||
|
SplashScreen *mySplash = new SplashScreen( );
|
||||||
|
mySplash->setStatus("Loading QGis...");
|
||||||
|
|
||||||
// a.setFont(QFont("helvetica", 11));
|
// a.setFont(QFont("helvetica", 11));
|
||||||
QTranslator tor(0);
|
QTranslator tor(0);
|
||||||
// set the location where your .qm files are in load() below as the last parameter instead of "."
|
// 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();
|
qgis->show();
|
||||||
a.connect(&a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()));
|
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();
|
int result = a.exec();
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
33062
src/splashscreen.cpp
Normal file
33062
src/splashscreen.cpp
Normal file
File diff suppressed because it is too large
Load Diff
46
src/splashscreen.h
Normal file
46
src/splashscreen.h
Normal 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
|
Loading…
x
Reference in New Issue
Block a user