Results 1 to 6 of 6

Thread: QMessageBox::information always crashes

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2010
    Posts
    19
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default QMessageBox::information always crashes

    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.

    Qt Code:
    1. myAbout = new QAction(tr("About"), this);
    2. connect(myAbout, SIGNAL(triggered()), SLOT(aboutClicked()));
    3. #if defined(Q_OS_SYMBIAN) && defined(USE_ACTIONS)
    4. menuBar()->addAction(myAbout);
    5. #endif
    6.  
    7.  
    8. void myApplication::aboutClicked()
    9. {
    10. qDebug() << "myApplication::aboutClicked()";
    11. QMessageBox::information ( this, APP_NAME, "Some text" );
    12. //QMessageBox::information ( 0, APP_NAME, "Some text" );
    13. }
    To copy to clipboard, switch view to plain text mode 

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

  2. #2
    Join Date
    Jan 2006
    Location
    Alingsås, Sweden
    Posts
    437
    Thanks
    3
    Thanked 39 Times in 39 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QMessageBox::information always crashes

    Could you provide a debugger backtrace from the crash?

  3. #3
    Join Date
    Jan 2010
    Posts
    18
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: QMessageBox::information always crashes

    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.

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: QMessageBox::information always crashes

    As Tito said, the connection works and
    Qt Code:
    1. connect(myAbout, SIGNAL(triggered()), SLOT(aboutClicked()));
    To copy to clipboard, switch view to plain text mode 
    is a shorthand for
    Qt Code:
    1. connect(myAbout, SIGNAL(triggered()), this, SLOT(aboutClicked()));
    To copy to clipboard, switch view to plain text mode 
    . See QObject::connect().

  5. #5
    Join Date
    May 2010
    Posts
    19
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: QMessageBox::information always crashes

    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.....

  6. #6
    Join Date
    May 2010
    Posts
    19
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default Re: QMessageBox::information always crashes

    And the lesson today is... don't mess with TARGET.EPOCSTACKSIZE... let Qt sort it out for itself.

    Wow.. what a waste of time that was.

Similar Threads

  1. QT app information
    By CHeader in forum Qt Programming
    Replies: 5
    Last Post: 4th April 2008, 11:07
  2. Replies: 2
    Last Post: 11th March 2008, 11:46
  3. How to read Raw Information from CD in MAC?
    By vishal.chauhan in forum General Programming
    Replies: 0
    Last Post: 10th July 2007, 12:26
  4. QMessageBox::information box question
    By bruccutler in forum Qt Programming
    Replies: 1
    Last Post: 17th June 2007, 17:30
  5. Getting MAC Information from qt?
    By vishal.chauhan in forum Qt Programming
    Replies: 4
    Last Post: 23rd May 2007, 09:31

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
  •  
Qt is a trademark of The Qt Company.