Results 1 to 9 of 9

Thread: Program crashes at QApplication::exec()

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,318
    Thanks
    315
    Thanked 870 Times in 857 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Program crashes at QApplication::exec()

    It might help if you actually posted some code instead of just stack dumps, and reduced your code to something that reproduces the problem.

    I use a QList private data member in the model to store the data from the file, maybe it has something to do with this?
    I'd say that was a pretty good bet.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  2. #2
    Join Date
    Oct 2016
    Posts
    6
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Program crashes at QApplication::exec()

    I've found the problem, a really silly thing, i didn't return an invalid QVariant in the data() function of the model if it was another role different than DisplayRole. But i wonder why it worked fine in 32 bits...

    Qt Code:
    1. QVariant TableModel::data(const QModelIndex &index, int role) const {
    2. if (role == Qt::DisplayRole){
    3. ...
    4. }
    5. return QVariant(); //I missed this
    6. }
    To copy to clipboard, switch view to plain text mode 

    Anyway, again, thanks for your answers!

  3. #3
    Join Date
    Mar 2008
    Location
    Kraków, Poland
    Posts
    1,540
    Thanked 284 Times in 279 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Program crashes at QApplication::exec()

    Strange compiler settings - should be an error message.

  4. #4
    Join Date
    Oct 2016
    Posts
    6
    Thanks
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Program crashes at QApplication::exec()

    Quote Originally Posted by Lesiok View Post
    Strange compiler settings - should be an error message.
    Mmmm, i have gcc default, and qmake with these arguments: "-r -spec linux-g++-64 CONFIG+=debug", also default.

  5. #5
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Program crashes at QApplication::exec()

    Quote Originally Posted by lugarci2 View Post
    I've found the problem, a really silly thing, i didn't return an invalid QVariant in the data() function of the model if it was another role different than DisplayRole.
    Ah, yes, that was at least one obvious error when you said you are seeing checkboxes.

    Cheers,
    _

Similar Threads

  1. Crash on QApplication::exec()
    By Nivek in forum Qt Programming
    Replies: 13
    Last Post: 6th April 2011, 22:18
  2. QThread::exec and QApplication instantiation
    By Ray Froehlich in forum Qt Programming
    Replies: 1
    Last Post: 28th July 2010, 05:35
  3. Replies: 4
    Last Post: 1st December 2008, 11:13
  4. Quitting before the QApplication::exec()
    By jsmax in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2008, 20:19
  5. Replies: 2
    Last Post: 16th March 2007, 09:04

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.