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
19
pglablib/AbstractModelFactory.h
Normal file
19
pglablib/AbstractModelFactory.h
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
#ifndef ABSTRACTMODELFACTORY_H
|
||||
#define ABSTRACTMODELFACTORY_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QAbstractItemModel;
|
||||
|
||||
class AbstractModelFactory: public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
using QObject::QObject;
|
||||
|
||||
/// Create instance of a model
|
||||
///
|
||||
/// \param parent Will be passed to the constructor of the model.
|
||||
virtual QAbstractItemModel* createModel(QObject *parent = nullptr) const = 0;
|
||||
};
|
||||
|
||||
#endif // ABSTRACTMODELFACTORY_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue