4#ifndef QABSTRACTITEMVIEW_P_H
5#define QABSTRACTITEMVIEW_P_H
18#include <QtWidgets/private/qtwidgetsglobal_p.h>
20#include "private/qabstractscrollarea_p.h"
21#include "private/qabstractitemmodel_p.h"
22#include "QtWidgets/qapplication.h"
23#include "QtGui/qevent.h"
24#include "QtCore/qmimedata.h"
25#include "QtGui/qpainter.h"
26#include "QtCore/qpair.h"
27#include "QtGui/qregion.h"
28#include "QtCore/qdebug.h"
29#include "QtCore/qbasictimer.h"
30#include "QtCore/qelapsedtimer.h"
72 virtual void _q_modelDestroyed();
73 virtual void _q_layoutChanged();
86 bool shouldAutoScroll(
const QPoint &
pos)
const;
87 void doDelayedItemsLayout(
int delay = 0);
88 void interruptDelayedItemsLayout()
const;
90 void updateGeometry();
95 autoScrollTimer.start(scrollInterval, q_func());
100#if QT_CONFIG(draganddrop)
111 QItemSelectionModel::SelectionFlags multiSelectionCommand(
const QModelIndex &
index,
113 QItemSelectionModel::SelectionFlags extendedSelectionCommand(
const QModelIndex &
index,
115 QItemSelectionModel::SelectionFlags contiguousSelectionCommand(
const QModelIndex &
index,
117 virtual void selectAll(QItemSelectionModel::SelectionFlags command);
126 switch (selectionBehavior) {
133#if QT_CONFIG(draganddrop)
136 inline bool canDrop(QDropEvent *
event) {
143 for (
const auto &modelType : modelTypes) {
144 if (
mime->hasFormat(modelType))
184 editor->removeEventFilter(itemDelegate);
191 editor->deleteLater();
197 interruptDelayedItemsLayout();
203 updateRegion += visualRegion;
204 if (!updateTimer.isActive())
205 updateTimer.start(0, q_func());
209 scrollDelayOffset =
QPoint(-dx, -dy);
211 scrollDelayOffset =
QPoint(0, 0);
215 scrollDirtyRegion(dx, dy);
225 void clearOrRemove();
226 void checkPersistentEditorFocus();
232 return QPoint(
q->isRightToLeft() ? -
q->horizontalOffset()
233 :
q->horizontalOffset(),
q->verticalOffset());
241 void removeEditor(
QWidget *editor);
256#if QT_CONFIG(draganddrop)
267 return isIndexValid(
index) && isIndexSelectable(
index);
273 return QPoint(
q->horizontalOffset(),
q->verticalOffset());
283 if (itemDelegate == delegate)
286 for (
int maps = 0; maps < 2; ++maps) {
289 it != delegates->
end(); ++
it) {
290 if (
it.value() == delegate) {
310#if QT_CONFIG(draganddrop)
312 void maybeStartDrag(
QPoint eventPoint);
320 if (!delayedReset.isActive())
321 delayedReset.start(0, q_func());
367#if QT_CONFIG(draganddrop)
368 bool showDropIndicator;
369 QRect dropIndicatorRect;
371 QAbstractItemView::DragDropMode dragDropMode;
374 QAbstractItemView::DropIndicatorPosition dropIndicatorPosition;
404#ifndef QT_NO_GESTURES
425 if (
it != rowDelegates.
end())
429 if (
it != columnDelegates.
end())
The QAbstractItemDelegate class is used to display and edit data items from a model.
virtual void destroyEditor(QWidget *editor, const QModelIndex &index) const
Called when the editor is no longer needed for editing the data item with the given index and should ...
virtual Qt::DropActions supportedDropActions() const
virtual bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const
Returns {true} if a model can accept a drop of the data.
virtual QStringList mimeTypes() const
Returns the list of allowed MIME types.
QBasicTimer autoScrollTimer
bool verticalScrollModeSet
virtual void adjustViewOptionsForIndex(QStyleOptionViewItem *, const QModelIndex &) const
QBasicTimer delayedAutoScroll
QSet< QWidget * > persistent
QWidget * currentlyCommittingEditor
bool moveCursorUpdatedView
QPointer< QAbstractItemDelegate > itemDelegate
void checkMouseMove(const QPoint &pos)
bool delayedPendingLayout
QMap< int, QPointer< QAbstractItemDelegate > > columnDelegates
QIndexEditorHash indexEditorHash
void scrollContentsBy(int dx, int dy)
QAbstractItemView::EditTriggers editTriggers
bool viewportEnteredNeeded
QAbstractItemView::EditTrigger lastTrigger
QPersistentModelIndex currentSelectionStartIndex
QElapsedTimer keyboardInputTime
QAbstractItemView::ScrollMode horizontalScrollMode
QMap< int, QPointer< QAbstractItemDelegate > > rowDelegates
bool horizontalScrollModeSet
QAbstractItemView::State state
QPointer< QItemSelectionModel > selectionModel
bool isPersistent(const QModelIndex &index) const
QItemSelectionModel::SelectionFlag ctrlDragSelectionFlag
QItemSelectionModel::SelectionFlags selectionBehaviorFlags() const
QBasicTimer pressClosedEditorWatcher
QAbstractItemView::State stateBeforeAnimation
Qt::KeyboardModifiers pressedModifiers
QPersistentModelIndex root
bool droppingOnItself(QDropEvent *event, const QModelIndex &index)
QPoint contentsOffset() const override
virtual bool selectionAllowed(const QModelIndex &index) const
bool releaseFromDoubleClick
QPersistentModelIndex pressedIndex
bool isIndexSelectable(const QModelIndex &index) const
QAbstractItemModel * model
QAbstractItemView::SelectionMode selectionMode
QPersistentModelIndex lastEditedIndex
Qt::TextElideMode textElideMode
QPersistentModelIndex enteredIndex
bool isIndexValid(const QModelIndex &index) const
void _q_headerDataChanged()
QItemSelection oldSelection
bool shouldClearStatusTip
bool pressedAlreadySelected
void releaseEditor(QWidget *editor, const QModelIndex &index=QModelIndex()) const
void executePostedLayout() const
int delegateRefCount(const QAbstractItemDelegate *delegate) const
QEditorIndexHash editorIndexHash
QBasicTimer delayedEditing
bool shouldScrollToCurrentOnShow
QAbstractItemView::SelectionBehavior selectionBehavior
void setDirtyRegion(const QRegion &visualRegion)
QAbstractItemView::ScrollMode verticalScrollMode
void scrollDirtyRegion(int dx, int dy)
bool noSelectionOnMousePress
QPersistentModelIndex hover
bool isIndexEnabled(const QModelIndex &index) const
void _q_scrollerStateChanged()
The QAbstractItemView class provides the basic functionality for item view classes.
SelectionMode
This enum indicates how the view responds to user selections:
SelectionBehavior
\value SelectItems Selecting single items.
State
Describes the different states the view can be in.
EditTrigger
This enum describes actions which will initiate item editing.
Qt::ItemFlags flags(const QModelIndex &index) const override
\reimp
SelectionFlag
This enum describes the way the selection model will be updated.
const_reference at(qsizetype i) const noexcept
iterator find(const Key &key)
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
QScopedPointer< QObjectData > d_ptr
The QPainter class performs low-level painting on widgets and other paint devices.
Returns a copy of the pixmap that is transformed using the given transformation transform and transfo...
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
The QRegion class specifies a clip region for a painter.
T * data() const noexcept
Returns the value of the pointer referenced by this object.
\macro QT_RESTRICTED_CAST_FROM_ASCII
The QStyleOption class stores the parameters used by QStyle functions.
void initFrom(const QWidget *w)
@ PE_IndicatorItemViewItemDrop
QSet< QString >::iterator it
Combined button and popup list for selecting options.
QT_BEGIN_INCLUDE_NAMESPACE QT_END_INCLUDE_NAMESPACE int qBinarySearch(const QList< T > &vec, const T &item, int start, int end)
QHash< QPersistentModelIndex, QEditorInfo > QIndexEditorHash
QHash< QWidget *, QPersistentModelIndex > QEditorIndexHash
QList< QItemViewPaintPair > QItemViewPaintPairs
static jboolean selectAll(JNIEnv *, jobject)
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char return DBusMessage return DBusMessage const char * destination
GLfloat GLfloat GLfloat w
[0]
GLsizei GLsizei GLchar * source
GLdouble GLdouble GLdouble GLdouble q
GLenum GLenum GLsizei void * row
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
#define QT_BEGIN_INCLUDE_NAMESPACE
#define Q_AUTOTEST_EXPORT
#define QT_END_INCLUDE_NAMESPACE
#define QT_REQUIRE_CONFIG(feature)
static QT_BEGIN_NAMESPACE void init(QTextBoundaryFinder::BoundaryType type, QStringView str, QCharAttributes *attributes)
QSqlQueryModel * model
[16]
application x qt windows mime
[2]
view viewport() -> scroll(dx, dy, deviceRect)
QEditorInfo(QWidget *e, bool s)
QPointer< QWidget > widget
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent