
Originally Posted by
tbscope
First of all, the code you posted is very weird.
Why do you code the implementation in the header? Are you coming from a C# world?
Nope. It's easier to post here. The source and the header is separated in my solution.
And it is a samle code.

Originally Posted by
tbscope
I copied your code and tried it for myself. It doesn't crash for me.
Post the error you get please.
I don't know if it matters, i compile it with VS 2008 x64 and run it on a Windows 7 x64 system.
Unhandled exception at 0x65948c50 (QtGuid4.dll) in trash2.exe: 0xC0000005: Access violation reading location 0xffffffffffffffff.
Unhandled exception at 0x65948c50 (QtGuid4.dll) in trash2.exe: 0xC0000005: Access violation reading location 0xffffffffffffffff.
To copy to clipboard, switch view to plain text mode
It's crashes in this part ( should i post the Call Stack? ):
{
if (!index.isValid())
if (itm)
return itm->data(index.column(), role);
}
QVariant QTreeModel::data(const QModelIndex &index, int role) const
{
if (!index.isValid())
return QVariant();
QTreeWidgetItem *itm = item(index);
if (itm)
return itm->data(index.column(), role);
return QVariant();
}
To copy to clipboard, switch view to plain text mode

Originally Posted by
tbscope
The use of ui is a little bit strange to me.
And you should include QTreeWidgetItem
Iit was generated using the default Qt Application project settings in VS2008.
I think the QTreeWidget.h includes QTreeWidgetItem and QTreeWidget is included in the ui's header.
Bookmarks