class EoF_gameSplashScreen:public QSplashScreen{private: QPixmap *pixmap; QColor backgroung_color,text_color;public: EoF_gameSplashScreen(QPixmap *pix):QSplashScreen(*pix),pixmap(pix){} void show_bottom_text(const QString &text) { showMessage(text,Qt::AlignCenter | Qt::AlignBottom,text_color); } void set_colors(QColor bg,QColor text) { backgroung_color = bg; text_color = text; }};
EoF_gameSplashScreen splash(&splash_pic); splash.set_colors(Qt::black,Qt::white); splash.showFullScreen(); splash.show_bottom_text("test"); splash.finish(this);
class EoF_gameSplashScreen:public QSplashScreen{private: QColor text_color; QSplashScreen picture;public: EoF_gameSplashScreen(QPixmap pix,QColor bg,QColor text):QSplashScreen(pix) { picture.setPixmap(pix); text_color =text; QPixmap bgpix(1,1); QPainter p; p.begin(&pix); p.fillRect(0,0,1,1,bg); p.end(); setPixmap(bgpix); QPalette Pal(palette()); // set black background Pal.setColor(QPalette::Background, bg); setAutoFillBackground(true); setPalette(Pal); show(); picture.setParent(this); } void show_bottom_text(const QString &text) { showMessage(text,Qt::AlignCenter | Qt::AlignBottom,text_color); } void set_colors(QColor bg,QColor text) { text_color = text; QPalette Pal(palette()); // set black background Pal.setColor(QPalette::Background, bg); setAutoFillBackground(true); setPalette(Pal); show(); } void show() { showFullScreen(); picture.show(); } void stop(QWidget *w) { picture.finish(w); finish(w); }};