38 lines
1.5 KiB
C++
38 lines
1.5 KiB
C++
#ifndef OUTPUTCOLUMNMODEL_H
|
|
#define OUTPUTCOLUMNMODEL_H
|
|
|
|
#include <QLineEdit>
|
|
#include <QAbstractListModel>
|
|
#include <outputcolumn.h>
|
|
|
|
class OutputColumnModel : public QAbstractListModel
|
|
{
|
|
Q_OBJECT
|
|
static constexpr const char* MimeType = "application/output.column.model";
|
|
std::vector<OutputColumn> *columns;
|
|
|
|
public:
|
|
OutputColumnModel(std::vector<OutputColumn> *columns, QObject *parent = nullptr);
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
|
QVariant headerData(int section, Qt::Orientation orientation,
|
|
int role = Qt::DisplayRole) const override;
|
|
|
|
Qt::ItemFlags flags (const QModelIndex& index) const override;
|
|
bool setData(const QModelIndex &index, const QVariant &value,
|
|
int role = Qt::EditRole) override;
|
|
|
|
Qt::DropActions supportedDropActions() const override;
|
|
|
|
bool insertRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
|
|
bool removeRows(int position, int rows, const QModelIndex &index = QModelIndex()) override;
|
|
|
|
QStringList mimeTypes() const override;
|
|
bool canDropMimeData(const QMimeData *, Qt::DropAction, int, int, const QModelIndex&);
|
|
QMimeData* mimeData(const QModelIndexList &indexes) const override;
|
|
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
|
|
};
|
|
|
|
#endif // OUTPUTCOLUMNMODEL_H
|