Added model & delegate

This commit is contained in:
2025-12-17 16:26:22 +01:00
parent 8813904e2b
commit 09ff2f00bb
4 changed files with 298 additions and 0 deletions

26
bcvaluedelegate.h Normal file
View 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