Oh I'm so stupid... What am I saying... All works well...
Sorry Wysota ^_^
To conclude, here is my last backtrace showing that there is no more problem.
void interface_impl::SLOT_selection_changed()
{
QList<QTreeWidgetItem*> sel = tree->selectedItems();
qDebug("COUNT: %d", sel.count());
qDebug("SIZE: %d", sel.size());
qDebug("EMPTY: %d", sel.isEmpty());
if(sel.isEmpty() == false)
{
qDebug("item_name : before acces");
item_name = sel.at(0)->text(0);
qDebug("item_name : after acces");
}
qDebug("tree : before clear");
tree->clear();
qDebug("tree : after clear");
}
void interface_impl::SLOT_selection_changed()
{
QString item_name;
QList<QTreeWidgetItem*> sel = tree->selectedItems();
qDebug("COUNT: %d", sel.count());
qDebug("SIZE: %d", sel.size());
qDebug("EMPTY: %d", sel.isEmpty());
if(sel.isEmpty() == false)
{
qDebug("item_name : before acces");
item_name = sel.at(0)->text(0);
qDebug("item_name : after acces");
}
qDebug("tree : before clear");
tree->clear();
qDebug("tree : after clear");
}
To copy to clipboard, switch view to plain text mode
D:\Applications\Qt\4.3.1\Workspace\Listeur>gdb debug/Listeur
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) run
Starting program: D:\Applications\Qt\4.3.1\Workspace\Listeur/debug/Listeur.exe
warning: COUNT: 1
warning: SIZE: 1
warning: EMPTY: 0
warning: item_name : before acces
warning: item_name : after acces
warning: tree : before clear
warning: COUNT: 0
warning: SIZE: 0
warning: EMPTY: 1
warning: tree : before clear
warning: tree : after clear
warning: tree : after clear
Program exited normally.
(gdb)
D:\Applications\Qt\4.3.1\Workspace\Listeur>gdb debug/Listeur
GNU gdb 6.3
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-mingw32"...
(gdb) run
Starting program: D:\Applications\Qt\4.3.1\Workspace\Listeur/debug/Listeur.exe
warning: COUNT: 1
warning: SIZE: 1
warning: EMPTY: 0
warning: item_name : before acces
warning: item_name : after acces
warning: tree : before clear
warning: COUNT: 0
warning: SIZE: 0
warning: EMPTY: 1
warning: tree : before clear
warning: tree : after clear
warning: tree : after clear
Program exited normally.
(gdb)
To copy to clipboard, switch view to plain text mode
Like it has been recommanded me on Qtfr forums, I should use the accessors "value()" or "take()" instead of "at()" in order to prevent segmentation fault errors . This would have help us so much...
Bookmarks