]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/QSplashDialog.C
qt2 ert dialog
[lyx.git] / src / frontends / qt2 / QSplashDialog.C
1 /**
2  * \file QSplashDialog.C
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author Edwin Leuven
7  */
8
9 #include <config.h>
10
11 #include <qapplication.h>
12 #include <qtimer.h>
13 #include <qframe.h>
14 #include <qpixmap.h>
15
16 #include "version.h"
17 #include "support/filetools.h"
18 #include "support/lstrings.h"
19 #include "lyxrc.h"
20 #include "QSplashDialog.h" 
21
22 QSplashDialog::QSplashDialog(QWidget * parent, const char * name, WFlags fl, bool modal)
23          : QFrame(parent, name, fl, modal)
24 {
25         string const banner_file = LibFileSearch("images", "banner", "xpm");
26         if (banner_file.empty())
27                 return;
28         
29         QPixmap const pm(tostr(banner_file).c_str());
30         int const w = pm.width();
31         int const h = pm.height();
32         
33         setBackgroundPixmap(pm);
34         setLineWidth(0);
35         setGeometry(QApplication::desktop()->width()/2 - w/2,
36                          QApplication::desktop()->height()/2 - h/2,
37                          w, h);
38         
39         QTimer::singleShot(5*1000, this, SLOT(hide()));
40 }
41
42  
43 QSplashDialog::~QSplashDialog()
44 {
45 }
46
47
48 void QSplashDialog::mousePressEvent( QMouseEvent * )
49 {
50         hide();
51 }