]> git.lyx.org Git - lyx.git/blob - src/frontends/qt2/FormSplashImpl.C
remove CXX_WORKING_NAMESPACES
[lyx.git] / src / frontends / qt2 / FormSplashImpl.C
1 /**
2  * \file FormSplashBase.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 "FormSplashImpl.h"
17 #include "version.h"
18 #include "support/filetools.h"
19 #include "lyxrc.h"
20
21 FormSplashBase::FormSplashBase( QWidget* parent,  const char* name, WFlags fl, bool modal )
22     : QFrame( parent, name, fl, modal)
23 {
24    string banner_file = LibFileSearch("images", "banner", "xpm");
25    if (banner_file.empty())
26      return;
27    
28    QPixmap pm(tostr(banner_file).c_str());
29    int w = pm.width();
30    int h = pm.height();
31    
32    setBackgroundPixmap(pm);
33    setLineWidth(0);
34    setGeometry(QApplication::desktop()->width ()/2-w/2,
35                QApplication::desktop()->height()/2-h/2,
36                w, h );
37    
38    QTimer::singleShot( 5*1000, this, SLOT(hide()) );
39 }
40
41 FormSplashBase::~FormSplashBase()
42 {
43 }
44
45
46 void FormSplashBase::mousePressEvent( QMouseEvent * e)
47 {
48    hide();
49 }
50
51
52