4#ifndef QABSTRACTITEMVIEW_H
5#define QABSTRACTITEMVIEW_H
7#include <QtWidgets/qtwidgetsglobal.h>
8#include <QtWidgets/qabstractscrollarea.h>
9#include <QtCore/qabstractitemmodel.h>
10#include <QtCore/qitemselectionmodel.h>
11#include <QtWidgets/qabstractitemdelegate.h>
13class tst_QAbstractItemView;
28 Q_PROPERTY(
bool autoScroll READ hasAutoScroll WRITE setAutoScroll)
29 Q_PROPERTY(
int autoScrollMargin READ autoScrollMargin WRITE setAutoScrollMargin)
31 Q_PROPERTY(
bool tabKeyNavigation READ tabKeyNavigation WRITE setTabKeyNavigation)
32#if QT_CONFIG(draganddrop)
33 Q_PROPERTY(
bool showDropIndicator READ showDropIndicator WRITE setDropIndicatorShown)
34 Q_PROPERTY(
bool dragEnabled READ dragEnabled WRITE setDragEnabled)
35 Q_PROPERTY(
bool dragDropOverwriteMode READ dragDropOverwriteMode WRITE setDragDropOverwriteMode)
36 Q_PROPERTY(DragDropMode dragDropMode READ dragDropMode WRITE setDragDropMode)
39 Q_PROPERTY(
bool alternatingRowColors READ alternatingRowColors WRITE setAlternatingRowColors)
42 WRITE setSelectionBehavior)
46 RESET resetVerticalScrollMode)
48 WRITE setHorizontalScrollMode RESET resetHorizontalScrollMode)
116 EditTriggers editTriggers()
const;
118 void setVerticalScrollMode(ScrollMode
mode);
119 ScrollMode verticalScrollMode()
const;
120 void resetVerticalScrollMode();
122 void setHorizontalScrollMode(ScrollMode
mode);
123 ScrollMode horizontalScrollMode()
const;
124 void resetHorizontalScrollMode();
126 void setAutoScroll(
bool enable);
127 bool hasAutoScroll()
const;
129 void setAutoScrollMargin(
int margin);
130 int autoScrollMargin()
const;
132 void setTabKeyNavigation(
bool enable);
133 bool tabKeyNavigation()
const;
135#if QT_CONFIG(draganddrop)
136 void setDropIndicatorShown(
bool enable);
137 bool showDropIndicator()
const;
139 void setDragEnabled(
bool enable);
140 bool dragEnabled()
const;
142 void setDragDropOverwriteMode(
bool overwrite);
143 bool dragDropOverwriteMode()
const;
154 void setDragDropMode(DragDropMode behavior);
155 DragDropMode dragDropMode()
const;
161 void setAlternatingRowColors(
bool enable);
162 bool alternatingRowColors()
const;
170 virtual void keyboardSearch(
const QString &search);
177 virtual int sizeHintForRow(
int row)
const;
178 virtual int sizeHintForColumn(
int column)
const;
193#if QT_DEPRECATED_SINCE(6, 0)
196 {
return itemDelegateForIndex(
index); }
202 using QAbstractScrollArea::update;
205 virtual void reset();
207 virtual void doItemsLayout();
210 void clearSelection();
213 void scrollToBottom();
223 virtual void updateEditorData();
224 virtual void updateEditorGeometries();
225 virtual void updateGeometries();
226 virtual void verticalScrollbarAction(
int action);
227 virtual void horizontalScrollbarAction(
int action);
228 virtual void verticalScrollbarValueChanged(
int value);
229 virtual void horizontalScrollbarValueChanged(
int value);
231 virtual void commitData(
QWidget *editor);
232 virtual void editorDestroyed(
QObject *editor);
265 virtual QItemSelectionModel::SelectionFlags selectionCommand(
const QModelIndex &
index,
268#if QT_CONFIG(draganddrop)
269 virtual void startDrag(Qt::DropActions supportedActions);
272 virtual void initViewItemOption(QStyleOptionViewItem *
option)
const;
287 void scheduleDelayedItemsLayout();
288 void executeDelayedItemsLayout();
290 void setDirtyRegion(
const QRegion ®ion);
291 void scrollDirtyRegion(
int dx,
int dy);
292 QPoint dirtyRegionOffset()
const;
294 void startAutoScroll();
295 void stopAutoScroll();
298 bool focusNextPrevChild(
bool next)
override;
305#if QT_CONFIG(draganddrop)
306 void dragEnterEvent(QDragEnterEvent *
event)
override;
307 void dragMoveEvent(QDragMoveEvent *
event)
override;
308 void dragLeaveEvent(QDragLeaveEvent *
event)
override;
309 void dropEvent(QDropEvent *
event)
override;
319#if QT_CONFIG(draganddrop)
320 enum DropIndicatorPosition { OnItem, AboveItem, BelowItem, OnViewport };
321 DropIndicatorPosition dropIndicatorPosition()
const;
324 QSize viewportSizeHint()
const override;
339#if QT_CONFIG(gestures) && QT_CONFIG(scroller)
344 friend class ::tst_QAbstractItemView;
345 friend class ::tst_QTreeView;
The QAbstractItemDelegate class is used to display and edit data items from a model.
EndEditHint
This enum describes the different hints that the delegate can give to the model and view components t...
The QAbstractItemView class provides the basic functionality for item view classes.
virtual QRect visualRect(const QModelIndex &index) const =0
Returns the rectangle on the viewport occupied by the item at index.
SelectionMode
This enum indicates how the view responds to user selections:
void activated(const QModelIndex &index)
This signal is emitted when the item specified by index is activated by the user.
virtual QRegion visualRegionForSelection(const QItemSelection &selection) const =0
Returns the region from the viewport of the items in the given selection.
void iconSizeChanged(const QSize &size)
virtual void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)=0
Applies the selection flags to the items in or touched by the rectangle, rect.
virtual int verticalOffset() const =0
Returns the vertical offset of the view.
void doubleClicked(const QModelIndex &index)
This signal is emitted when a mouse button is double-clicked.
void entered(const QModelIndex &index)
This signal is emitted when the mouse cursor enters the item specified by index.
SelectionBehavior
\value SelectItems Selecting single items.
EditTrigger
This enum describes actions which will initiate item editing.
virtual void scrollTo(const QModelIndex &index, ScrollHint hint=EnsureVisible)=0
Scrolls the view if necessary to ensure that the item at index is visible.
virtual int horizontalOffset() const =0
Returns the horizontal offset of the view.
CursorAction
This enum describes the different ways to navigate between items,.
virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers)=0
Returns a QModelIndex object pointing to the next object in the view, based on the given cursorAction...
void pressed(const QModelIndex &index)
This signal is emitted when a mouse button is pressed.
ScrollHint
\value EnsureVisible Scroll to ensure that the item is visible.
void clicked(const QModelIndex &index)
This signal is emitted when a mouse button is left-clicked.
virtual bool isIndexHidden(const QModelIndex &index) const =0
Returns true if the item referred to by the given index is hidden in the view, otherwise returns fals...
virtual QModelIndex indexAt(const QPoint &point) const =0
Returns the model index of the item at the viewport coordinates point.
void viewportEntered()
This signal is emitted when the mouse cursor enters the viewport.
The QAbstractSlider class provides an integer value within a range.
The QFocusEvent class contains event parameters for widget focus events.
The QKeyEvent class describes a key event.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
The QResizeEvent class contains event parameters for resize events.
\macro QT_RESTRICTED_CAST_FROM_ASCII
EGLImageKHR int int EGLuint64KHR * modifiers
Combined button and popup list for selecting options.
static jboolean selectAll(JNIEnv *, jobject)
EGLOutputLayerEXT EGLint EGLAttrib value
[5]
#define Q_DECLARE_FLAGS(Flags, Enum)
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLenum GLenum GLsizei void GLsizei void * column
GLenum GLenum GLsizei void * row
static QT_BEGIN_NAMESPACE QVariant hint(QPlatformIntegration::StyleHint h)
#define QT_REQUIRE_CONFIG(feature)
#define QT_DEPRECATED_VERSION_X_6_0(text)
view setModel(model)
[17] //! [18]
QSqlQueryModel * model
[16]
view setEditTriggers(QAbstractItemView::NoEditTriggers)
[16] //! [19] //! [20]
setIndexWidget(index, new QLineEdit)
[0]
QItemSelection * selection
[0]
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent