Skip to content

Instantly share code, notes, and snippets.

@amoe
Created March 4, 2019 16:12
Show Gist options
  • Save amoe/30b465379475348d70e29ed0b5994ae4 to your computer and use it in GitHub Desktop.
Save amoe/30b465379475348d70e29ed0b5994ae4 to your computer and use it in GitHub Desktop.
#ifndef FIELD_ENCODER_MODEL_HH
#define FIELD_ENCODER_MODEL_HH
#include <Qt>
#include <QModelIndex>
#include <QStringListModel>
class FieldEncoderModel: public QAbstractItemModel {
public:
FieldEncoderModel();
Qt::ItemFlags flags(const QModelIndex& index) const override;
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
int columnCount(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;
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
QModelIndex parent(const QModelIndex &index) const override;
private:
QStringListModel* innerModel;
};
#endif /* FIELD_ENCODER_MODEL_HH */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment