PDA

View Full Version : When I keep clicking on Splashscreen I get following error



Mario777
11th January 2017, 08:48
QApplication app(argc, argv);
MainWindow window(nullptr, argc, argv);
QPixmap pixmap(":Icons//Mysplash.jpg");
QSplashScreen splash(pixmap);
splash.show();
//app.processEvents();
Qt::Alignment topLeft = Qt::AlignLeft | Qt::AlignTop;
splash.showMessage(QObject::tr("Launch..."),topLeft, Qt::gray);
app.processEvents();
QApplication::setDesktopSettingsAware(false);
QApplication::setStyle("macintosh");
window.InitalSetup();
window.showMaximized();
splash.finish(&window;);
QTimer::singleShot(2000, &splash;, SLOT(close()));
return app.exec();

12278

Santosh Reddy
13th January 2017, 07:39
You should be calling processEvents() periodically while processing in side window.InitalSetup() method

ChrisW67
15th January 2017, 01:16
... and running your program in your debugger to see where it is generating the unhandled exception.

The "nullptr" value passed on line 2 is begging to be misused inside the MainWindow constructor or methods.
The path on line 3 does not need two forward slashes.
You should, in general, copy and paste compilable code when asking for help. The second last line will not compile.