28 #include "TerraViewConfig.h"
38 #include <QtCore/QResource>
39 #include <QtGui/QApplication>
40 #include <QtGui/QSplashScreen>
41 #include <QtGui/QMessageBox>
45 int main(
int argc,
char** argv)
47 QApplication app(argc, argv);
49 setlocale(LC_ALL,
"C");
53 int waitVal = EXIT_FAILURE;
57 const char* te_env = getenv(
"TERRALIB_DIR");
61 QMessageBox::critical(0, QObject::tr(
"Execution Failure"), QObject::tr(
"Environment variable \"TERRALIB_DIR\" not found.\nTry to set it before run the application."));
62 throw std::exception();
65 std::string splash_pix(te_env);
66 splash_pix +=
"/resources/images/png/terraview-splashscreen.png";
68 QPixmap pixmap(splash_pix.c_str());
70 QSplashScreen* splash(
new QSplashScreen(pixmap));
72 splash->setAttribute(Qt::WA_DeleteOnClose,
true);
74 splash->setStyleSheet(
"QWidget { font-size: 12px; font-weight: bold }");
82 std::string appPath = qApp->applicationDirPath().toStdString();
84 tview.
init(appPath+
"/config.xml");
86 splash->finish(&tview);
88 tview.showMaximized();
94 catch(
const std::exception& )
virtual void resetState()
A singleton for holding he application splash screen.
int main(int argc, char *argv[])
static SplashScreenManager & getInstance()
It returns a reference to the singleton instance.
The main class of TerraView.
The main class of TerraView.