示例#1
0
    public override QVariant HeaderData(int section, Qt.Orientation orientation, int role)
    {
        if (orientation == Qt.Orientation.Horizontal && role == (int)Qt.ItemDataRole.DisplayRole)
        {
            return(rootItem.Data(section));
        }

        return(new QVariant());
    }
示例#2
0
    public override QVariant Data(QModelIndex index, int role)
    {
        if (!index.IsValid())
        {
            return(new QVariant());
        }

        if (role != (int)Qt.ItemDataRole.DisplayRole)
        {
            return(new QVariant());
        }

        TreeItem item = (TreeItem)index.InternalPointer();

        return(item.Data(index.Column()));
    }