42 #ifndef QABSTRACTITEMVIEW_H 43 #define QABSTRACTITEMVIEW_H 45 #include <QtGui/qabstractscrollarea.h> 46 #include <QtCore/qabstractitemmodel.h> 47 #include <QtGui/qitemselectionmodel.h> 48 #include <QtGui/qabstractitemdelegate.h> 56 #ifndef QT_NO_ITEMVIEWS 70 EditTriggers editTriggers;
71 bool tabKeyNavigation;
72 #ifndef QT_NO_DRAGANDDROP 147 void setEditTriggers(EditTriggers triggers);
148 EditTriggers editTriggers()
const;
153 void setHorizontalScrollMode(
ScrollMode mode);
156 void setAutoScroll(
bool enable);
157 bool hasAutoScroll()
const;
159 void setAutoScrollMargin(
int margin);
160 int autoScrollMargin()
const;
162 void setTabKeyNavigation(
bool enable);
163 bool tabKeyNavigation()
const;
165 #ifndef QT_NO_DRAGANDDROP 166 void setDropIndicatorShown(
bool enable);
167 bool showDropIndicator()
const;
169 void setDragEnabled(
bool enable);
170 bool dragEnabled()
const;
172 void setDragDropOverwriteMode(
bool overwrite);
173 bool dragDropOverwriteMode()
const;
183 void setDragDropMode(DragDropMode behavior);
184 DragDropMode dragDropMode()
const;
190 void setAlternatingRowColors(
bool enable);
191 bool alternatingRowColors()
const;
193 void setIconSize(
const QSize &size);
194 QSize iconSize()
const;
199 virtual void keyboardSearch(
const QString &search);
206 virtual int sizeHintForRow(
int row)
const;
207 virtual int sizeHintForColumn(
int column)
const;
225 #ifdef Q_NO_USING_KEYWORD 232 virtual void reset();
234 virtual void doItemsLayout();
235 virtual void selectAll();
237 void clearSelection();
240 void scrollToBottom();
245 virtual void rowsInserted(
const QModelIndex &parent,
int start,
int end);
246 virtual void rowsAboutToBeRemoved(
const QModelIndex &parent,
int start,
int end);
249 virtual void updateEditorData();
250 virtual void updateEditorGeometries();
251 virtual void updateGeometries();
252 virtual void verticalScrollbarAction(
int action);
253 virtual void horizontalScrollbarAction(
int action);
254 virtual void verticalScrollbarValueChanged(
int value);
255 virtual void horizontalScrollbarValueChanged(
int value);
257 virtual void commitData(
QWidget *editor);
258 virtual void editorDestroyed(
QObject *editor);
267 void viewportEntered();
272 void setHorizontalStepsPerItem(
int steps);
273 int horizontalStepsPerItem()
const;
274 void setVerticalStepsPerItem(
int steps);
275 int verticalStepsPerItem()
const;
279 MoveNext, MovePrevious };
281 Qt::KeyboardModifiers modifiers) = 0;
283 virtual int horizontalOffset()
const = 0;
284 virtual int verticalOffset()
const = 0;
288 virtual void setSelection(
const QRect &rect, QItemSelectionModel::SelectionFlags command) = 0;
294 virtual QItemSelectionModel::SelectionFlags selectionCommand(
const QModelIndex &
index,
297 #ifndef QT_NO_DRAGANDDROP 298 virtual void startDrag(Qt::DropActions supportedActions);
314 void setState(
State state);
316 void scheduleDelayedItemsLayout();
317 void executeDelayedItemsLayout();
319 void setDirtyRegion(
const QRegion ®ion);
320 void scrollDirtyRegion(
int dx,
int dy);
321 QPoint dirtyRegionOffset()
const;
323 void startAutoScroll();
324 void stopAutoScroll();
334 #ifndef QT_NO_DRAGANDDROP 347 #ifndef QT_NO_DRAGANDDROP 372 #endif // QT_NO_ITEMVIEWS 378 #endif // QABSTRACTITEMVIEW_H The QVariant class acts like a union for the most common Qt data types.
bool dragEnabled
whether the view supports dragging of its own items
SelectionMode
This enum indicates how the view responds to user selections:
The QAbstractItemDelegate class is used to display and edit data items from a model.
The QKeyEvent class describes a key event.
The QItemSelectionModel class keeps track of a view's selected items.
#define QT_END_NAMESPACE
This macro expands to.
The QDrag class provides support for MIME-based drag and drop data transfer.
QPointer< QWidget > widget
#define Q_DECLARE_FLAGS(Flags, Enum)
The Q_DECLARE_FLAGS() macro expands to.
Q_CORE_EXPORT QTextStream & reset(QTextStream &s)
Qt::TextElideMode textElideMode
the position of the "..." in elided text.
virtual void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
ScrollMode verticalScrollMode
how the view scrolls its contents in the vertical direction
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
DropIndicatorPosition
This enum indicates the position of the drop indicator in relation to the index at the current mouse ...
The QString class provides a Unicode character string.
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
The QObject class is the base class of all Qt objects.
SelectionMode selectionMode
which selection mode the view operates in
static QCursor * moveCursor
bool dragDropOverwriteMode
the view's drag and drop behavior
#define QT_BEGIN_NAMESPACE
This macro expands to.
#define Q_DECLARE_OPERATORS_FOR_FLAGS(Flags)
The Q_DECLARE_OPERATORS_FOR_FLAGS() macro declares global operator|() functions for Flags...
ScrollMode horizontalScrollMode
how the view scrolls its contents in the horizontal direction
The QResizeEvent class contains event parameters for resize events.
Qt::DropAction defaultDropAction
the drop action that will be used by default in QAbstractItemView::drag()
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
The QRegion class specifies a clip region for a painter.
The State element defines configurations of objects and properties.
DragDropMode
Describes the various drag and drop events the view can act upon.
The QAbstractItemModel class provides the abstract interface for item model classes.
The QMouseEvent class contains parameters that describe a mouse event.
The QAbstractItemView class provides the basic functionality for item view classes.
The QItemSelection class manages information about selected items in a model.
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
The QTimerEvent class contains parameters that describe a timer event.
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
The QPoint class defines a point in the plane using integer precision.
The QModelIndex class is used to locate data in a data model.
The QRect class defines a rectangle in the plane using integer precision.
bool showDropIndicator
whether the drop indicator is shown when dragging items and dropping.
DragDropMode dragDropMode
the drag and drop event the view will act upon
EndEditHint
This enum describes the different hints that the delegate can give to the model and view components t...
EditTrigger
This enum describes actions which will initiate item editing.
The QSize class defines the size of a two-dimensional object using integer point precision.
#define Q_DECLARE_PRIVATE(Class)
CursorAction
This enum describes the different ways to navigate between items,.
QSize iconSize
the size of items' icons
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
static const KeyPair *const end
bool alternatingRowColors
whether to draw the background using alternating colors
SelectionBehavior selectionBehavior
which selection behavior the view uses
The QEvent class is the base class of all event classes.
The QFocusEvent class contains event parameters for widget focus events.
static void visualRect(QRectF *geom, Qt::LayoutDirection dir, const QRectF &contentsRect)