All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SplashScreenManager.cpp
Go to the documentation of this file.
1 /* Copyright (C) 2008 National Institute For Space Research (INPE) - Brazil.
2 
3  This file is part of the TerraLib - a Framework for building GIS enabled applications.
4 
5  TerraLib is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License,
8  or (at your option) any later version.
9 
10  TerraLib is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with TerraLib. See COPYING. If not, write to
17  TerraLib Team at <terralib-team@terralib.org>.
18  */
19 
20 /*!
21  \file terralib/qt/af/SplashScreenManager.cpp
22 
23  \brief A singleton for holding he application splash screen.
24 */
25 
26 // TerraLib
27 #include "SplashScreenManager.h"
28 
29 // Qt
30 #include <QtCore/QCoreApplication>
31 
33 {
34  if(m_sc == 0)
35  return;
36 
37  m_sc->showMessage(message, m_msgAlignment, m_msgColor);
38 
39  QCoreApplication::processEvents();
40 }
41 
42 void te::qt::af::SplashScreenManager::set(QSplashScreen* impl, int alignment, const QColor& color)
43 {
44  m_sc = impl;
45  m_msgAlignment = alignment;
46  m_msgColor = color;
47 }
48 
50 {
51  if(m_sc != 0)
52  m_sc->setPixmap(pix);
53 }
54 
56 {
57  if(m_sc != 0 && m_sc->isVisible())
58  m_sc->hide();
59 }
60 
62  : m_sc(0),
63  m_msgAlignment(Qt::AlignLeft),
64  m_msgColor(Qt::black)
65 {
66 }
67 
69 {
70 }
71 
void close()
Closes the splash screen.
QColor m_msgColor
The color used to draw the message text.
A singleton for holding he application splash screen.
SplashScreenManager()
It initializes the singleton.
void showMessage(const QString &message)
This will cause the text to be drawn on the splash screen and a call to Application::processEvents() ...
int m_msgAlignment
The alignment used to draw the message text.
void set(QSplashScreen *impl, int alignment=Qt::AlignLeft, const QColor &color=Qt::black)
It sets the splash screen to be used during the application startup.
void setLogo(const QPixmap &pix)
Updates the image to be presented on splash screen.
QSplashScreen * m_sc
A reference to the splash screen.