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
|
|
@ -3,6 +3,8 @@
|
|||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
class AbstractEditorFactory;
|
||||
|
||||
/** Delegate for rendering SQL data types in tableviews
|
||||
*
|
||||
* This delegate removes the need for the model to provide formatting information
|
||||
|
|
@ -16,9 +18,18 @@ public:
|
|||
|
||||
virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
|
||||
QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
void setEditorData(QWidget *editor, const QModelIndex &index) const override;
|
||||
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override;
|
||||
|
||||
AbstractEditorFactory* editorFactory();
|
||||
void setEditorFactory(AbstractEditorFactory *editor_factory);
|
||||
|
||||
protected:
|
||||
virtual void initStyleOption(QStyleOptionViewItem *option, const QModelIndex &index) const override;
|
||||
|
||||
private:
|
||||
AbstractEditorFactory *m_editorFactory = nullptr;
|
||||
};
|
||||
|
||||
#endif // PGLABITEMDELEGATE_H
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue