SelectionEditorFactory for creating combobox selections for use in QTableView.
TypeSelectionItemModelFactory to use the TypeSelectionItemModel with above factory.
This commit is contained in:
parent
f8d61b61f4
commit
e44f73166f
7 changed files with 138 additions and 0 deletions
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef TYPESELECTIONITEMMODEL_H
|
||||
#define TYPESELECTIONITEMMODEL_H
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
class PgTypeContainer;
|
||||
|
||||
class TypeSelectionItemModel : public QAbstractListModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit TypeSelectionItemModel(QObject *parent = 0);
|
||||
|
||||
void setTypeList(std::shared_ptr<const PgTypeContainer> types);
|
||||
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
|
||||
private:
|
||||
std::vector<QString> m_types;
|
||||
};
|
||||
|
||||
#endif // TYPESELECTIONITEMMODEL_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue