Results 1 to 7 of 7

Thread: QCoreApplication::postEvent();

  1. #1
    Join Date
    Mar 2008
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default QCoreApplication::postEvent();

    Hi

    I am trying to do a postEvent to the QSplash screen that i created in the main statup.

    I am not sure how to build the event can someone help


    Qt Code:
    1. QCoreApplication::postEvent(splash, QHideEvent::QHideEvent());
    To copy to clipboard, switch view to plain text mode 

    I not quite sure what I am doing wrong but I get a build error undder Windows VS 2005

    1>.\ine-de.cpp(108) : error C2665: 'QCoreApplication::postEvent' : none of the 2 overloads could convert all the argument types
    1> c:\qt\4.3.3\include\qtcore\../../src/corelib/kernel/qcoreapplication.h(83): could be 'void QCoreApplication::postEvent(QObject *,QEvent *)'
    1> while trying to match the argument list '(QSplashScreen *, QHideEvent)'
    Thanks
    Chris
    Last edited by jpn; 1st April 2008 at 06:25. Reason: missing tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QCoreApplication::postEvent();

    How about simply calling splash->hide()?

  3. #3
    Join Date
    Mar 2008
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QCoreApplication::postEvent();

    The app throws an exception. There is lots of dialog calls in the constructor of the main class. Thats why I need it go away sooner than in the example. I am not sure why but any direct refference to the splashsreen kills the app.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QCoreApplication::postEvent();

    An uninitialized pointer maybe?

  5. #5
    Join Date
    Mar 2008
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QCoreApplication::postEvent();

    I got the post event syntax right I just can't get it right to inlialize the global pointer to splash screen. I have "Qsplashscreen *splash;" in the application header what would the syntax be in main using this global pointer reference.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QCoreApplication::postEvent();

    So far you have a pointer. Did you assign an actual object to it?

  7. #7
    Join Date
    Mar 2008
    Posts
    13
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QCoreApplication::postEvent();

    OK I fixed the hole problem

    From
    QSplashScreen *splash = new QSplashScreen(pixmap, Qt::WindowStaysOnTopHint);
    to
    QSplashScreen *splash = new QSplashScreen(pixmap);


    I just need to remove the QT flag and now the dialogs just show up on top of the splash screen and then when the app es exited the splash goes away coreclty. I think by using the Qt::WindowStaysOnTopHint flag I was forcing the dialogs to remiane behind the splash screen. All is good now

    Thanks,
    Chris

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.