QTreeWidget causes the app to crash after deleting the last QTreeWidgetItem
-
yes @jsulm, is GDB as illustrated in the code snippet some messages ago
this is taken from the "Global Debugger Log" panel , after running the Debug play button
and is clearly referring to GDB- GDB PROCESS FINISHED, status 0, exit code 1 (0x1)
- d[GDB] NOTE: ENGINE SETUP FAILED
d[GDB] UNEXPECTED GDB STDERR: error: unknown option: --tty=\\.\pipe\creator-11944-28798 derror: unknown option: -i dUse 'lldb.exe --help' for a complete list of options. d[GDB] GDB PROCESS FINISHED, status 0, exit code 1 (0x1) d[GDB] NOTE: ENGINE SETUP FAILED d[GDB] State changed from EngineSetupRequested(1) to EngineSetupFailed(2) <Debugging has failed. d[GDB] State changed from EngineSetupFailed(2) to DebuggerFinished(16)
@Andrea_Venturelli said in QTreeWidget causes the app to crash after deleting the last QTreeWidgetItem:
dUse 'lldb.exe --help' for a complete list of options.
Why don't you simply check in the Kit which debugger is set?
-
how can i do that? it's not clear to me, where the informations of the debug type resides; a screenshot could be helpfull or even the path like so:
[Qt creator] >> Edit >> Preferences... >> Debugger .. and so on or
[Qt Maintenance Tool] >> Extencion >> ecc..because I have a little experience with Qt Creator, resulting in me, not knowing where to look for
-
how can i do that? it's not clear to me, where the informations of the debug type resides; a screenshot could be helpfull or even the path like so:
[Qt creator] >> Edit >> Preferences... >> Debugger .. and so on or
[Qt Maintenance Tool] >> Extencion >> ecc..because I have a little experience with Qt Creator, resulting in me, not knowing where to look for
@Andrea_Venturelli [Qt creator] >> Edit >> Preferences... >> Kits - then select the Kit you're using
-
this is what I use to create the projects (and using qMake to built):
-
this is what I use to create the projects (and using qMake to built):
@Andrea_Venturelli Please show ALL settings of that Kit (especially Qt version and debugger set).
-
Desktop Qt 6.7.1 llvm-mingw 64-bit
c++ compiler:
LLVM-MinGW 17.0.6 64-bit for c++
Debugger:
LLVM lldb 17.0.6 64-bit
Qt version:
Qt 6.7.1 llvm-mingw 64-bit
CMake Tool:
CMake 3.27.7 (Qt)
-
Desktop Qt 6.7.1 llvm-mingw 64-bit
c++ compiler:
LLVM-MinGW 17.0.6 64-bit for c++
Debugger:
LLVM lldb 17.0.6 64-bit
Qt version:
Qt 6.7.1 llvm-mingw 64-bit
CMake Tool:
CMake 3.27.7 (Qt)
@Andrea_Venturelli Try with Qt for MinGW (not llvm-mingw).
Maybe QtCreator does not support lldb properly. -
It looks like the LLVM MInGW debugger has the wrong debugger type set. It should be
LLDB
and notGDB
.https://bugreports.qt.io/browse/QTBUG-123330 was supposed to be a thing of the past...
-
How should I change the current project KIT, transitioning from llvm-mingw to MinGW ??
I tryed it, from the preferences panel under: Edit >> Preferences... >> Kits
but I'm pretty sure that has no impact on the current project, instead will change the default Kit, the next time I'll create a new project.Exists such a way to change the Kit to the current running project or I'm forced to create a brand-new one and manually paste the code?
-
How should I change the current project KIT, transitioning from llvm-mingw to MinGW ??
I tryed it, from the preferences panel under: Edit >> Preferences... >> Kits
but I'm pretty sure that has no impact on the current project, instead will change the default Kit, the next time I'll create a new project.Exists such a way to change the Kit to the current running project or I'm forced to create a brand-new one and manually paste the code?
@Andrea_Venturelli said in QTreeWidget causes the app to crash after deleting the last QTreeWidgetItem:
How should I change the current project KIT, transitioning from llvm-mingw to MinGW ??
On the right side in QtCreator "Projects".
From your screen-shots it looks like you already have a Kit for Qt MinGW. -
okay, finally we did it!
for the other reader who might encounter this problem with the debugger, the solution is:- on the left panel (where it is "Welcome", "Edit", "Design") there is "Projects"
- open projects and under "Built & Run" you have all the kit available
- I switched from Desktop Qt 6.7.1 llvm-mingw 64-bit to Desktop Qt 6.7.1 MinGW 64-bit
- I pressed the "run" button and compile fine.
- after I Run the normal "Debug play button" at the bottom left cornern and now is working
now we can go back to the main issues where this discussion started
-
this is the error I get after deleting the last item in the QTreeWidget:
here the call stack:
I also found out where was the problem, other then I'm a big chicken ;)
SOLUTION
I had the QTreeWidget::ItemChanged signal, connected to one of my custom slots where i automatically update the values inside the LineEdits. But I ignored that, even when the last item is deleted, the QTreeWidget calls the "ItemChanged" signal.
adding a check if the, before trying to retrive information from an empty QTreeWidgetItem solved the problem
void Dialog::on_treeWidgetItemChanged() { // check control if (m_paths.count()) { auto current_itm = ui->left_wdg->currentItem(); // update the lineEdit' values ui->fn_le->setText(current_itm->text(0)); // THIS WAS THE CAUSE OF THE ERROR ui->fPath_le->setText(current_itm->text(1)); } }
-