#ifndef LOGTREEMODEL #define LOGTREEMODEL #include "viewmodel/tree/TreeItem.h" #include #include class TreeModel : public QAbstractItemModel { Q_OBJECT public: Q_DISABLE_COPY_MOVE(TreeModel) explicit TreeModel(QObject* parent = nullptr); ~TreeModel() override; QVariant data(const QModelIndex& index, int role) const override; Qt::ItemFlags flags(const QModelIndex& index) const override; QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override; QModelIndex index(int row, int column, const QModelIndex& parent = {}) const override; QModelIndex parent(const QModelIndex& index) const override; int rowCount(const QModelIndex& parent = {}) const override; int columnCount(const QModelIndex& parent = {}) const override; //uncrustify off public slots: void showSelectedLog(const Log_ptr log); void clearView(); //uncrustify on private: bool _valid = false; std::unique_ptr _rootItem; }; #endif //LOGTREEMODEL