swaymux/tree/PsTreeModel.h
2024-03-04 00:27:05 +01:00

36 lines
754 B
C++

//
// Created by grimmauld on 25.02.24.
//
#ifndef SWAYMUX_PSTREEMODEL_H
#define SWAYMUX_PSTREEMODEL_H
#include <QAbstractItemModel>
#include "pstree.h"
#include "AbstractTreeModel.h"
class PsTreeModel : public AbstractTreeModel<ProcessTreeNode> {
Q_OBJECT
public:
Q_DISABLE_COPY_MOVE(PsTreeModel)
explicit PsTreeModel(QObject *parent = nullptr);
~PsTreeModel() override = default;
explicit PsTreeModel(ProcessTreeNode * rootItem, QObject *parent = nullptr) : rootItem(rootItem), AbstractTreeModel<ProcessTreeNode>(parent) {};
void update();
[[nodiscard]] const ProcessTreeNode *getRoot() const override {
return rootItem;
};
private:
const ProcessTreeNode* rootItem;
};
#endif //SWAYMUX_PSTREEMODEL_H