kstartuplogo.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "kstartuplogo.h"
00016 #include <kapplication.h>
00017 #include <kstandarddirs.h>
00018 #include <qtimer.h>
00019
00020 KStartupLogo::KStartupLogo(QWidget * parent, const char *name)
00021 : QWidget(parent,name, Qt::WStyle_NoBorder | Qt::WStyle_Customize | Qt::WDestructiveClose )
00022 ,m_bReadyToHide(false) {
00023
00024 KStandardDirs * dirs = KGlobal::dirs();
00025 QString dataDir = dirs -> findResourceDir("data", "umbrello/pics/object.png");
00026 dataDir += "/umbrello/pics/";
00027 QPixmap pm(dataDir + "startlogo.png");
00028 setBackgroundPixmap(pm);
00029 setGeometry(QApplication::desktop()->width()/2-pm.width()/2,
00030 QApplication::desktop()->height()/2-pm.height()/2,
00031 pm.width(),pm.height());
00032
00033 timer = new QTimer(this);
00034 connect( timer, SIGNAL(timeout()), this, SLOT(timerDone()) );
00035 timer->start(2000, true);
00036 }
00037
00038 KStartupLogo::~KStartupLogo() {
00039 delete timer;
00040 }
00041
00042 void KStartupLogo::mousePressEvent( QMouseEvent*) {
00043
00044 if (m_bReadyToHide)
00045 hide();
00046 }
00047
00048 void KStartupLogo::timerDone() {
00049 this->hide();
00050 }
00051
00052 void KStartupLogo::setHideEnabled(bool bEnabled) {
00053 m_bReadyToHide = bEnabled;
00054 }
00055 #include "kstartuplogo.moc"
This file is part of the documentation for umbrello Version 3.1.0.