#ifndef XTREEWIDGETITEM_H
#define XTREEWIDGETITEM_H

#include <QTreeWidget>
#include <QTreeWidgetItem>

enum TREE_CATEGORY {
    CATEGORY_NONE = 0x00,
    CATEGORY_FILE = 0x01,
    CATEGORY_TYPE = 0x02
};

// Custom item class
class XTreeWidgetItem : public QTreeWidgetItem
{
public:
    // Flag to indicate if the item is a collapsible group/header.
    bool isGroup;

    // Constructors: default to non-group unless specified.
    XTreeWidgetItem(QTreeWidget *parent, bool group = false);
    XTreeWidgetItem(QTreeWidgetItem *parent, bool group = false);

    void SetCategory(TREE_CATEGORY category);
    TREE_CATEGORY GetCategory();

    // Override the less-than operator to customize sorting.
    bool operator<(const QTreeWidgetItem &other) const override;
    XTreeWidgetItem &operator =(const XTreeWidgetItem &other);

private:
    TREE_CATEGORY mCategory;
};


#endif // XTREEWIDGETITEM_H
