+ Reply to Thread
Results 1 to 3 of 3

Thread: When I keep clicking on Splashscreen I get following error

  1. #1
    Join Date
    Jan 2017
    Posts
    2
    Qt products
    Qt5
    Platforms
    Windows

    Default When I keep clicking on Splashscreen I get following error

    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..."),topLef t, 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();

    Error.jpg

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,835
    Thanks
    3
    Thanked 443 Times in 426 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: When I keep clicking on Splashscreen I get following error

    You should be calling processEvents() periodically while processing in side window.InitalSetup() method
    When you know how to do it then you may do it wrong.
    When you don't know how to do it then it is not that you may do it wrong but you may not do it right.

  3. #3
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,426
    Thanks
    13
    Thanked 1,558 Times in 1,488 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: When I keep clicking on Splashscreen I get following error

    ... 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.
    “We can't solve problems by using the same kind of thinking we used when we created them.” -- Einstein

    If you are posting code then please use [code] [/code] tags around it. The forum will link class names to docs, add syntax highlighting, and won't mangle your code. Above all, it makes your question easier to address.

+ Reply to Thread

Similar Threads

  1. Clicking on a plot
    By Ronayn in forum Qwt
    Replies: 1
    Last Post: 29th April 2011, 13:59
  2. Clicking on QwtPlot
    By orignihn in forum Qwt
    Replies: 1
    Last Post: 14th April 2011, 16:37
  3. Replies: 0
    Last Post: 5th October 2010, 07:41
  4. SplashScreen and Event handling???
    By Nithya in forum Qt Programming
    Replies: 4
    Last Post: 25th April 2008, 07:05
  5. SplashScreen isn't displayed
    By Salazaar in forum Newbie
    Replies: 26
    Last Post: 27th June 2007, 21:14

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts