
This post has been edited 2 times, last edit by "chickenblood" (Sep 1st 2005, 6:31pm)
|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
1 Thread 1085670848(LWP 2523) #0 0x4000c9c0 in _dl_debug_state_internal() from /lib/ld-linux.so.2 #1 0x4110dfb2 in dl_open_worker() from /lib/tls/libc.so.6 #2 0x4000c266 in _dl_catch_error_internal() from /lib/ld-linux.so.2 #3 0x4210da49 in _dl_open() from /lib/tls/libc.so.6 #4 0x40ac5f6b in dlopen_doit() from /lib/libdl.so.2 #5 0x4000c266 in _dl_catch_error_internal () from /lib/ld-linux.so.2 #6 0x40ac6316 in _dlerror_run() from /lib/libdl.so.2 #7 0x40ac5f14 in dlopen@@GLIB_2.1() from /lib/libdl.so.2 #8 0x407d13ea in _XlcAddGB18030 LocaleConverters() from /usr/XllR6/lib/libXll.so.6 #9 0x407d19cd in _XInitDynamicIM() from /usr/XllR6/lib/libXll.so.6 #10 0x407a0e52 in XOpenOM() from /usr/XllR6/lib/libXll.so.6 #11 0x4079ffa9 in XCreateFontSet() from /usr/XllR6/lib/libXll.so.6 #12 0x4028dfe7 in QValueListPrivate<void(*)()>::QValueListPrivate(QCalueListPrivate<void(*)()> const&) () from /usr/lib/qt-3.1/lib/libqt_mt.so.3 #13 0x4028ec70 in QInputContext::QInputContext(QWidget*)() from /usr/lib/qt-3.1/lib/libqt-mt.so.3 #14 0x4020d44c in QWidget::createInputContext()() from /usr/lib/qt-3.1/lib/libqt-mt.so.3 #15 0x402790d5 in QApplication::Xll ProcessEvent(_XEvent*)() from /usr/lib/qt-3.1/lib/libqt-mt.so.3 #16 0x4028dbda in QEventLoop::processEvents(unsigned)() from /usr/lib/qt-3.1/lib/libqt-mt.so.3 #17 0x402e8cf6 in QEventLoop::enterLoop() () from /usr/lib/qt-3.1/lib/libqt-mt.so.3 #18 0x402e8b98 in QEventLoop::exec() () from/usr/lib/libqt-mt.so.3 #19 0x402d5151 in QApplication::exec() () from /usr/lib/qt-3.1/lib/libqt-mt.so.3 #20 0x0807fc5c in main(argc=1,argv=0xbffff674) at main.cpp:29 #21 0x42015574 in __libc_start_main() from /lib/tls/lib.so.6 |


|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 |
////////////////////////main.cpp
#include <qapplication.h>
#include "MainW.h"
#include "MainA.h"
int main( int argc, char ** argv )
{
MainApp a( argc, argv );
a.connect( &a, SIGNAL(lastWindowClosed()), &a, SLOT(quit()) );
int res = a.exec();
return res;
}
///////////////////////////MainA.cpp
#include "MainA.h"
#include "MainW.h"
#include <qapplication.h>
MainApp::MainApp( int & argc, char ** argv ) : QApplication( argc, argv )
{
<do something>
init();
t = new QTimer(this);
connect(t,SIGNAL(timeout()),this,SLOT(OnIdle()));
t->start(0,false);
}
MainApp::~MainApp
{
t->stop();
}
void MainApp::init()
{
<do something>
MainWnd * mw=new MainWnd();
setMainWidget(mw);
mw->show();
<do something>
}
oid MainApp:::OnIdle()
{
if(qApp->hasPendingEvents())
{
}
else
{
<do something>
}
}
|

Quoted
Originally posted by 111
I use the OnIdle to do some multi-threading. Does it also cause problem?
