[Qt-interest] How to catch event in main-app from non-Qt thread ?

Velusamy, Baskar Baskar.Velusamy at chevron.com
Thu Apr 16 17:19:37 CEST 2009


 

Hi,

       I am trying to catch event from non-QT thread in my main
application, but some how it is not working..  below I have outlined my
code.. Please let me know anyting I am doing wrong...

 

Thanks in advance..

 

Baskar

 

 

main function

==================

int main(int argc, char **argv)

{

    QApplication app(argc, argv);

    qsrand(QTime(0,0,0).secsTo(QTime::currentTime()));

 

    IXBuilder widget(argc, argv);

      //app.setMainWidget(&widget);

    widget.show();

    return app.exec();

}

 

 

Re-implemented my custom event...in main app 

==========================================

 

void IXBuilder::customEvent(QEvent *event)

{

      cout<<"event called";

} 

 

 

Posting event from non-qt thread.

==================================

 

QApplication::postEvent( qApp, new QEvent(QEvent::User));

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090416/fb85aa13/attachment.html 


More information about the Qt-interest-old mailing list