Added model & delegate
This commit is contained in:
26
bcvaluedelegate.h
Normal file
26
bcvaluedelegate.h
Normal file
@@ -0,0 +1,26 @@
|
||||
// BCValueDelegate.h
|
||||
#ifndef BCVALUEDELEGATE_H
|
||||
#define BCVALUEDELEGATE_H
|
||||
|
||||
|
||||
#include <QStyledItemDelegate>
|
||||
|
||||
class BCValueDelegate : public QStyledItemDelegate
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit BCValueDelegate(QObject *parent = nullptr);
|
||||
|
||||
// WICHTIG: Zuständig für die normale Anzeige (ohne Editor)
|
||||
QString displayText(const QVariant &value, const QLocale &locale) const override;
|
||||
|
||||
// Zuständig für den Edit-Modus (Doppelklick)
|
||||
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;
|
||||
void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
|
||||
};
|
||||
|
||||
|
||||
#endif // BCVALUEDELEGATE_H
|
||||
Reference in New Issue
Block a user