How to apply GraphicsEffect for QSplashScreen..?
Unsolved
General and Desktop
-
Hi,
I want add a GraphicsEffect for QSplashScreen is it possible to do using
QSplashScreen *screen = new QSplashScreen; screen->setGraphicsEffect(effect);
If it is possible please post a code snippet for me to understand.
Thanks in Advance,
Mounika.P -
@mounipanditi
what happens or doesn't work with your code? -
Thanks for replying, i haven't understood how to write the code that's all.
-
@mounipanditi
there is no more additional magic included than in your code you've posted ;)QSplashScreen *screen = new QSplashScreen; QGraphicsBlurEffect* effect = new QGraphicsBlurEffect( screen ); screen->setGraphicsEffect(effect);
-
here simple code:
#include <QApplication> #include <QGraphicsBlurEffect> #include <QSplashScreen> #include <QTimer> int main(int argc, char *argv[]) { QApplication a(argc, argv); QSplashScreen splash(QPixmap(":/your.png")); splash.setGraphicsEffect(new QGraphicsBlurEffect); splash.show(); a.processEvents(); QWidget w; QTimer::singleShot(2000, [&w, &splash]{ w.show(); splash.finish(&w); }); return a.exec(); }