20 #include <QApplication> 21 #include <QDesktopWidget> 30 #include <KLocalizedString> 32 #include <QStandardPaths> 43 :QFrame(Q_NULLPTR, Qt::FramelessWindowHint | Qt::WindowStaysOnTopHint),
45 m_pixmap(QStandardPaths::locate(QStandardPaths::DataLocation, PNGFile)),
56 const KAboutData about_data = KAboutData::applicationData();
57 QString version = i18nc(
"%1=Version number",
"v%1", about_data.version());
60 m_font.setStyleHint(QFont::Decorative);
61 m_font.setWeight(QFont::Black);
65 QRect
rect = fm.boundingRect(version);
69 const int th = rect.height();
70 const int tw = rect.width();
71 const int x = w - 10 - tw;
72 const int y = h - 10 - th;
74 const QBrush brush(palette().
background().color());
80 tw + 2 * r, th + (2 * r),
81 (200 * r) / th, (200 * r) / th
85 p.setPen(palette().buttonText().color());
86 p.drawText(x, y, tw, th, Qt::AlignCenter, version);
91 rect = QRect(QPoint(),
m_pixmap.size());
93 move(QApplication::desktop()->screenGeometry().center() - rect.center());
102 Q_ASSERT(this->thread() == QThread::currentThread());
103 Q_ASSERT(this->thread() == qApp->thread());
120 QApplication::processEvents(QEventLoop::AllEvents);
134 const int border = 5;
138 rect.width() - (2 * border),
139 rect.height() - (2 * border)
145 p.setPen(palette().buttonText().color());
146 p.drawText(rect, Qt::AlignLeft | Qt::AlignTop,
m_message);
Splash(const QString &PNGFile)
virtual ~Splash() Q_DECL_OVERRIDE
static void showMessage(const QString &message)
static QPointer< Kwave::Splash > m_splash
static const char * background[]
virtual void mousePressEvent(QMouseEvent *) Q_DECL_OVERRIDE
virtual void paintEvent(QPaintEvent *e) Q_DECL_OVERRIDE
static double rect(double param)