Commit 936db127 authored by Jean-Baptiste Mardelle's avatar Jean-Baptiste Mardelle
Browse files

Fix startup warning cannot destroy paint device

parent 8d9869d2
......@@ -13,7 +13,7 @@ Splash::Splash()
: QSplashScreen()
, m_progress(0)
{
QPixmap pixmap(":/pics/splash-background.png");
m_pixmap = QPixmap(":/pics/splash-background.png");
// Set style for progressbar...
m_pbStyle.initFrom(this);
......@@ -23,17 +23,17 @@ Splash::Splash()
m_pbStyle.maximum = 100;
m_pbStyle.progress = 0;
m_pbStyle.invertedAppearance = false;
m_pbStyle.rect = QRect(4, pixmap.height() - 24, pixmap.width() / 2, 20); // Where is it.
m_pbStyle.rect = QRect(4, m_pixmap.height() - 24, m_pixmap.width() / 2, 20); // Where is it.
// Add KDE branding to pixmap
QPainter *paint = new QPainter(&pixmap);
QPainter *paint = new QPainter(&m_pixmap);
paint->setPen(Qt::white);
QPixmap kde(":/pics/kde-logo.png");
const int logoSize = 32;
QPoint pos(12, 12);
paint->drawPixmap(pos.x(), pos.y(), logoSize, logoSize, kde);
paint->drawText(pos.x() + logoSize, pos.y() + (logoSize / 2) + paint->fontMetrics().strikeOutPos(), i18n("Made by KDE"));
setPixmap(pixmap);
setPixmap(m_pixmap);
}
void Splash::showProgressMessage(const QString &message, int progress, int max)
......
......@@ -5,6 +5,7 @@
#pragma once
#include <QPixmap>
#include <QSplashScreen>
#include <QStyleOptionProgressBar>
......@@ -21,6 +22,7 @@ public slots:
private:
int m_progress;
QPixmap m_pixmap;
QStyleOptionProgressBar m_pbStyle;
protected:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment