No, I don't use thread. You can see the code of my control at this link http://www.qtcentre.org/threads/40744-Hierarchical-TreeView?highlight=
Thanks for your help
Michele
No, I don't use thread. You can see the code of my control at this link http://www.qtcentre.org/threads/40744-Hierarchical-TreeView?highlight=
Thanks for your help
Michele
See if these asserts fire:
Qt Code:
void TableDelegate::setHideColumn(int column) { Q_ASSERT(column < 30); colshided[column]=1; } void TableDelegate::setShowColumn(int column) { Q_ASSERT(column < 30); colshided[column]=0; } void InternalTableDelegate::setHideColumn(int column) { Q_ASSERT(column < 30); colshided[column]=1; } void InternalTableDelegate::setShowColumn(int column) { Q_ASSERT(column < 30); colshided[column]=0; }To copy to clipboard, switch view to plain text mode
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Dear high_flyer,
I added your code to the mine, and I isolated the HGrid component to the other software, creating a new small project that I attach.
If I request the context menu (in release mode or run debug mode) rapidly to the different QTreeView (outher and inner) and click onto the menu appared, after some click I obtain the "errore.png" window, I think relative to one of Q_Assert that I inserted. To know which of the 4 assert rised, i try to click "Debug with QTCreator" but I got the "nodebug.png" error dialog.
Other time, I got the "QMutex..." error that I post in previous posts yet, with "errQMutex.png" error dialog.
What else I should check?
Thanks a lot for your time.
Michele
If the assert is caught, the message will contain the file and line number of the assert which caused the break.I think relative to one of Q_Assert that I inserted.
Since you made a test project, and since it is crashing, just run it in a debugger, and see which line is crashing.
As I said in my first post, it looks like you are writing out of bounds, probably to your int array.
So have a look in your code to all the places where you reference that array, and make sure you surround that code with a check, so that you don't reference it outside its bounds.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Thansk a lot high_flyer, but... which debugger? If I run my project by "Start debugging (F5)" from QTCreator, it no crash! How can I see the line code?
In one run of start debugging, it wrote:
Is there any other then I should check?Heap corruption detected at 00B33388
Heap corruption detected at 00B33388
Heap [hierarchical.exe]:
Heap: Free heap block b33380 modified at b33390 after it was freed.
..... exited with code 1073807364
Thanks a lot for your time.
I'll check my code on that array
thanks.
Michele
Ok, the problem as the debugger is saying, is a heap corruption, not a stack.
You are either reallocating memory on pointer that you haven't freed AND/OR doing some pointer arithmetic which is corrupting the pointer.
Make sure you free all the pointers you are allocating on the heap, and test the pointer for validity before using it.
Setting pointers to NULL when ever not initialized is recommended as well.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Bookmarks