Warning, file /include/QtWidgets/qstyleditemdelegate.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004 #ifndef QSTYLEDITEMDELEGATE_H
0005 #define QSTYLEDITEMDELEGATE_H
0006
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtWidgets/qabstractitemdelegate.h>
0009 #include <QtCore/qstring.h>
0010 #include <QtGui/qpixmap.h>
0011 #include <QtCore/qvariant.h>
0012
0013 QT_REQUIRE_CONFIG(itemviews);
0014
0015 QT_BEGIN_NAMESPACE
0016
0017 class QStyledItemDelegatePrivate;
0018 class QItemEditorFactory;
0019
0020 class Q_WIDGETS_EXPORT QStyledItemDelegate : public QAbstractItemDelegate
0021 {
0022 Q_OBJECT
0023
0024 public:
0025 explicit QStyledItemDelegate(QObject *parent = nullptr);
0026 ~QStyledItemDelegate();
0027
0028
0029 void paint(QPainter *painter,
0030 const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0031 QSize sizeHint(const QStyleOptionViewItem &option,
0032 const QModelIndex &index) const override;
0033
0034
0035 QWidget *createEditor(QWidget *parent,
0036 const QStyleOptionViewItem &option,
0037 const QModelIndex &index) const override;
0038
0039 void setEditorData(QWidget *editor, const QModelIndex &index) const override;
0040 void setModelData(QWidget *editor,
0041 QAbstractItemModel *model,
0042 const QModelIndex &index) const override;
0043
0044 void updateEditorGeometry(QWidget *editor,
0045 const QStyleOptionViewItem &option,
0046 const QModelIndex &index) const override;
0047
0048
0049 QItemEditorFactory *itemEditorFactory() const;
0050 void setItemEditorFactory(QItemEditorFactory *factory);
0051
0052 virtual QString displayText(const QVariant &value, const QLocale &locale) const;
0053
0054 protected:
0055 virtual void initStyleOption(QStyleOptionViewItem *option,
0056 const QModelIndex &index) const;
0057
0058 bool eventFilter(QObject *object, QEvent *event) override;
0059 bool editorEvent(QEvent *event, QAbstractItemModel *model,
0060 const QStyleOptionViewItem &option, const QModelIndex &index) override;
0061
0062 private:
0063 Q_DECLARE_PRIVATE(QStyledItemDelegate)
0064 Q_DISABLE_COPY(QStyledItemDelegate)
0065 };
0066
0067 QT_END_NAMESPACE
0068
0069 #endif