I'm looking for a way to get the currAlign and the currStatus
//painter->drawText(r, d_func()->currAlign, d_func()->currStatus);
and also to make the hide on mousePressEvent work.
#ifndef CUSTOMSPLASHSCREEN_H
#define CUSTOMSPLASHSCREEN_H
#include <QSplashScreen>
#include <QPainter>
class customSplashScreen
{
public:
customSplashScreen(const QPixmap& pixmap);
~customSplashScreen();
virtual void drawContents
(QPainter *painter
);
};
#endif // CUSTOMSPLASHSCREEN_H
#ifndef CUSTOMSPLASHSCREEN_H
#define CUSTOMSPLASHSCREEN_H
#include <QSplashScreen>
#include <QPainter>
class customSplashScreen
:public QSplashScreen
{
public:
customSplashScreen(const QPixmap& pixmap);
~customSplashScreen();
virtual void drawContents(QPainter *painter);
virtual void mousePressEvent(QMouseEvent *);
};
#endif // CUSTOMSPLASHSCREEN_H
To copy to clipboard, switch view to plain text mode
#include "customSplashScreen.h"
customSplashScreen::customSplashScreen(const QPixmap& pixmap)
{
};
customSplashScreen::~customSplashScreen()
{
};
void customSplashScreen
::drawContents(QPainter *painter
) {
painter->setPen(Qt::black);
r.setRect( 170, 397, 245, 14 );
painter->drawText(r, "Loading something message...");
};
void customSplashScreen
::mousePressEvent(QMouseEvent *) {
this->hide();
};
#include "customSplashScreen.h"
customSplashScreen::customSplashScreen(const QPixmap& pixmap)
{
QSplashScreen::setPixmap(pixmap);
};
customSplashScreen::~customSplashScreen()
{
};
void customSplashScreen::drawContents(QPainter *painter)
{
QPixmap textPix = QSplashScreen::pixmap();
painter->setPen(Qt::black);
QRect r = rect();
r.setRect( 170, 397, 245, 14 );
painter->drawText(r, "Loading something message...");
};
void customSplashScreen::mousePressEvent(QMouseEvent *)
{
this->hide();
};
To copy to clipboard, switch view to plain text mode
Bookmarks