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