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 "QtGui/qregion.h"
28#include "QtCore/qdebug.h"
29#include "QtCore/qbasictimer.h"
30#include "QtCore/qelapsedtimer.h"
31#include <QtCore/qpointer.h>
76 virtual void modelDestroyed();
77 virtual void layoutChanged();
90 bool shouldAutoScroll(
const QPoint &
pos)
const;
91 void doDelayedItemsLayout(
int delay = 0);
92 void interruptDelayedItemsLayout()
const;
94 void updateGeometry();
99 autoScrollTimer.start(scrollInterval, q_func());
104#if QT_CONFIG(draganddrop)
115 QItemSelectionModel::SelectionFlags multiSelectionCommand(
const QModelIndex &
index,
117 QItemSelectionModel::SelectionFlags extendedSelectionCommand(
const QModelIndex &
index,
119 QItemSelectionModel::SelectionFlags contiguousSelectionCommand(
const QModelIndex &
index,
121 virtual void selectAll(QItemSelectionModel::SelectionFlags command);
130 switch (selectionBehavior) {
137#if QT_CONFIG(draganddrop)
140 inline bool canDrop(QDropEvent *
event) {
147 for (
const auto &modelType : modelTypes) {
148 if (
mime->hasFormat(modelType))
188 editor->removeEventFilter(itemDelegate);
195 editor->deleteLater();
201 interruptDelayedItemsLayout();
207 updateRegion += visualRegion;
208 if (!updateTimer.isActive())
209 updateTimer.start(0, q_func());
213 scrollDelayOffset =
QPoint(-dx, -dy);
215 scrollDelayOffset =
QPoint(0, 0);
219 scrollDirtyRegion(dx, dy);
229 void clearOrRemove();
230 void checkPersistentEditorFocus();
236 return QPoint(
q->isRightToLeft() ? -
q->horizontalOffset()
237 :
q->horizontalOffset(),
q->verticalOffset());
245 void removeEditor(
QWidget *editor);
260#if QT_CONFIG(draganddrop)
271 return isIndexValid(
index) && isIndexSelectable(
index);
277 return QPoint(
q->horizontalOffset(),
q->verticalOffset());
287 if (itemDelegate == delegate)
290 for (
int maps = 0; maps < 2; ++maps) {
291 const QMap<int, QPointer<QAbstractItemDelegate> > *delegates = maps ? &columnDelegates : &rowDelegates;
292 for (
QMap<
int, QPointer<QAbstractItemDelegate> >::const_iterator
it = delegates->
begin();
293 it != delegates->
end(); ++
it) {
294 if (
it.value() == delegate) {
314#if QT_CONFIG(draganddrop)
316 void maybeStartDrag(
QPoint eventPoint);
324 if (!delayedReset.isActive())
325 delayedReset.start(0, q_func());
371#if QT_CONFIG(draganddrop)
372 bool showDropIndicator;
373 QRect dropIndicatorRect;
375 QAbstractItemView::DragDropMode dragDropMode;
378 QAbstractItemView::DropIndicatorPosition dropIndicatorPosition;
408#ifndef QT_NO_GESTURES
428#if QT_CONFIG(gestures) && QT_CONFIG(scroller)
435 void disconnectAll();
437 QMap<int, QPointer<QAbstractItemDelegate> >::ConstIterator
it;
439 it = rowDelegates.find(
index.row());
440 if (
it != rowDelegates.end())
443 it = columnDelegates.find(
index.column());
444 if (
it != columnDelegates.end())
463 if (vec.at(
i) >
item)
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
void scrollerStateChanged()
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
std::array< QMetaObject::Connection, 4 > scrollbarConnections
virtual QRect visualRect(const QModelIndex &index) const
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
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
std::array< QMetaObject::Connection, 14 > modelConnections
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.
virtual void editorDestroyed(QObject *editor)
This function is called when the given editor has been destroyed.
Qt::ItemFlags flags(const QModelIndex &index) const override
\reimp
SelectionFlag
This enum describes the way the selection model will be updated.
static bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member)
\threadsafe
QScopedPointer< QObjectData > d_ptr
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
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