Commit cd490f94 authored by ekam's avatar ekam

Change splash from QtSplashScreen to QtWidget

parent 3c61b24a
......@@ -26,10 +26,10 @@
#include <QPainter>
#include <QRadialGradient>
SplashScreen::SplashScreen(Qt::WindowFlags f, const QPixmap &pixmap) :
QSplashScreen(pixmap, f)
SplashScreen::SplashScreen(Qt::WindowFlags f) :
QWidget(0, f), curAlignment(0)
{
setAutoFillBackground(true);
// setAutoFillBackground(true);
// set reference point, paddings
int paddingLeft = 14;
......@@ -49,11 +49,10 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const QPixmap &pixmap) :
QString font = "Arial";
// load the bitmap for writing some text over it
QPixmap newPixmap;
newPixmap = QPixmap(":/images/splash");
// QPixmap newPixmap;
pixmap = QPixmap(":/images/splash");
QPainter pixPaint(&newPixmap);
QPainter pixPaint(&pixmap);
pixPaint.setPen(QColor(100,100,100));
// check font size and drawing with
......@@ -90,7 +89,12 @@ SplashScreen::SplashScreen(Qt::WindowFlags f, const QPixmap &pixmap) :
pixPaint.end();
this->setPixmap(newPixmap);
// this->setPixmap(newPixmap);
QRect r(QPoint(), pixmap.size());
resize(r.size());
setFixedSize(r.size());
move(QApplication::desktop()->screenGeometry().center() - r.center());
subscribeToCoreSignals();
}
......
......@@ -16,12 +16,12 @@ class NetworkStyle;
* can take a long time, and in that case a progress window that cannot be
* moved around and minimized has turned out to be frustrating to the user.
*/
class SplashScreen : public QSplashScreen/* QWidget */
class SplashScreen : public QWidget
{
Q_OBJECT
public:
explicit SplashScreen(Qt::WindowFlags f, const QPixmap &pixmap);
explicit SplashScreen(Qt::WindowFlags f);
~SplashScreen();
protected:
......
......@@ -409,9 +409,10 @@ void StraksApplication::createWindow(const NetworkStyle *networkStyle)
void StraksApplication::createSplashScreen(/* const NetworkStyle *networkStyle */)
{
SplashScreen *splash = new SplashScreen(0, QPixmap());
SplashScreen *splash = new SplashScreen(0);
// We don't hold a direct pointer to the splash screen after creation, but the splash
// screen will take care of deleting itself when slotFinish happens.
splash->setWindowFlags(Qt::CustomizeWindowHint | Qt::WindowTitleHint);
splash->show();
connect(this, SIGNAL(splashFinished(QWidget*)), splash, SLOT(slotFinish(QWidget*)));
connect(this, SIGNAL(requestedShutdown()), splash, SLOT(close()));
......
Markdown is supported
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