#include <splashscreen.h>
Inheritance diagram for Splash:

Public Slots | |
| void | paint () |
Public Member Functions | |
| Splash () | |
| ~Splash () | |
| Splash (QString appSplash, QString appName, QString appVersion) | |
| ~Splash () | |
| void | mensaje (QString) |
| void | setBarraProgreso (int) |
Private Slots | |
| void | barraprogreso () |
Private Attributes | |
| QLabel * | l |
| QTextBrowser * | l2 |
| QProgressBar * | barra |
| QLabel * | m_label |
| QLabel * | m_label1 |
| QLabel * | l0 |
| QPixmap * | image0 |
Definition at line 21 of file splashscreen.h.
| Splash::Splash | ( | ) |
Definition at line 7 of file splashscreen.cpp.
References CONF_SPLASH, confpr, image0, l, l0, l2, paint(), and configuracion::valor().
00007 : QDialog( 0, "", true, WStyle_NoBorder |WStyle_Customize ) { 00008 // QPixmap image0( logofx ); 00009 QPixmap image0; 00010 image0.load(confpr->valor(CONF_SPLASH).c_str()); 00011 l = new QLabel( this ); 00012 l->setPixmap( image0 ); 00013 // fprintf(stderr,"ancho: %d, alto: %d\n", image0.width(), image0.height()); 00014 l->setGeometry ( 0, 0, image0.width(), image0.height() ); 00015 00016 // QVBoxLayout *vb = new QVBoxLayout(this); 00017 // this->addLayout( vb ); 00018 00019 00020 // Add Product name/Main message 00021 // if(mmsg != 0) { 00022 QLabel *l1 = new QLabel( this ); 00023 l1->setAlignment( AlignVCenter|AlignHCenter ); 00024 l1->setFont( QFont( "Arial", 20, QFont::Bold ) ); 00025 l1->setPaletteForegroundColor(QColor("#333388")); 00026 l1->setText( tr("BulmaGés") ); 00027 l1->setGeometry(10,10,150,25); 00028 l1->setBackgroundOrigin(QWidget::ParentOrigin); 00029 l1->setBackgroundPixmap(image0); 00030 00031 00032 QLabel *l0 = new QLabel( this ); 00033 l0->setPaletteForegroundColor(QColor("#FF0000")); 00034 l0->setAlignment( AlignVCenter ); 00035 l0->setFont( QFont( "Arial", 20, QFont::Bold ) ); 00036 l0->setText( tr("v 0.4.3") ); 00037 l0->setGeometry(100,35,150,25); 00038 l0->setBackgroundOrigin(QWidget::ParentOrigin); 00039 l0->setBackgroundPixmap(image0); 00040 00041 00042 QLabel *l21 = new QLabel( this ); 00043 l21->setAlignment( AlignVCenter ); 00044 l21->setFont( QFont( "helvetica", 7, QFont::Normal ) ); 00045 l21->setText( "" ); 00046 l21->setGeometry(0,image0.height()-38,image0.width(),58); 00047 l21->setPaletteForegroundColor(QColor("#000066")); 00048 l21->setPaletteBackgroundColor(QColor("#000000")); 00049 00050 l2 = new QTextBrowser(this); 00051 l2->setVScrollBarMode(QScrollView::AlwaysOff); 00052 l2->setAlignment( AlignBottom ); 00053 l2->setFont( QFont( "helvetica", 11, QFont::Normal ) ); 00054 l2->setText( tr("BULMAGÉS") ); 00055 l2->setGeometry(0,image0.height()-38,image0.width(),58); 00056 l2->setPaletteForegroundColor(QColor("#000066")); 00057 l2->setPaletteBackgroundColor(QColor("#DDDDDD")); 00058 00059 QTimer *timer = new QTimer(this); 00060 connect( timer, SIGNAL(timeout()), SLOT(close()) ); 00061 timer->start( 1000 ); //timer->start( 10000); 00062 00063 QTimer *timer1 = new QTimer(this); 00064 connect( timer1, SIGNAL(timeout()), SLOT(paint()) ); 00065 timer1->start( 150 ); //timer1->start( 1750); 00066 exec(); 00067 delete l1; 00068 }// end splash
| Splash::~Splash | ( | ) |
| Splash::Splash | ( | QString | appSplash, | |
| QString | appName, | |||
| QString | appVersion | |||
| ) |
| appSplash | ||
| appName | ||
| appVersion |
Se modifica la paleta para que utilize la imagen como fondo.
Centramos la ventana en la pantalla.
Poniendo el minimo y maximo a 0 hace el efecto especial.
Definition at line 34 of file splashscreen.cpp.
References _depura(), barra, FALSE, image0, l0, m_label, and m_label1.
00034 : QDialog(0, Qt::FramelessWindowHint) { 00035 _depura("Splash::Splash", 0); 00036 image0 = new QPixmap(); 00037 image0->load(appSplash); 00038 00040 QPalette p = this->palette(); 00041 p.setBrush(QPalette::Window, *image0); 00042 this->setPalette(p); 00043 00045 QDesktopWidget *pantalla = new QDesktopWidget(); 00046 setGeometry((pantalla->screenGeometry().width() / 2) - (image0->width() / 2), (pantalla->screenGeometry().height() / 2) - ((image0->height() + 58) / 2), image0->width(), image0->height()); 00047 delete pantalla; 00048 00049 l0 = new QLabel(this); 00050 l0->setTextFormat(Qt::RichText); 00051 l0->setGeometry(0, 0, image0->width(), image0->height()); 00052 l0->setAlignment(Qt::AlignTop); 00053 l0->setFont(QFont("Arial", 20, QFont::Bold)); 00054 l0->setText("<center><font size=+1 color=\"#a3ffa3\">" + appName + "</font> <font color=\"#0000ff\">" + appVersion + "</font></center>"); 00055 00056 m_label = new QLabel(this); 00057 m_label->setTextFormat(Qt::RichText); 00058 m_label->setGeometry(0, image0->height() - 80, image0->width(), 15); 00059 m_label->setAlignment(Qt::AlignTop); 00060 m_label->setFont(QFont("helvetica", 8, QFont::Bold)); 00061 m_label->show(); 00062 00063 00064 m_label1 = new QLabel(this); 00065 m_label1->setAlignment(Qt::AlignBottom); 00066 m_label1->setFont(QFont("helvetica", 9, QFont::Normal)); 00067 m_label1->setGeometry(0, image0->height() - 50, image0->width(), 50); 00068 00069 00070 00071 barra = new QProgressBar(this); 00072 barra->setTextVisible(FALSE); 00074 barra->setRange(0, 100); 00075 barra->setGeometry(0, image0->height() - 65, image0->width(), 15); 00076 QPalette pbarra = barra->palette(); 00077 QColor colorfondobarra = QColor("#000000"); 00078 colorfondobarra.setAlpha(100); 00079 pbarra.setBrush(QPalette::Base, colorfondobarra); 00080 barra->setPalette(pbarra); 00081 _depura("END Splash::Splash", 0); 00082 }
| Splash::~Splash | ( | ) |
| void Splash::paint | ( | ) | [slot] |
Definition at line 76 of file splashscreen.cpp.
Referenced by Splash().
00076 { 00077 static int a=0; 00078 static QString cad; 00079 QString mensajes[]={ 00080 tr("Comprobando nivel de combustible"), 00081 tr("Calibrando los lasers del lector de CD"), 00082 tr("Comprobando la disquetera y la Memoria Fisica"), 00083 tr("Induciendo energía quantica, entre su RAM y su ROM"), 00084 tr("Pequeños golpecitos de reajuste del HD"), 00085 tr("Probando la Velocidad el Ventilador de la CPU y su Frecuencia"), 00086 tr("Haciendo PING contra el servidor de la MetaBase"), 00087 tr("Violando a Segmento"), 00088 tr("Dejando tiempo libre al sistema"), 00089 tr("Sincronizando fases Alfa Beta"), 00090 tr("Flusheando Datos con vidas inteligentes superiores"), 00091 tr("Permutando las tablas de partición del sistema operativo"), 00092 tr("Crackeando BulmaGés")}; 00093 if (a) { 00094 cad = cad + "<FONT COLOR='#FF0000'>....... <B>OK</B></FONT><BR>"; 00095 }// end if 00096 cad= cad+" "+mensajes[a]; 00097 if(a >10) a=0; 00098 a++; 00099 l2->setText( cad ); 00100 l2->scrollBy(0,400); 00101 }
| void Splash::mensaje | ( | QString | mens | ) |
| mens |
Definition at line 103 of file splashscreen.cpp.
References _depura(), m_label, and m_label1.
Referenced by EmpresaTPV::createMainWindows(), Company::createMainWindows(), Empresa::createMainWindows(), and main().
00103 { 00104 _depura("Splash::mensaje", 0); 00105 _depura(mens, 0); 00106 static int a = 0; 00107 static QString cadant=""; 00108 QString cad = ""; 00109 QString cad1 = ""; 00110 if (a != 0) 00111 cad1 = "<FONT SIZE=\"-3\" COLOR='#FF0000'> ....... <B>OK</B></FONT><BR>"; 00112 cad = cad + "<FONT SIZE=\"-3\" COLOR='#000066'>" + mens + "</FONT>"; 00113 a++; 00114 m_label1->setText(cadant+cad1+cad); 00115 m_label1->repaint(); 00116 m_label->setText(mens); 00117 m_label->repaint(); 00118 repaint(); 00119 cadant = cad; 00120 _depura("END Splash::mensaje", 0); 00121 }
| void Splash::setBarraProgreso | ( | int | progreso | ) |
| progreso |
Definition at line 128 of file splashscreen.cpp.
References _depura(), and barra.
Referenced by EmpresaTPV::createMainWindows(), Company::createMainWindows(), Empresa::createMainWindows(), and main().
00128 { 00129 _depura("Splash::setBarraProgreso", 0); 00130 barra->setValue(progreso); 00131 _depura("END Splash::setBarraProgreso", 0); 00132 }
| void Splash::barraprogreso | ( | ) | [private, slot] |
Definition at line 138 of file splashscreen.cpp.
References _depura(), and barra.
00138 { 00139 _depura("Splash::barraprogreso", 0); 00140 if (barra->value() < 10) { 00141 barra->setValue(barra->value() + 1); 00142 } else { 00143 barra->setValue(0); 00144 } // end if 00145 _depura("END Splash::barraprogreso", 0); 00146 }
QTextBrowser* Splash::l2 [private] |
QProgressBar* Splash::barra [private] |
Definition at line 46 of file splashscreen.h.
Referenced by barraprogreso(), setBarraProgreso(), and Splash().
QLabel* Splash::m_label [private] |
QLabel * Splash::m_label1 [private] |
QLabel * Splash::l0 [private] |
QPixmap* Splash::image0 [private] |
1.5.1