diff options
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r-- | src/widgets/itemviews/qabstractitemdelegate.cpp | 4 | ||||
-rw-r--r-- | src/widgets/itemviews/qabstractitemview.cpp | 2 | ||||
-rw-r--r-- | src/widgets/itemviews/qcolumnview_p.h | 1 | ||||
-rw-r--r-- | src/widgets/itemviews/qdatawidgetmapper.cpp | 1 | ||||
-rw-r--r-- | src/widgets/itemviews/qitemeditorfactory.cpp | 16 | ||||
-rw-r--r-- | src/widgets/itemviews/qlistwidget.cpp | 2 | ||||
-rw-r--r-- | src/widgets/itemviews/qtableview.cpp | 2 | ||||
-rw-r--r-- | src/widgets/itemviews/qtreewidget.cpp | 2 |
8 files changed, 16 insertions, 14 deletions
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp index 7bc0ece4b3..6e46eefa38 100644 --- a/src/widgets/itemviews/qabstractitemdelegate.cpp +++ b/src/widgets/itemviews/qabstractitemdelegate.cpp @@ -88,7 +88,7 @@ QT_BEGIN_NAMESPACE and is part of Qt's \l{Model/View Programming}{model/view framework}. To render an item in a custom way, you must implement paint() and - sizeHint(). The QItemDelegate class provides default implementations for + sizeHint(). The QStyledItemDelegate class provides default implementations for these functions; if you do not need custom rendering, subclass that class instead. @@ -115,7 +115,7 @@ QT_BEGIN_NAMESPACE The second approach is to handle user events directly by reimplementing editorEvent(). - \sa {model-view-programming}{Model/View Programming}, QItemDelegate, + \sa {model-view-programming}{Model/View Programming}, QStyledItemDelegate, {Pixelator Example}, QStyledItemDelegate, QStyle */ diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 638cee8289..1151379e17 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -3211,7 +3211,7 @@ bool QAbstractItemView::isPersistentEditorOpen(const QModelIndex &index) const This function should only be used to display static content within the visible area corresponding to an item of data. If you want to display custom dynamic content or implement a custom editor widget, subclass - QItemDelegate instead. + QStyledItemDelegate instead. \sa {Delegate Classes} */ diff --git a/src/widgets/itemviews/qcolumnview_p.h b/src/widgets/itemviews/qcolumnview_p.h index 9f0d2a40dc..7b36b1f3da 100644 --- a/src/widgets/itemviews/qcolumnview_p.h +++ b/src/widgets/itemviews/qcolumnview_p.h @@ -181,6 +181,7 @@ public: /*! * This is a delegate that will paint the triangle */ +// ### Qt6: QStyledItemDelegate class QColumnViewDelegate : public QItemDelegate { diff --git a/src/widgets/itemviews/qdatawidgetmapper.cpp b/src/widgets/itemviews/qdatawidgetmapper.cpp index 1f0dbff7a9..125ee73194 100644 --- a/src/widgets/itemviews/qdatawidgetmapper.cpp +++ b/src/widgets/itemviews/qdatawidgetmapper.cpp @@ -324,6 +324,7 @@ void QDataWidgetMapperPrivate::_q_modelDestroyed() QDataWidgetMapper::QDataWidgetMapper(QObject *parent) : QObject(*new QDataWidgetMapperPrivate, parent) { + // ### Qt6: QStyledItemDelegate setItemDelegate(new QItemDelegate(this)); } diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp index 0986da9707..43dd004530 100644 --- a/src/widgets/itemviews/qitemeditorfactory.cpp +++ b/src/widgets/itemviews/qitemeditorfactory.cpp @@ -122,7 +122,7 @@ Q_SIGNALS: \inmodule QtWidgets When editing data in an item view, editors are created and - displayed by a delegate. QItemDelegate, which is the delegate by + displayed by a delegate. QStyledItemDelegate, which is the delegate by default installed on Qt's item views, uses a QItemEditorFactory to create editors for it. A default unique instance provided by QItemEditorFactory is used by all item delegates. If you set a @@ -156,7 +156,7 @@ Q_SIGNALS: Additional editors can be registered with the registerEditor() function. - \sa QItemDelegate, {Model/View Programming}, {Color Editor Factory Example} + \sa QStyledItemDelegate, {Model/View Programming}, {Color Editor Factory Example} */ /*! @@ -375,7 +375,7 @@ void QItemEditorFactory::setDefaultFactory(QItemEditorFactory *factory) QItemEditorCreatorBase objects are specialized widget factories that provide editor widgets for one particular QVariant data type. They are used by QItemEditorFactory to create editors for - \l{QItemDelegate}s. Creator bases must be registered with + \l{QStyledItemDelegate}s. Creator bases must be registered with QItemEditorFactory::registerEditor(). An editor should provide a user property for the data it edits. @@ -457,7 +457,7 @@ QItemEditorCreatorBase::~QItemEditorCreatorBase() \snippet code/src_gui_itemviews_qitemeditorfactory.cpp 1 The constructor takes the name of the property that contains the - editing data. QItemDelegate can then access the property by name + editing data. QStyledItemDelegate can then access the property by name when it sets and retrieves editing data. Only use this class if your editor does not define a user property (using the USER keyword in the Q_PROPERTY macro). If the widget has a user @@ -472,7 +472,7 @@ QItemEditorCreatorBase::~QItemEditorCreatorBase() Constructs an editor creator object using \a valuePropertyName as the name of the property to be used for editing. The - property name is used by QItemDelegate when setting and + property name is used by QStyledItemDelegate when setting and getting editor data. Note that the \a valuePropertyName is only used if the editor @@ -508,11 +508,11 @@ QItemEditorCreatorBase::~QItemEditorCreatorBase() \snippet code/src_gui_itemviews_qitemeditorfactory.cpp 2 Setting the \c editorFactory created above in an item delegate via - QItemDelegate::setItemEditorFactory() makes sure that all values of type + QStyledItemDelegate::setItemEditorFactory() makes sure that all values of type QVariant::DateTime will be edited in \c{MyFancyDateTimeEdit}. The editor must provide a user property that will contain the - editing data. The property is used by \l{QItemDelegate}s to set + editing data. The property is used by \l{QStyledItemDelegate}s to set and retrieve the data (using Qt's \l{Meta-Object System}{meta-object system}). You set the user property with the USER keyword: @@ -520,7 +520,7 @@ QItemEditorCreatorBase::~QItemEditorCreatorBase() \snippet code/src_gui_itemviews_qitemeditorfactory.cpp 3 \sa QItemEditorCreatorBase, QItemEditorCreator, - QItemEditorFactory, QItemDelegate, {Color Editor Factory Example} + QItemEditorFactory, QStyledItemDelegate, {Color Editor Factory Example} */ /*! diff --git a/src/widgets/itemviews/qlistwidget.cpp b/src/widgets/itemviews/qlistwidget.cpp index ea92c5605b..3b3a72cd4f 100644 --- a/src/widgets/itemviews/qlistwidget.cpp +++ b/src/widgets/itemviews/qlistwidget.cpp @@ -1757,7 +1757,7 @@ QWidget *QListWidget::itemWidget(QListWidgetItem *item) const This function should only be used to display static content in the place of a list widget item. If you want to display custom dynamic content or - implement a custom editor widget, use QListView and subclass QItemDelegate + implement a custom editor widget, use QListView and subclass QStyledItemDelegate instead. \sa itemWidget(), removeItemWidget(), {Delegate Classes} diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index fce6b75079..a7d144672c 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -1108,7 +1108,7 @@ int QTableViewPrivate::heightHintForIndex(const QModelIndex &index, int hint, QS \l showGrid property. The items shown in a table view, like those in the other item views, are - rendered and edited using standard \l{QItemDelegate}{delegates}. However, + rendered and edited using standard \l{QStyledItemDelegate}{delegates}. However, for some tasks it is sometimes useful to be able to insert widgets in a table instead. Widgets are set for particular indexes with the \l{QAbstractItemView::}{setIndexWidget()} function, and diff --git a/src/widgets/itemviews/qtreewidget.cpp b/src/widgets/itemviews/qtreewidget.cpp index ac117b1c07..1923f5edc1 100644 --- a/src/widgets/itemviews/qtreewidget.cpp +++ b/src/widgets/itemviews/qtreewidget.cpp @@ -3101,7 +3101,7 @@ QWidget *QTreeWidget::itemWidget(QTreeWidgetItem *item, int column) const This function should only be used to display static content in the place of a tree widget item. If you want to display custom dynamic content or - implement a custom editor widget, use QTreeView and subclass QItemDelegate + implement a custom editor widget, use QTreeView and subclass QStyledItemDelegate instead. This function cannot be called before the item hierarchy has been set up, |