Hi,
I have 2 custom items in my model and I want to know any time the exact type of the item.
type() function always returns the 0 type.
Can someone help me?
Hi,
I have 2 custom items in my model and I want to know any time the exact type of the item.
type() function always returns the 0 type.
Can someone help me?
Reimplement QStandardItem::type() for the custom types:
The default implementation returns QStandardItem::Type which is equal to 0.Returns the type of this item. The type is used to distinguish custom items from the base class. When subclassing QStandardItem, you should reimplement this function and return a new value greater than or equal to UserType.
J-P Nurmi
Yes was a problem with the makefile. Solved... but now...
I have a TreeView with the StandardItemModel populated with "CategoryItem" and a ListView with another StandardItemModel populated with "ObjectItem". When I drag a item from ListView to TreeView it inserts the item right, but when I try to see the type of the "ObjectItem" in the TreeView it returns type 0.
Bookmarks