Originally Posted by
3dch
I'd say that the type identifies the data type contained in the item which gets interpreted by the related XXView classes for operations such as sorting or filtering.
Unfortunately it isn't true. If it had something to do with QVariant::Type, the Trolls would use QVariant::Type instead of defining new types. Note also that QVariant object knows exactly what is the type of the value it holds and there is no need to duplicate that information. Furthermore xxxView classes use models, not xxxItems.
{
friend class QListModel;
public:
enum { Type = 0, UserType = 1000 }; // <- note that there are only two values defined
...
class Q_GUI_EXPORT QListWidgetItem
{
friend class QListModel;
public:
enum { Type = 0, UserType = 1000 }; // <- note that there are only two values defined
...
To copy to clipboard, switch view to plain text mode
As Chcken Blood Machine said, it's used for RTTI:
: rtti(type), ... // <--
...
QListWidgetItem::QListWidgetItem(QListWidget *view, int type)
: rtti(type), ... // <--
...
To copy to clipboard, switch view to plain text mode
Bookmarks