PDA

View Full Version : QMessageBox::information always crashes



Tito
8th September 2010, 19:27
for no apparent reason, I can't get QMessageBox::information to work in my current application. It always crashes even in the simplest cases.

for example, even this causes a crash.



myAbout = new QAction(tr("About"), this);
connect(myAbout, SIGNAL(triggered()), SLOT(aboutClicked()));
#if defined(Q_OS_SYMBIAN) && defined(USE_ACTIONS)
menuBar()->addAction(myAbout);
#endif


void myApplication::aboutClicked()
{
qDebug() << "myApplication::aboutClicked()";
QMessageBox::information ( this, APP_NAME, "Some text" );
//QMessageBox::information ( 0, APP_NAME, "Some text" );
}

I do have a couple of threads running, but the QMessageBox is always called from the main UI thread. Any ideas?

e8johan
9th September 2010, 08:12
Could you provide a debugger backtrace from the crash?

cloaked_and_coastin
9th September 2010, 14:44
Should your connect have 4 arguments instead of 3?

Instead of:
connect(myAbout, SIGNAL(triggered()), SLOT(aboutClicked()));

try:
connect(myAbout, SIGNAL(triggered()), myAbout, SLOT(aboutClicked()));

Hope this helps.

Lykurg
9th September 2010, 14:48
As Tito said, the connection works and
connect(myAbout, SIGNAL(triggered()), SLOT(aboutClicked())); is a shorthand for
connect(myAbout, SIGNAL(triggered()), this, SLOT(aboutClicked()));. See QObject::connect().

Tito
9th September 2010, 18:19
the problem isn't with the connect.... You only need 4 arguments if the slot object is different from the signal object.

As for the error, I've simplified it even more... the messagebox is being sent up as the first thing in the mainwindow creation.. which works on a blank project, but not here..

unfortunately the debug stack isn't helpful.

Thread [Thread id: 758] (Suspended: Signal 'Exception 0' received. Description: A data abort exception has occurred..)
2 Unknown (0x7971C6FA)() 0x7971c6fa
1 Unknown (0x7971CD60)() 0x7971cd60

hmmm.....

Tito
11th September 2010, 16:51
And the lesson today is... don't mess with TARGET.EPOCSTACKSIZE...:mad: let Qt sort it out for itself.

Wow.. what a waste of time that was.