Added capability to create editors from an editor factory to PgLabItemDelegate
This commit is contained in:
parent
62c6ad5bfb
commit
f8d61b61f4
3 changed files with 66 additions and 0 deletions
25
pglablib/AbstractEditorFactory.h
Normal file
25
pglablib/AbstractEditorFactory.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
#ifndef ABSTRACTEDITORFACTORY_H
|
||||
#define ABSTRACTEDITORFACTORY_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class QWidget;
|
||||
class QStyleOptionViewItem;
|
||||
class QModelIndex;
|
||||
class QAbstractItemModel;
|
||||
|
||||
/// Base class for factory classes that create item editors used in views.
|
||||
///
|
||||
/// Specifically the PgLabItemDelegate supports the use of EditorFactories.
|
||||
class AbstractEditorFactory: public QObject {
|
||||
Q_OBJECT
|
||||
public:
|
||||
using QObject::QObject;
|
||||
|
||||
virtual QWidget *createEditor (QWidget *parent, const QStyleOptionViewItem &option,
|
||||
const QModelIndex &index) const = 0;
|
||||
virtual void setEditorData(QWidget *editor, const QModelIndex &index) const = 0;
|
||||
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const = 0;
|
||||
};
|
||||
|
||||
#endif // ABSTRACTEDITORFACTORY_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue