46 lines
1.1 KiB
C
46 lines
1.1 KiB
C
|
//
|
||
|
// Created by grimmauld on 25.02.24.
|
||
|
//
|
||
|
|
||
|
#ifndef SWAYMUX_PSTREEMODEL_H
|
||
|
#define SWAYMUX_PSTREEMODEL_H
|
||
|
|
||
|
|
||
|
#include <QAbstractItemModel>
|
||
|
#include "pstree.h"
|
||
|
|
||
|
class PsTreeModel : public QAbstractItemModel {
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
|
Q_DISABLE_COPY_MOVE(PsTreeModel)
|
||
|
|
||
|
explicit PsTreeModel(QObject *parent = nullptr);
|
||
|
|
||
|
~PsTreeModel() override = default;
|
||
|
|
||
|
[[nodiscard]] QVariant data(const QModelIndex &index, int role) const override;
|
||
|
|
||
|
[[nodiscard]] Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||
|
|
||
|
[[nodiscard]] QVariant headerData(int section, Qt::Orientation orientation,
|
||
|
int role = Qt::DisplayRole) const override;
|
||
|
|
||
|
[[nodiscard]] QModelIndex index(int row, int column,
|
||
|
const QModelIndex &parent = {}) const override;
|
||
|
|
||
|
[[nodiscard]] QModelIndex parent(const QModelIndex &index) const override;
|
||
|
|
||
|
[[nodiscard]] int rowCount(const QModelIndex &parent = {}) const override;
|
||
|
|
||
|
[[nodiscard]] int columnCount(const QModelIndex &parent = {}) const override;
|
||
|
|
||
|
void update();
|
||
|
|
||
|
private:
|
||
|
ProcessTreeNode rootItem;
|
||
|
};
|
||
|
|
||
|
|
||
|
#endif //SWAYMUX_PSTREEMODEL_H
|