Results 1 to 3 of 3

Thread: QModelIndex destructor causes "user breakpoint"

  1. #1
    Join Date
    Jan 2006
    Location
    Leiden, the Netherlands
    Posts
    43
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default QModelIndex destructor causes "user breakpoint"

    Hello,

    I am developing a class using a QTableWidget and, although I re-installed Qt 4.1.1 and rebuilt my project several times to avoid inconsistent build problems, I get a "user breakpoint", when the QModelIndex destructor is invoked in the following method:

    Qt Code:
    1. void MyClass::foo()
    2. {
    3. QList<QModelIndex> indexes = pAEditor_->tableWidget->selectionModel()->selectedIndexes();
    4. pAEditor_->btnOne->setDisabled( indexes.count() <= 0 );
    5. pAEditor_->btnTwo->setDisabled( indexes.count() <= 0 );
    6. }
    To copy to clipboard, switch view to plain text mode 

    The user breakpoint occurs on the following code in qatomic.h:

    Qt Code:
    1. inline int q_atomic_test_and_set_release_int(volatile int *ptr, int expected, int newval)
    2. {
    3. return q_atomic_test_and_set_int(ptr, expected, newval);
    4. }
    To copy to clipboard, switch view to plain text mode 

    This is the call stack:

    ntdll.dll!7c901230()
    ntdll.dll!7c96c943()
    ntdll.dll!7c96cd80()
    ntdll.dll!7c960af8()
    > QtCored4.dll!q_atomic_test_and_set_release_int(vol atile int * ptr=0x02cd0000, int expected=1073741920, int newval=85780576) Line 199 + 0x11 C++
    kernel32.dll!7c85e7af()
    Database.dll!_CrtIsValidHeapPointer(const void * pUserData=0x051ce880) Line 1807 C
    Database.dll!_free_dbg_lk(void * pUserData=0x051ce880, int nBlockUse=1) Line 1132 + 0x9 C
    Database.dll!_free_dbg(void * pUserData=0x051ce880, int nBlockUse=1) Line 1070 + 0xd C
    Database.dll!operator delete(void * pUserData=0x051ce880) Line 54 + 0x10 C++
    Database.dll!QModelIndex::`scalar deleting destructor'() + 0x46 C++
    Database.dll!QList<QModelIndex>::node_destruct(QLi st<QModelIndex>::Node * from=0x051ce834, QList<QModelIndex>::Node * to=0x051ce834) Line 330 + 0x3e C++
    Database.dll!QList<QModelIndex>::free(QListData:ata * data=0x051ce820) Line 528 C++
    Database.dll!QList<QModelIndex>::~QList<QModelInde x>() Line 502 C++
    Database.dll!MyClass::Foo() Line 381 + 0xf C++



    Now, I know this is all a little vague, but does someone have any suggestions on how to solve this?

    Tnx,
    Arthur

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QModelIndex destructor causes "user breakpoint"

    Are you using an IDE to build your application? It looks more like you set a breakpoint somewhere in the IDE than a problem with the application code. Try using commandline tools to build and execute your application and see if the problem persists.

  3. #3
    Join Date
    Jan 2006
    Location
    Leiden, the Netherlands
    Posts
    43
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QModelIndex destructor causes "user breakpoint"

    I use VC++ 2003, the problem was the fact that (for some reason) my runtime libraries were not set to multithreaded DLL.

    I didn't set any breakpoints, this user breakpoint is caused by Qt runtime checks in the VC++ debugger (done on purpose when there are heap memory problems I guess).

    Thanks anyway.

Similar Threads

  1. QAbstractProxyModel to do a Tree
    By xgoan in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2008, 17:31
  2. QSql*Model + QTreeView : make a tree
    By punkypogo in forum Qt Programming
    Replies: 18
    Last Post: 24th October 2008, 18:14
  3. Replies: 6
    Last Post: 21st September 2007, 13:51

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.