67 lines
1.7 KiB
C++
67 lines
1.7 KiB
C++
#ifndef CONTAINERS_VIEW_H
|
|
#define CONTAINERS_VIEW_H
|
|
|
|
#include "ui_containers_view.h"
|
|
#include <QDebug>
|
|
#include <QWidget>
|
|
#include "piqt.h"
|
|
#include "piintrospection_containers_p.h"
|
|
|
|
|
|
class ContainersModel: public QAbstractItemModel {
|
|
Q_OBJECT
|
|
public:
|
|
ContainersModel();
|
|
|
|
void update(const PIMap<uint, PIIntrospectionContainers::Type> & td, const PIMap<uint, PIString> & tn);
|
|
void clear();
|
|
|
|
int rowCount(const QModelIndex & parent = QModelIndex()) const override;
|
|
int columnCount(const QModelIndex & parent = QModelIndex()) const override;
|
|
QModelIndex parent(const QModelIndex & child) const override {return QModelIndex();}
|
|
QModelIndex index(int row, int column, const QModelIndex & parent = QModelIndex()) const override;
|
|
bool hasChildren(const QModelIndex & parent = QModelIndex()) const override;
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
|
QVariant data(const QModelIndex & index, int role) const override;
|
|
Qt::ItemFlags flags(const QModelIndex & index) const override;
|
|
|
|
protected:
|
|
PIMap<uint, PIIntrospectionContainers::Type> typedata, prev_typedata;
|
|
PIMap<uint, PIString> typenames;
|
|
PIVector<uint> typeids;
|
|
PIVector<llong> all, prev_all;
|
|
bool mode_changes;
|
|
|
|
public slots:
|
|
void setChangesMode(bool yes);
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
class ContainersView: public QWidget, private Ui::ContainersView
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
ContainersView(QWidget * parent = 0);
|
|
~ContainersView();
|
|
|
|
void showContainers(const PIMap<uint, PIIntrospectionContainers::Type> & data, const PIMap<uint, PIString> & typenames);
|
|
void clear();
|
|
|
|
protected:
|
|
void changeEvent(QEvent * e);
|
|
|
|
QStringList src_header;
|
|
ContainersModel * model;
|
|
|
|
private slots:
|
|
|
|
public slots:
|
|
|
|
};
|
|
|
|
|
|
#endif // CONTAINERS_VIEW_H
|