Results 1 to 4 of 4

Thread: Strange CRASH error when press down or up into a cell of TableView and more...

  1. #1
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Strange CRASH error when press down or up into a cell of TableView and more...

    I have I custom tableview conected with a custom tablemodel.
    No I have only doubleclick as editortrigger.
    I have no delegates.
    The table works fine.

    Ok,
    In release mode, I do doubleclick, write 'asasas' and when press 'down' or 'up' program crash (I have time to view that tablemodel::setData is called with success).
    Ok I go to debug mode and it does not happen, but I discover that if I write 'as' very fast I have a crash. (I press the keys when the cell is selected but not in edit mode)

    Ok, I clean the project (staying at debug mode, I clean the debug files?) , run the project and the debug mode behave exactly as release mode (crash on edit and 'down' or 'up'¡ key, but works if I write 'as' very fast). I go to 'release' mode and it behaves as old debug mode (that is to say, can press down or up when editing but crash when write 'as' very fast).

    It is a madness ....

    Any idea ?

    ( Maybe I have to learn how to debug this ? I have mingw)

    (When I press down or up when editing, the value is set to the cell and the next-previous is selected, as user expect) .

    (I cannot leave the code because it is a big project with a lot of dependencies).

  2. #2
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Strange CRASH error when press down or up into a cell of TableView and more...

    Looks to me as there is some problem in your model implementation.
    here's a tip to check: all the Model-View Interface Implmentations should check for index.isValid() condition and handle it accordingly (i mean safely), I had similar crash problem due to this, but was easy to catch using QtCreator Debugger

  3. #3
    Join Date
    Sep 2010
    Posts
    654
    Thanks
    56
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Strange CRASH error when press down or up into a cell of TableView and more...

    Thanks Santosh.
    Uff, i dont understand the debugger (i have mingw). Any help to use when crash ? (now it stops almost at any point ..... It rises every time I have and lost the focus on the cell, so I am unable to detect the fail ....).
    Thanks again.

  4. #4
    Join Date
    Mar 2011
    Location
    Hyderabad, India
    Posts
    1,882
    Thanks
    3
    Thanked 452 Times in 435 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Wiki edits
    15

    Default Re: Strange CRASH error when press down or up into a cell of TableView and more...

    Ok, here is tip to use the QtCreator Debugger (if you are using it)

    Build in Debug Mode, then Start Debug (Press F5), don;t use Run(Ctrl+R), you cannot look at the stack if use Run even if Debug Mode, you need use Debug(F5), then when your application crashes, have look at the stack and see where it stopped, usually it would crash in some library functions, then trace back to your implemented function, it is generally here where you pass an invalid parameter to library, which may enentually lead to a crash.

    Good Luck...

  5. The following user says thank you to Santosh Reddy for this useful post:

    tonnot (12th May 2011)

Similar Threads

  1. color specified cell in a tableview
    By poporacer in forum Newbie
    Replies: 1
    Last Post: 29th March 2011, 20:52
  2. Replies: 2
    Last Post: 16th February 2011, 09:15
  3. !!!A Strange Crash
    By hhf in forum Qt Programming
    Replies: 12
    Last Post: 10th March 2010, 12:45
  4. Error when trying to update TableView
    By Ferric in forum Newbie
    Replies: 6
    Last Post: 13th January 2010, 09:41
  5. Replies: 1
    Last Post: 24th October 2007, 18:34

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.