Qt 4.8
Public Types | Public Functions | Public Variables | List of all members
QListViewPrivate Class Reference

#include <qlistview_p.h>

Inheritance diagram for QListViewPrivate:
QAbstractItemViewPrivate QAbstractScrollAreaPrivate QFramePrivate QWidgetPrivate QObjectPrivate QObjectData QListWidgetPrivate QUndoViewPrivate

Public Types

enum  ModeProperties {
  Wrap = 1, Spacing = 2, GridSize = 4, Flow = 8,
  Movement = 16, ResizeMode = 32, SelectionRectVisible = 64
}
 
- Public Types inherited from QWidgetPrivate
enum  CloseMode { CloseNoEvent, CloseWithEvent, CloseWithSpontaneousEvent }
 
enum  Direction { DirectionNorth = 0x01, DirectionEast = 0x10, DirectionSouth = 0x02, DirectionWest = 0x20 }
 
enum  DrawWidgetFlags {
  DrawAsRoot = 0x01, DrawPaintOnScreen = 0x02, DrawRecursive = 0x04, DrawInvisible = 0x08,
  DontSubtractOpaqueChildren = 0x10, DontSetCompositionMode = 0x20, DontDrawOpaqueChildren = 0x40, DontDrawNativeChildren = 0x80
}
 
- Public Types inherited from QObjectPrivate
typedef void(* StaticMetaCallFunction) (QObject *, QMetaObject::Call, int, void **)
 

Public Functions

int batchStartRow () const
 
void clear ()
 
QModelIndex closestIndex (const QRect &target, const QVector< QModelIndex > &candidates) const
 
QSize contentsSize () const
 
bool doItemsLayout (int num)
 
QItemViewPaintPairs draggablePaintPairs (const QModelIndexList &indexes, QRect *r) const
 Reimplemented Function More...
 
bool dropOn (QDropEvent *event, int *row, int *col, QModelIndex *index)
 If the event hasn't already been accepted, determines the index to drop on. More...
 
void emitIndexesMoved (const QModelIndexList &indexes)
 
int flipX (int x) const
 
QPoint flipX (const QPoint &p) const
 
QRect flipX (const QRect &r) const
 
QSize gridSize () const
 
int horizontalScrollToValue (const QModelIndex &index, const QRect &rect, QListView::ScrollHint hint) const
 
QListViewItem indexToListViewItem (const QModelIndex &index) const
 
QVector< QModelIndexintersectingSet (const QRect &area, bool doLayout=true) const
 
bool isHidden (int row) const
 
bool isHiddenOrDisabled (int row) const
 
bool isSelectionRectVisible () const
 
bool isWrapping () const
 
QSize itemSize (const QStyleOptionViewItem &option, const QModelIndex &index) const
 
QModelIndex listViewItemToIndex (const QListViewItem &item) const
 
QRect mapToViewport (const QRect &rect, bool extend=true) const
 
QModelIndex modelIndex (int row) const
 
virtual QAbstractItemView::DropIndicatorPosition position (const QPoint &pos, const QRect &rect, const QModelIndex &idx) const
 
void prepareItemsLayout ()
 
 QListViewPrivate ()
 
QRect rectForIndex (const QModelIndex &index) const
 
void removeCurrentAndDisabled (QVector< QModelIndex > *indexes, const QModelIndex &current) const
 
void resetBatchStartRow ()
 
void scrollElasticBandBy (int dx, int dy)
 
void selectAll (QItemSelectionModel::SelectionFlags command)
 
QItemSelection selection (const QRect &rect) const
 
bool selectionAllowed (const QModelIndex &index) const
 
void setContentsSize (int w, int h)
 
void setGridSize (const QSize &size)
 
void setSelectionRectVisible (bool visible)
 
void setSpacing (int s)
 
void setWrapping (bool b)
 
int spacing () const
 
int verticalScrollToValue (const QModelIndex &index, const QRect &rect, QListView::ScrollHint hint) const
 
QRect viewItemRect (const QListViewItem &item) const
 
void viewUpdateGeometries ()
 
 ~QListViewPrivate ()
 
- Public Functions inherited from QAbstractItemViewPrivate
virtual void _q_columnsAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 This slot is called when columns are about to be removed. More...
 
virtual void _q_columnsInserted (const QModelIndex &parent, int start, int end)
 This slot is called when columns have been inserted. More...
 
virtual void _q_columnsRemoved (const QModelIndex &parent, int start, int end)
 This slot is called when columns have been removed. More...
 
void _q_headerDataChanged ()
 
virtual void _q_layoutChanged ()
 This slot is called when the layout is changed. More...
 
virtual void _q_modelDestroyed ()
 
virtual void _q_rowsInserted (const QModelIndex &parent, int start, int end)
 This slot is called when rows have been inserted. More...
 
virtual void _q_rowsRemoved (const QModelIndex &parent, int start, int end)
 This slot is called when rows have been removed. More...
 
void addEditor (const QModelIndex &index, QWidget *editor, bool isStatic)
 
virtual void adjustViewOptionsForIndex (QStyleOptionViewItemV4 *, const QModelIndex &) const
 
bool canDecode (QDropEvent *e) const
 
void checkMouseMove (const QPersistentModelIndex &index)
 
void checkMouseMove (const QPoint &pos)
 
void checkPersistentEditorFocus ()
 When persistent aeditor gets/loses focus, we need to check and setcorrectly the current index. More...
 
void clearOrRemove ()
 In DND if something has been moved then this is called. More...
 
virtual QPoint contentsOffset () const
 
QItemSelectionModel::SelectionFlags contiguousSelectionCommand (const QModelIndex &index, const QEvent *event) const
 
QAbstractItemDelegatedelegateForIndex (const QModelIndex &index) const
 
int delegateRefCount (const QAbstractItemDelegate *delegate) const
 
void doDelayedItemsLayout (int delay=0)
 
void doDelayedReset ()
 
bool droppingOnItself (QDropEvent *event, const QModelIndex &index)
 Return true if this is a move from ourself and index is a child of the selection that is being moved. More...
 
QWidgeteditor (const QModelIndex &index, const QStyleOptionViewItem &options)
 
const QEditorInfoeditorForIndex (const QModelIndex &index) const
 
void executePostedLayout () const
 
QItemSelectionModel::SelectionFlags extendedSelectionCommand (const QModelIndex &index, const QEvent *event) const
 
void fetchMore ()
 
bool hasEditor (const QModelIndex &index) const
 
QModelIndex indexForEditor (QWidget *editor) const
 
void init ()
 
void interruptDelayedItemsLayout () const
 
bool isAnimating () const
 
bool isIndexDragEnabled (const QModelIndex &index) const
 
bool isIndexDropEnabled (const QModelIndex &index) const
 
bool isIndexEnabled (const QModelIndex &index) const
 
bool isIndexSelectable (const QModelIndex &index) const
 
bool isIndexValid (const QModelIndex &index) const
 
bool isPersistent (const QModelIndex &index) const
 
QItemSelectionModel::SelectionFlags multiSelectionCommand (const QModelIndex &index, const QEvent *event) const
 
QPoint offset () const
 
bool openEditor (const QModelIndex &index, QEvent *event)
 
void paintDropIndicator (QPainter *painter)
 
 QAbstractItemViewPrivate ()
 
void releaseEditor (QWidget *editor) const
 
void removeEditor (QWidget *editor)
 
QPixmap renderToPixmap (const QModelIndexList &indexes, QRect *r) const
 
void scrollContentsBy (int dx, int dy)
 
void scrollDirtyRegion (int dx, int dy)
 
QModelIndexList selectedDraggableIndexes () const
 
QItemSelectionModel::SelectionFlags selectionBehaviorFlags () const
 
bool sendDelegateEvent (const QModelIndex &index, QEvent *event) const
 
void setDirtyRegion (const QRegion &visualRegion)
 
void setHoverIndex (const QPersistentModelIndex &index)
 
bool shouldAutoScroll (const QPoint &pos) const
 
bool shouldEdit (QAbstractItemView::EditTrigger trigger, const QModelIndex &index) const
 
bool shouldForwardEvent (QAbstractItemView::EditTrigger trigger, const QEvent *event) const
 
void startAutoScroll ()
 
void stopAutoScroll ()
 
void updateDirtyRegion ()
 
void updateEditorData (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 
QStyleOptionViewItemV4 viewOptionsV4 () const
 
virtual ~QAbstractItemViewPrivate ()
 
- Public Functions inherited from QAbstractScrollAreaPrivate
void _q_hslide (int)
 
void _q_showOrHideScrollBars ()
 
void _q_vslide (int)
 
void init ()
 
void layoutChildren ()
 
 QAbstractScrollAreaPrivate ()
 
void replaceScrollBar (QScrollBar *scrollBar, Qt::Orientation orientation)
 
virtual void scrollBarPolicyChanged (Qt::Orientation, Qt::ScrollBarPolicy)
 
void setSingleFingerPanEnabled (bool on=true)
 
bool viewportEvent (QEvent *event)
 
- Public Functions inherited from QFramePrivate
void init ()
 
 QFramePrivate ()
 
void updateFrameWidth ()
 Updated the frameWidth parameter. More...
 
void updateStyledFrameWidths ()
 Updates the frame widths from the style. More...
 
- Public Functions inherited from QWidgetPrivate
void _q_showIfNotHidden ()
 
virtual void aboutToDestroy ()
 
void activateChildLayoutsRecursively ()
 
QSize adjustedSize () const
 
void adjustQuitOnCloseAttribute ()
 
QInputContextassignedInputContext () const
 
QPainterbeginSharedPainter ()
 
QWidgetchildAt_helper (const QPoint &, bool) const
 
QWidgetchildAtRecursiveHelper (const QPoint &p, bool, bool includeFrame=false) const
 
QRect clipRect () const
 
QRegion clipRegion () const
 
void clipToEffectiveMask (QRegion &region) const
 
bool close_helper (CloseMode mode)
 
void create_sys (WId window, bool initializeWindow, bool destroyOldWindow)
 
QWindowSurfacecreateDefaultWindowSurface ()
 
QWindowSurfacecreateDefaultWindowSurface_sys ()
 
void createExtra ()
 Creates the widget extra data. More...
 
void createRecursively ()
 
void createSysExtra ()
 
void createTLExtra ()
 
void createTLSysExtra ()
 
void createWinId (WId id=0)
 
void deactivateWidgetCleanup ()
 
void deleteExtra ()
 Deletes the widget extra data. More...
 
void deleteSysExtra ()
 
void deleteTLSysExtra ()
 
void drawWidget (QPaintDevice *pdev, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter=0, QWidgetBackingStore *backingStore=0)
 
QWidgeteffectiveFocusWidget ()
 
QRect effectiveRectFor (const QRect &rect) const
 
bool endSharedPainter ()
 
void enforceNativeChildren ()
 
QWExtraextraData () const
 
QRect frameStrut () const
 
void getLayoutItemMargins (int *left, int *top, int *right, int *bottom) const
 
const QRegiongetOpaqueChildren () const
 
void handleSoftwareInputPanel (Qt::MouseButton button, bool clickCausedFocus)
 
virtual bool hasHeightForWidth () const
 
void hide_helper ()
 
void hide_sys ()
 Platform-specific part of QWidget::hide(). More...
 
void hideChildren (bool spontaneous)
 
void inheritStyle ()
 
void init (QWidget *desktopWidget, Qt::WindowFlags f)
 
QInputContextinputContext () const
 
void invalidateBuffer (const QRegion &)
 Invalidates the rgn (in widget's coordinates) of the backing store, i.e. More...
 
void invalidateBuffer (const QRect &)
 This function is equivalent to calling invalidateBuffer(QRegion(rect), ...), but is more efficient as it eliminates QRegion operations/allocations and can use the rect more precisely for additional cut-offs. More...
 
void invalidateBuffer_resizeHelper (const QPoint &oldPos, const QSize &oldSize)
 Invalidates the buffer when the widget is resized. More...
 
void invalidateGraphicsEffectsRecursively ()
 
bool isAboutToShow () const
 
bool isBackgroundInherited () const
 
bool isOverlapped (const QRect &) const
 
void lower_sys ()
 
QPoint mapFromGlobal (const QPoint &pos) const
 
QPoint mapToGlobal (const QPoint &pos) const
 
QWidgetBackingStoremaybeBackingStore () const
 
QTLWExtramaybeTopData () const
 
void moveRect (const QRect &, int dx, int dy)
 
bool nativeChildrenForced () const
 
QFont naturalWidgetFont (uint inheritedMask) const
 
QPalette naturalWidgetPalette (uint inheritedMask) const
 Returns the palette that the widget w inherits from its ancestors and QApplication::palette. More...
 
void paintBackground (QPainter *, const QRegion &, int flags=DrawAsRoot) const
 
bool paintOnScreen () const
 
void paintSiblingsRecursive (QPaintDevice *pdev, const QObjectList &children, int index, const QRegion &rgn, const QPoint &offset, int flags, QPainter *sharedPainter, QWidgetBackingStore *backingStore)
 
bool pointInsideRectAndMask (const QPoint &) const
 
QRegion prepareToRender (const QRegion &region, QWidget::RenderFlags renderFlags)
 
void propagatePaletteChange ()
 Propagate this widget's palette to all children, except style sheet widgets, and windows that don't enable window propagation (palettes don't normally propagate to windows). More...
 
 QWidgetPrivate (int version=QObjectPrivateVersion)
 
void raise_sys ()
 
QPaintDeviceredirected (QPoint *offset) const
 
void registerDropSite (bool)
 
void render (QPaintDevice *target, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags, bool readyToRender)
 
void render_helper (QPainter *painter, const QPoint &targetOffset, const QRegion &sourceRegion, QWidget::RenderFlags renderFlags)
 
void repaint_sys (const QRegion &rgn)
 
void reparentFocusWidgets (QWidget *oldtlw)
 
void resolveFont ()
 Determine which font is implicitly imposed on this widget by its ancestors and QApplication::font, resolve this against its own font (attributes from the implicit font are copied over). More...
 
void resolveLayoutDirection ()
 
void resolveLocale ()
 
void resolvePalette ()
 Determine which palette is inherited from this widget's ancestors and QApplication::palette, resolve this against this widget's palette (attributes from the inherited palette are copied over this widget's palette). More...
 
void restoreRedirected ()
 
void scroll_sys (int dx, int dy)
 
void scroll_sys (int dx, int dy, const QRect &r)
 
void scrollChildren (int dx, int dy)
 
void scrollRect (const QRect &, int dx, int dy)
 
void sendPendingMoveAndResizeEvents (bool recursive=false, bool disableUpdates=false)
 
void sendStartupMessage (const char *message) const
 Platform-specific part of QWidget::show(). More...
 
void setConstraints_sys ()
 
void setCursor_sys (const QCursor &cursor)
 
void setDirtyOpaqueRegion ()
 
void setEnabled_helper (bool)
 
void setFocus_sys ()
 
void setFont_helper (const QFont &font)
 
void setGeometry_sys (int, int, int, int, bool)
 
void setLayoutDirection_helper (Qt::LayoutDirection)
 
void setLayoutItemMargins (int left, int top, int right, int bottom)
 
void setLayoutItemMargins (QStyle::SubElement element, const QStyleOption *opt=0)
 
void setLocale_helper (const QLocale &l, bool forceUpdate=false)
 
void setMask_sys (const QRegion &)
 
bool setMaximumSize_helper (int &maxw, int &maxh)
 
bool setMinimumSize_helper (int &minw, int &minh)
 
void setModal_sys ()
 
void setNetWmWindowTypes ()
 
void setOpaque (bool opaque)
 
void setPalette_helper (const QPalette &)
 
void setParent_sys (QWidget *parent, Qt::WindowFlags)
 
void setRedirected (QPaintDevice *replacement, const QPoint &offset)
 
void setSharedPainter (QPainter *painter)
 
void setStyle_helper (QStyle *newStyle, bool propagate, bool metalHack=false)
 
void setUpdatesEnabled_helper (bool)
 
void setWindowFilePath_helper (const QString &filePath)
 
void setWindowIcon_helper ()
 
void setWindowIcon_sys (bool forceReset=false)
 
void setWindowIconText_helper (const QString &cap)
 
void setWindowIconText_sys (const QString &cap)
 
void setWindowOpacity_sys (qreal opacity)
 
void setWindowRole ()
 
void setWindowTitle_helper (const QString &cap)
 
void setWindowTitle_sys (const QString &cap)
 
void setWinId (WId)
 
QPaintersharedPainter () const
 
void show_helper ()
 
void show_recursive ()
 Makes the widget visible in the isVisible() meaning of the word. More...
 
void show_sys ()
 Platform-specific part of QWidget::show(). More...
 
void showChildren (bool spontaneous)
 
void stackUnder_sys (QWidget *)
 
void subtractOpaqueChildren (QRegion &rgn, const QRect &clipRect) const
 
void subtractOpaqueSiblings (QRegion &source, bool *hasDirtySiblingsAbove=0, bool alsoNonOpaque=false) const
 
void syncBackingStore ()
 
void syncBackingStore (const QRegion &region)
 
QTLWExtratopData () const
 
void unsetCursor_sys ()
 
void updateFont (const QFont &)
 Assign font to this widget, and propagate it to all children, except style sheet widgets (handled differently) and windows that don't enable window propagation. More...
 
void updateFrameStrut ()
 Computes the frame rectangle when needed. More...
 
void updateGeometry_helper (bool forceUpdate)
 
void updateIsOpaque ()
 
void updateIsTranslucent ()
 
void updateSystemBackground ()
 
void updateX11AcceptFocus ()
 
void x11UpdateIsOpaque ()
 
 ~QWidgetPrivate ()
 
- Public Functions inherited from QObjectPrivate
void _q_reregisterTimers (void *pointer)
 
void addConnection (int signal, Connection *c)
 
void cleanConnectionLists ()
 
void connectNotify (const char *signal)
 
void deleteChildren ()
 
void disconnectNotify (const char *signal)
 
bool isSender (const QObject *receiver, const char *signal) const
 
bool isSignalConnected (uint signalIdx) const
 Returns true if the signal with index signal_index from object sender is connected. More...
 
void moveToThread_helper ()
 
 QObjectPrivate (int version=QObjectPrivateVersion)
 
QObjectList receiverList (const char *signal) const
 
QObjectList senderList () const
 
void setParent_helper (QObject *)
 
void setThreadData_helper (QThreadData *currentData, QThreadData *targetData)
 
int signalIndex (const char *signalName) const
 Returns the signal index used in the internal connectionLists vector. More...
 
virtual ~QObjectPrivate ()
 
- Public Functions inherited from QObjectData
virtual ~QObjectData ()=0
 

Public Variables

QBasicTimer batchLayoutTimer
 
int batchSize
 
QSize cachedItemSize
 
int column
 
QCommonListViewBasecommonListView
 
QRect elasticBand
 
QListView::Flow flow
 
QSize grid
 
QSet< QPersistentModelIndexhiddenRows
 
QRect layoutBounds
 
QListView::LayoutMode layoutMode
 
uint modeProperties: 8
 
QListView::Movement movement
 
QListView::ResizeMode resizeMode
 
bool showElasticBand
 
int space
 
bool uniformItemSizes
 
QListView::ViewMode viewMode
 
bool wrap
 
- Public Variables inherited from QAbstractItemViewPrivate
bool alternatingColors
 
bool autoScroll
 
int autoScrollCount
 
int autoScrollMargin
 
QBasicTimer autoScrollTimer
 
QMap< int, QPointer< QAbstractItemDelegate > > columnDelegates
 
QItemSelectionModel::SelectionFlag ctrlDragSelectionFlag
 
bool currentIndexSet
 
QWidgetcurrentlyCommittingEditor
 
Qt::DropAction defaultDropAction
 
QBasicTimer delayedAutoScroll
 
QBasicTimer delayedEditing
 
bool delayedPendingLayout
 
QBasicTimer delayedReset
 
QAbstractItemView::DragDropMode dragDropMode
 
bool dragEnabled
 
QAbstractItemView::DropIndicatorPosition dropIndicatorPosition
 
QRect dropIndicatorRect
 
QEditorIndexHash editorIndexHash
 
QAbstractItemView::EditTriggers editTriggers
 
QPersistentModelIndex enteredIndex
 
QAbstractItemView::ScrollMode horizontalScrollMode
 
QPersistentModelIndex hover
 
QSize iconSize
 
QIndexEditorHash indexEditorHash
 
QPointer< QAbstractItemDelegateitemDelegate
 
QString keyboardInput
 
QElapsedTimer keyboardInputTime
 
QAbstractItemView::EditTrigger lastTrigger
 
QAbstractItemModelmodel
 
bool moveCursorUpdatedView
 
bool noSelectionOnMousePress
 
bool overwrite
 
QSet< QWidget * > persistent
 
bool pressedAlreadySelected
 
QPersistentModelIndex pressedIndex
 
Qt::KeyboardModifiers pressedModifiers
 
QPoint pressedPosition
 
QPersistentModelIndex root
 
QMap< int, QPointer< QAbstractItemDelegate > > rowDelegates
 
QPoint scrollDelayOffset
 
QAbstractItemView::SelectionBehavior selectionBehavior
 
QAbstractItemView::SelectionMode selectionMode
 
QPointer< QItemSelectionModelselectionModel
 
bool shouldClearStatusTip
 
bool shouldScrollToCurrentOnShow
 
bool showDropIndicator
 
QAbstractItemView::State state
 
QAbstractItemView::State stateBeforeAnimation
 
bool tabKeyNavigation
 
Qt::TextElideMode textElideMode
 
QRegion updateRegion
 
QBasicTimer updateTimer
 
QAbstractItemView::ScrollMode verticalScrollMode
 
bool viewportEnteredNeeded
 
bool wrapItemText
 
- Public Variables inherited from QAbstractScrollAreaPrivate
int bottom
 
QRect cornerPaintingRect
 
QWidgetcornerWidget
 
QScrollBarhbar
 
Qt::ScrollBarPolicy hbarpolicy
 
int left
 
QRect reverseCornerPaintingRect
 
int right
 
QAbstractScrollAreaScrollBarContainerscrollBarContainers [Qt::Vertical+1]
 
bool singleFingerPanEnabled
 
int top
 
QScrollBarvbar
 
Qt::ScrollBarPolicy vbarpolicy
 
QWidgetviewport
 
QScopedPointer< QObjectviewportFilter
 
int xoffset
 
int yoffset
 
- Public Variables inherited from QFramePrivate
short bottomFrameWidth
 
int frameStyle
 
short frameWidth
 
QRect frect
 
short leftFrameWidth
 
short lineWidth
 
short midLineWidth
 
short rightFrameWidth
 
short topFrameWidth
 
- Public Variables inherited from QWidgetPrivate
QString accessibleDescription
 
QString accessibleName
 
QList< QAction * > actions
 
QPalette::ColorRole bg_role: 8
 
signed char bottomLayoutItemMargin
 
short bottommargin
 
QWidgetData data
 
QRegion dirty
 
uint dirtyOpaqueChildren: 1
 
QWExtraextra
 
QPaintEngineextraPaintEngine
 
QPalette::ColorRole fg_role: 8
 
QWidgetfocus_child
 
QWidgetfocus_next
 
QWidgetfocus_prev
 
QMap< Qt::GestureType, Qt::GestureFlags > gestureContext
 
QGraphicsEffectgraphicsEffect
 
Qt::HANDLE hd
 
uint high_attributes [4]
 
QPointer< QInputContextic
 
Qt::InputMethodHints imHints
 
uint inDirtyList: 1
 
uint inheritedFontResolveMask
 
uint inheritedPaletteResolveMask
 
uint inheritsInputMethodHints: 1
 
uint inSetParent: 1
 
uint isGLWidget: 1
 
uint isMoved: 1
 
uint isOpaque: 1
 
uint isScrolled: 1
 
QLayoutlayout
 
signed char leftLayoutItemMargin
 
short leftmargin
 
QLocale locale
 
QRegionneedsFlush
 
QRegion opaqueChildren
 
Qt::HANDLE picture
 
const QMetaObjectpolished
 
QPaintDeviceredirectDev
 
QPoint redirectOffset
 
signed char rightLayoutItemMargin
 
short rightmargin
 
QSizePolicy size_policy
 
QString statusTip
 
QString toolTip
 
signed char topLayoutItemMargin
 
short topmargin
 
uint usesDoubleBufferedGLContext: 1
 
QString whatsThis
 
QWidgetItemV2widgetItem
 
QX11Info xinfo
 
- Public Variables inherited from QObjectPrivate
union {
   QObject *   currentChildBeingDeleted
 
   QAbstractDeclarativeData *   declarativeData
 
}; 
 
quint32 connectedSignals [2]
 
QObjectConnectionListVectorconnectionLists
 
SendercurrentSender
 
QList< QPointer< QObject > > eventFilters
 
ExtraDataextraData
 
QString objectName
 
Connectionsenders
 
QAtomicPointer< QtSharedPointer::ExternalRefCountData > sharedRefcount
 
QThreadDatathreadData
 
void * unused
 
- Public Variables inherited from QObjectData
uint blockSig: 1
 
QObjectList children
 
uint hasGuards: 1
 
uint inEventHandler: 1
 
uint inThreadChangeEvent: 1
 
uint isWidget: 1
 
QMetaObjectmetaObject
 
uint ownObjectName: 1
 
QObjectparent
 
uint pendTimer: 1
 
int postedEvents
 
QObjectq_ptr
 
uint receiveChildEvents: 1
 
uint sendChildEvents: 1
 
uint unused: 22
 
uint wasDeleted: 1
 

Additional Inherited Members

- Static Public Functions inherited from QWidgetPrivate
static void adjustFlags (Qt::WindowFlags &flags, QWidget *w=0)
 
static QGraphicsProxyWidgetnearestGraphicsProxyWidget (const QWidget *origin)
 Finds the nearest widget embedded in a graphics proxy widget along the chain formed by this widget and its ancestors. More...
 
static int pointToRect (const QPoint &p, const QRect &r)
 
static QRect screenGeometry (const QWidget *widget)
 
- Static Public Functions inherited from QObjectPrivate
static void clearGuards (QObject *)
 
static QObjectPrivateget (QObject *o)
 
static void resetCurrentSender (QObject *receiver, Sender *currentSender, Sender *previousSender)
 
static SendersetCurrentSender (QObject *receiver, Sender *sender)
 
static void signalSignature (const QMetaMethod &signal, QVarLengthArray< char > *result)
 
- Static Public Variables inherited from QWidgetPrivate
static QWidgetSetallWidgets = 0
 
static int instanceCounter = 0
 
static QWidgetkeyboardGrabber = 0
 
static QWidgetMappermapper = 0
 
static int maxInstances = 0
 
static QWidgetmouseGrabber = 0
 

Detailed Description

Definition at line 302 of file qlistview_p.h.

Enumerations

◆ ModeProperties

Enumerator
Wrap 
Spacing 
GridSize 
Flow 
Movement 
ResizeMode 
SelectionRectVisible 

Definition at line 417 of file qlistview_p.h.

417  {
418  Wrap = 1,
419  Spacing = 2,
420  GridSize = 4,
421  Flow = 8,
422  Movement = 16,
423  ResizeMode = 32,
425  };
The Flow item arranges its children side by side, wrapping as necessary.

Constructors and Destructors

◆ QListViewPrivate()

QListViewPrivate::QListViewPrivate ( )

Definition at line 1702 of file qlistview.cpp.

1704  commonListView(0),
1705  wrap(false),
1706  space(0),
1712  modeProperties(0),
1713  column(0),
1714  uniformItemSizes(false),
1715  batchSize(100),
1716  showElasticBand(false)
1717 {
1718 }
QListView::ViewMode viewMode
Definition: qlistview_p.h:413
QListView::LayoutMode layoutMode
Definition: qlistview_p.h:412
QListView::Movement movement
Definition: qlistview_p.h:410
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
QListView::Flow flow
Definition: qlistview_p.h:409
QListView::ResizeMode resizeMode
Definition: qlistview_p.h:411

◆ ~QListViewPrivate()

QListViewPrivate::~QListViewPrivate ( )

Definition at line 1720 of file qlistview.cpp.

1721 {
1722  delete commonListView;
1723 }
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401

Functions

◆ batchStartRow()

int QListViewPrivate::batchStartRow ( ) const
inline

◆ clear()

void QListViewPrivate::clear ( )

Definition at line 1725 of file qlistview.cpp.

Referenced by prepareItemsLayout().

1726 {
1727  // initialization of data structs
1728  cachedItemSize = QSize();
1729  commonListView->clear();
1730 }
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
virtual void clear()=0

◆ closestIndex()

QModelIndex QListViewPrivate::closestIndex ( const QRect target,
const QVector< QModelIndex > &  candidates 
) const

Definition at line 1811 of file qlistview.cpp.

1813 {
1814  int distance = 0;
1815  int shortest = INT_MAX;
1816  QModelIndex closest;
1818 
1819  for (; it != candidates.end(); ++it) {
1820  if (!(*it).isValid())
1821  continue;
1822 
1823  const QRect indexRect = indexToListViewItem(*it).rect();
1824 
1825  //if the center x (or y) position of an item is included in the rect of the other item,
1826  //we define the distance between them as the difference in x (or y) of their respective center.
1827  // Otherwise, we use the nahattan length between the 2 items
1828  if ((target.center().x() >= indexRect.x() && target.center().x() < indexRect.right())
1829  || (indexRect.center().x() >= target.x() && indexRect.center().x() < target.right())) {
1830  //one item's center is at the vertical of the other
1831  distance = qAbs(indexRect.center().y() - target.center().y());
1832  } else if ((target.center().y() >= indexRect.y() && target.center().y() < indexRect.bottom())
1833  || (indexRect.center().y() >= target.y() && indexRect.center().y() < target.bottom())) {
1834  //one item's center is at the vertical of the other
1835  distance = qAbs(indexRect.center().x() - target.center().x());
1836  } else {
1837  distance = (indexRect.center() - target.center()).manhattanLength();
1838  }
1839  if (distance < shortest) {
1840  shortest = distance;
1841  closest = *it;
1842  }
1843  }
1844  return closest;
1845 }
#define it(className, varName)
QListViewItem indexToListViewItem(const QModelIndex &index) const
Definition: qlistview.cpp:1791
QRect rect() const
Definition: qlistview_p.h:97
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
Q_DECL_CONSTEXPR T qAbs(const T &t)
Definition: qglobal.h:1201
The QVector class is a template class that provides a dynamic array.
Definition: qdatastream.h:64
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
Definition: qvector.h:250
static int distance(QWidget *source, QWidget *target, QAccessible::RelationFlag relation)
QPoint center() const
Returns the center point of the rectangle.
Definition: qrect.h:300
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
Definition: qvector.h:247
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
The QModelIndex class is used to locate data in a data model.
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128
#define INT_MAX

◆ contentsSize()

QSize QListViewPrivate::contentsSize ( ) const
inline

◆ doItemsLayout()

bool QListViewPrivate::doItemsLayout ( int  delta)
Warning
This function is not part of the public interface.

Definition at line 1763 of file qlistview.cpp.

1764 {
1765  int max = model->rowCount(root) - 1;
1766  int first = batchStartRow();
1767  int last = qMin(first + delta - 1, max);
1768 
1769  if (first == 0) {
1770  layoutChildren(); // make sure the viewport has the right size
1772  }
1773 
1774  if (max < 0 || last < first) {
1775  return true; // nothing to do
1776  }
1777 
1779  info.bounds = layoutBounds;
1780  info.grid = gridSize();
1781  info.spacing = (info.grid.isValid() ? 0 : spacing());
1782  info.first = first;
1783  info.last = last;
1784  info.wrap = isWrapping();
1785  info.flow = flow;
1786  info.max = max;
1787 
1788  return commonListView->doBatchedItemLayout(info, max);
1789 }
void prepareItemsLayout()
Definition: qlistview.cpp:1732
virtual bool doBatchedItemLayout(const QListViewLayoutInfo &info, int max)=0
static mach_timebase_info_data_t info
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
QSize gridSize() const
Definition: qlistview_p.h:369
QListView::Flow flow
Definition: qlistview_p.h:113
bool isWrapping() const
Definition: qlistview_p.h:371
int spacing() const
Definition: qlistview_p.h:373
QPersistentModelIndex root
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
Definition: qsize.h:123
int batchStartRow() const
Definition: qlistview_p.h:321
QListView::Flow flow
Definition: qlistview_p.h:409
QAbstractItemModel * model

◆ draggablePaintPairs()

QItemViewPaintPairs QListViewPrivate::draggablePaintPairs ( const QModelIndexList indexes,
QRect r 
) const
virtual

Reimplemented Function

We have a QListView way of knowing what elements are on the viewport through the intersectingSet function

Reimplemented from QAbstractItemViewPrivate.

Definition at line 681 of file qlistview.cpp.

682 {
683  Q_ASSERT(r);
684  Q_Q(const QListView);
685  QRect &rect = *r;
686  const QRect viewportRect = viewport->rect();
688  const QSet<QModelIndex> visibleIndexes = intersectingSet(viewportRect).toList().toSet();
689  for (int i = 0; i < indexes.count(); ++i) {
690  const QModelIndex &index = indexes.at(i);
691  if (visibleIndexes.contains(index)) {
692  const QRect current = q->visualRect(index);
693  ret += qMakePair(current, index);
694  rect |= current;
695  }
696  }
697  rect &= viewportRect;
698  return ret;
699 }
QSet< T > toSet() const
Returns a QSet object with the data contained in this QList.
Definition: qset.h:309
QList< T > toList() const
Returns a QList object with the data contained in this QVector.
Definition: qvector.h:770
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QVector< QModelIndex > intersectingSet(const QRect &area, bool doLayout=true) const
Definition: qlistview_p.h:314
#define Q_Q(Class)
Definition: qglobal.h:2483
bool contains(const T &value) const
Definition: qset.h:91
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QListView class provides a list or icon view onto a model.
Definition: qlistview.h:57
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
Q_OUTOFLINE_TEMPLATE QPair< T1, T2 > qMakePair(const T1 &x, const T2 &y)
Definition: qpair.h:102
The QModelIndex class is used to locate data in a data model.
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
quint16 index
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ dropOn()

bool QListViewPrivate::dropOn ( QDropEvent event,
int *  dropRow,
int *  dropCol,
QModelIndex dropIndex 
)
virtual

If the event hasn't already been accepted, determines the index to drop on.

if (row == -1 && col == -1) append to this drop index else place at row, col in drop index

If it returns true a drop can be done, and dropRow, dropCol and dropIndex reflects the position of the drop.
\warning This function is not part of the public interface.

Reimplemented from QAbstractItemViewPrivate.

Definition at line 1900 of file qlistview.cpp.

1901 {
1903  return static_cast<QListModeViewBase *>(commonListView)->dropOn(event, dropRow, dropCol, dropIndex);
1904  else
1905  return QAbstractItemViewPrivate::dropOn(event, dropRow, dropCol, dropIndex);
1906 }
QListView::ViewMode viewMode
Definition: qlistview_p.h:413
virtual bool dropOn(QDropEvent *event, int *row, int *col, QModelIndex *index)
If the event hasn&#39;t already been accepted, determines the index to drop on.
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
bool dropOn(QDropEvent *event, int *row, int *col, QModelIndex *index)
If the event hasn&#39;t already been accepted, determines the index to drop on.
Definition: qlistview.cpp:1900
QListView::Flow flow
Definition: qlistview_p.h:409

◆ emitIndexesMoved()

void QListViewPrivate::emitIndexesMoved ( const QModelIndexList indexes)
inline

Definition at line 398 of file qlistview_p.h.

398 { emit q_func()->indexesMoved(indexes); }
#define emit
Definition: qobjectdefs.h:76

◆ flipX() [1/3]

int QListViewPrivate::flipX ( int  x) const
inline

Definition at line 325 of file qlistview_p.h.

326  { return qMax(viewport->width(), contentsSize().width()) - x; }
int width
the width of the widget excluding any window frame
Definition: qwidget.h:166
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
int width() const
Returns the width.
Definition: qsize.h:126
QSize contentsSize() const
Definition: qlistview_p.h:322

◆ flipX() [2/3]

QPoint QListViewPrivate::flipX ( const QPoint p) const
inline

Definition at line 327 of file qlistview_p.h.

328  { return QPoint(flipX(p.x()), p.y()); }
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int flipX(int x) const
Definition: qlistview_p.h:325
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128

◆ flipX() [3/3]

QRect QListViewPrivate::flipX ( const QRect r) const
inline

Definition at line 329 of file qlistview_p.h.

330  { return QRect(flipX(r.x()) - r.width(), r.y(), r.width(), r.height()); }
int width() const
Returns the width of the rectangle.
Definition: qrect.h:303
int height() const
Returns the height of the rectangle.
Definition: qrect.h:306
int y() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:255
int x() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:252
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
int flipX(int x) const
Definition: qlistview_p.h:325

◆ gridSize()

QSize QListViewPrivate::gridSize ( ) const
inline

◆ horizontalScrollToValue()

int QListViewPrivate::horizontalScrollToValue ( const QModelIndex index,
const QRect rect,
QListView::ScrollHint  hint 
) const

Definition at line 617 of file qlistview.cpp.

619 {
620  Q_Q(const QListView);
621  const QRect area = viewport->rect();
622  const bool leftOf = q->isRightToLeft()
623  ? (rect.left() < area.left()) && (rect.right() < area.right())
624  : rect.left() < area.left();
625  const bool rightOf = q->isRightToLeft()
626  ? rect.right() > area.right()
627  : (rect.right() > area.right()) && (rect.left() > area.left());
628  return commonListView->horizontalScrollToValue(q->visualIndex(index), hint, leftOf, rightOf, area, rect);
629 }
virtual int horizontalScrollToValue(int index, QListView::ScrollHint hint, bool leftOf, bool rightOf, const QRect &area, const QRect &rect) const
Definition: qlistview.cpp:1970
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
#define Q_Q(Class)
Definition: qglobal.h:2483
The QListView class provides a list or icon view onto a model.
Definition: qlistview.h:57
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
static int area(const QSize &s)
Definition: qicon.cpp:155

◆ indexToListViewItem()

QListViewItem QListViewPrivate::indexToListViewItem ( const QModelIndex index) const

Definition at line 1791 of file qlistview.cpp.

Referenced by closestIndex(), and QIconModeViewBase::itemsRect().

1792 {
1793  if (!index.isValid() || isHidden(index.row()))
1794  return QListViewItem();
1795 
1796  return commonListView->indexToListViewItem(index);
1797 }
bool isHidden(int row) const
Definition: qlistview_p.h:378
int row() const
Returns the row this model index refers to.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
virtual QListViewItem indexToListViewItem(const QModelIndex &index) const =0

◆ intersectingSet()

QVector<QModelIndex> QListViewPrivate::intersectingSet ( const QRect area,
bool  doLayout = true 
) const
inline

Definition at line 314 of file qlistview_p.h.

Referenced by QIconModeViewBase::filterDragMoveEvent(), QIconModeViewBase::filterDropEvent(), and selection().

314  {
315  if (doLayout) executePostedLayout();
316  QRect a = (q_func()->isRightToLeft() ? flipX(area.normalized()) : area.normalized());
317  return commonListView->intersectingSet(a);
318  }
QRect normalized() const
Returns a normalized rectangle; i.e., a rectangle that has a non-negative width and height...
Definition: qrect.cpp:322
long ASN1_INTEGER_get ASN1_INTEGER * a
virtual QVector< QModelIndex > intersectingSet(const QRect &area) const =0
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
int flipX(int x) const
Definition: qlistview_p.h:325

◆ isHidden()

bool QListViewPrivate::isHidden ( int  row) const
inline

Definition at line 378 of file qlistview_p.h.

Referenced by QIconModeViewBase::doDynamicLayout(), QListModeViewBase::doStaticLayout(), indexToListViewItem(), QListModeViewBase::intersectingSet(), QListModeViewBase::perItemScrollToValue(), and QListModeViewBase::verticalScrollToValue().

378  {
379  QModelIndex idx = model->index(row, 0, root);
380  return isPersistent(idx) && hiddenRows.contains(idx);
381  }
QSet< QPersistentModelIndex > hiddenRows
Definition: qlistview_p.h:435
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
bool contains(const T &value) const
Definition: qset.h:91
QPersistentModelIndex root
The QModelIndex class is used to locate data in a data model.
bool isPersistent(const QModelIndex &index) const
QAbstractItemModel * model

◆ isHiddenOrDisabled()

bool QListViewPrivate::isHiddenOrDisabled ( int  row) const
inline

Definition at line 382 of file qlistview_p.h.

382 { return isHidden(row) || !isIndexEnabled(modelIndex(row)); }
QModelIndex modelIndex(int row) const
Definition: qlistview_p.h:377
bool isHidden(int row) const
Definition: qlistview_p.h:378
bool isIndexEnabled(const QModelIndex &index) const

◆ isSelectionRectVisible()

bool QListViewPrivate::isSelectionRectVisible ( ) const
inline

Definition at line 375 of file qlistview_p.h.

375 { return showElasticBand; }

◆ isWrapping()

bool QListViewPrivate::isWrapping ( ) const
inline

◆ itemSize()

QSize QListViewPrivate::itemSize ( const QStyleOptionViewItem option,
const QModelIndex index 
) const

Definition at line 1847 of file qlistview.cpp.

Referenced by QIconModeViewBase::dataChanged(), QIconModeViewBase::doBatchedItemLayout(), QListModeViewBase::doStaticLayout(), and QListModeViewBase::indexToListViewItem().

1848 {
1849  if (!uniformItemSizes) {
1850  const QAbstractItemDelegate *delegate = delegateForIndex(index);
1851  return delegate ? delegate->sizeHint(option, index) : QSize();
1852  }
1853  if (!cachedItemSize.isValid()) { // the last item is probaly the largest, so we use its size
1854  int row = model->rowCount(root) - 1;
1855  QModelIndex sample = model->index(row, column, root);
1856  const QAbstractItemDelegate *delegate = delegateForIndex(sample);
1857  cachedItemSize = delegate ? delegate->sizeHint(option, sample) : QSize();
1858  }
1859  return cachedItemSize;
1860 }
The QAbstractItemDelegate class is used to display and edit data items from a model.
virtual QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const =0
This pure abstract function must be reimplemented if you want to provide custom rendering.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
QPersistentModelIndex root
The QModelIndex class is used to locate data in a data model.
QAbstractItemDelegate * delegateForIndex(const QModelIndex &index) const
bool isValid() const
Returns true if both the width and height is equal to or greater than 0; otherwise returns false...
Definition: qsize.h:123
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
QAbstractItemModel * model

◆ listViewItemToIndex()

QModelIndex QListViewPrivate::listViewItemToIndex ( const QListViewItem item) const
inline

Definition at line 335 of file qlistview_p.h.

Referenced by QIconModeViewBase::addLeaf().

336  { return model->index(commonListView->itemIndex(item), column, root); }
virtual int itemIndex(const QListViewItem &item) const =0
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
QPersistentModelIndex root
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
QAbstractItemModel * model

◆ mapToViewport()

QRect QListViewPrivate::mapToViewport ( const QRect rect,
bool  extend = true 
) const

Definition at line 1799 of file qlistview.cpp.

1800 {
1801  Q_Q(const QListView);
1802  if (!rect.isValid())
1803  return rect;
1804 
1805  QRect result = extend ? commonListView->mapToViewport(rect) : rect;
1806  int dx = -q->horizontalOffset();
1807  int dy = -q->verticalOffset();
1808  return result.adjusted(dx, dy, dx, dy);
1809 }
QRect adjusted(int x1, int y1, int x2, int y2) const
Returns a new rectangle with dx1, dy1, dx2 and dy2 added respectively to the existing coordinates of ...
Definition: qrect.h:431
virtual QRect mapToViewport(const QRect &rect) const
Definition: qlistview_p.h:140
#define Q_Q(Class)
Definition: qglobal.h:2483
The QListView class provides a list or icon view onto a model.
Definition: qlistview.h:57
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
Definition: qrect.h:237

◆ modelIndex()

QModelIndex QListViewPrivate::modelIndex ( int  row) const
inline

Definition at line 377 of file qlistview_p.h.

Referenced by QIconModeViewBase::dataChanged(), QIconModeViewBase::doBatchedItemLayout(), QListModeViewBase::doStaticLayout(), and QListModeViewBase::intersectingSet().

377 { return model->index(row, column, root); }
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
QPersistentModelIndex root
QAbstractItemModel * model

◆ position()

QAbstractItemView::DropIndicatorPosition QListViewPrivate::position ( const QPoint pos,
const QRect rect,
const QModelIndex idx 
) const
virtual

Reimplemented from QAbstractItemViewPrivate.

Definition at line 1892 of file qlistview.cpp.

Referenced by QListModeViewBase::dragMoveEvent(), QListModeViewBase::dropOn(), QListModeViewBase::horizontalOffset(), and QIconModeViewBase::setPositionForIndex().

1893 {
1895  return static_cast<QListModeViewBase *>(commonListView)->position(pos, rect, idx);
1896  else
1897  return QAbstractItemViewPrivate::position(pos, rect, idx);
1898 }
virtual QAbstractItemView::DropIndicatorPosition position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const
QListView::ViewMode viewMode
Definition: qlistview_p.h:413
virtual QAbstractItemView::DropIndicatorPosition position(const QPoint &pos, const QRect &rect, const QModelIndex &idx) const
Definition: qlistview.cpp:1892
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
QListView::Flow flow
Definition: qlistview_p.h:409

◆ prepareItemsLayout()

void QListViewPrivate::prepareItemsLayout ( )

Definition at line 1732 of file qlistview.cpp.

Referenced by doItemsLayout().

1733 {
1734  Q_Q(QListView);
1735  clear();
1736 
1737  //take the size as if there were scrollbar in order to prevent scrollbar to blink
1738  layoutBounds = QRect(QPoint(), q->maximumViewportSize());
1739 
1740  int frameAroundContents = 0;
1741  if (q->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents))
1742  frameAroundContents = q->style()->pixelMetric(QStyle::PM_DefaultFrameWidth) * 2;
1743 
1744  // maximumViewportSize() already takes scrollbar into account if policy is
1745  // Qt::ScrollBarAlwaysOn but scrollbar extent must be deduced if policy
1746  // is Qt::ScrollBarAsNeeded
1747  int verticalMargin = vbarpolicy==Qt::ScrollBarAsNeeded
1748  ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, vbar) + frameAroundContents
1749  : 0;
1750  int horizontalMargin = hbarpolicy==Qt::ScrollBarAsNeeded
1751  ? q->style()->pixelMetric(QStyle::PM_ScrollBarExtent, 0, hbar) + frameAroundContents
1752  : 0;
1753 
1754  layoutBounds.adjust(0, 0, -verticalMargin, -horizontalMargin);
1755 
1756  int rowCount = model->columnCount(root) <= 0 ? 0 : model->rowCount(root);
1757  commonListView->setRowCount(rowCount);
1758 }
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
#define Q_Q(Class)
Definition: qglobal.h:2483
void adjust(int x1, int y1, int x2, int y2)
Adds dx1, dy1, dx2 and dy2 respectively to the existing coordinates of the rectangle.
Definition: qrect.h:434
virtual void setRowCount(int)=0
QPersistentModelIndex root
The QListView class provides a list or icon view onto a model.
Definition: qlistview.h:57
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
QAbstractItemModel * model

◆ rectForIndex()

QRect QListViewPrivate::rectForIndex ( const QModelIndex index) const
inline

Definition at line 338 of file qlistview_p.h.

339  {
340  if (!isIndexValid(index) || index.parent() != root || index.column() != column || isHidden(index.row()))
341  return QRect();
343  return viewItemRect(indexToListViewItem(index));
344  }
QListViewItem indexToListViewItem(const QModelIndex &index) const
Definition: qlistview.cpp:1791
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
bool isHidden(int row) const
Definition: qlistview_p.h:378
QRect viewItemRect(const QListViewItem &item) const
Definition: qlistview_p.h:331
int row() const
Returns the row this model index refers to.
QPersistentModelIndex root
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
bool isIndexValid(const QModelIndex &index) const
int column() const
Returns the column this model index refers to.

◆ removeCurrentAndDisabled()

void QListViewPrivate::removeCurrentAndDisabled ( QVector< QModelIndex > *  indexes,
const QModelIndex current 
) const
inline

Definition at line 384 of file qlistview_p.h.

384  {
386  while (it != indexes->end()) {
387  if (!isIndexEnabled(*it) || (*it) == current)
388  indexes->erase(it);
389  else
390  ++it;
391  }
392  }
#define it(className, varName)
The QVector class is a template class that provides a dynamic array.
Definition: qdatastream.h:64
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
Definition: qvector.h:250
bool isIndexEnabled(const QModelIndex &index) const
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
Definition: qvector.h:247
iterator erase(iterator begin, iterator end)
Removes all the items from begin up to (but not including) end.
Definition: qvector.h:627

◆ resetBatchStartRow()

void QListViewPrivate::resetBatchStartRow ( )
inline

Definition at line 320 of file qlistview_p.h.

QCommonListViewBase * commonListView
Definition: qlistview_p.h:401

◆ scrollElasticBandBy()

void QListViewPrivate::scrollElasticBandBy ( int  dx,
int  dy 
)

Definition at line 3210 of file qlistview.cpp.

3211 {
3212  if (dx > 0) // right
3214  else if (dx < 0) // left
3216  if (dy > 0) // down
3218  else if (dy < 0) // up
3220 }
void moveLeft(int pos)
Moves the rectangle horizontally, leaving the rectangle&#39;s left edge at the given x coordinate...
Definition: qrect.h:350
void moveRight(int pos)
Moves the rectangle horizontally, leaving the rectangle&#39;s right edge at the given x coordinate...
Definition: qrect.h:356
int left() const
Returns the x-coordinate of the rectangle&#39;s left edge.
Definition: qrect.h:240
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
void moveBottom(int pos)
Moves the rectangle vertically, leaving the rectangle&#39;s bottom edge at the given y coordinate...
Definition: qrect.h:362
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
int right() const
Returns the x-coordinate of the rectangle&#39;s right edge.
Definition: qrect.h:246
void moveTop(int pos)
Moves the rectangle vertically, leaving the rectangle&#39;s top edge at the given y coordinate.
Definition: qrect.h:353

◆ selectAll()

void QListViewPrivate::selectAll ( QItemSelectionModel::SelectionFlags  command)
virtual

Reimplemented from QAbstractItemViewPrivate.

Definition at line 641 of file qlistview.cpp.

642 {
643  if (!selectionModel)
644  return;
645 
647  QModelIndex topLeft;
648  int row = 0;
649  const int colCount = model->columnCount(root);
650  for(; row < model->rowCount(root); ++row) {
651  if (isHidden(row)) {
652  //it might be the end of a selection range
653  if (topLeft.isValid()) {
654  QModelIndex bottomRight = model->index(row - 1, colCount - 1, root);
655  selection.append(QItemSelectionRange(topLeft, bottomRight));
656  topLeft = QModelIndex();
657  }
658  continue;
659  }
660 
661  if (!topLeft.isValid()) //start of a new selection range
662  topLeft = model->index(row, 0, root);
663  }
664 
665  if (topLeft.isValid()) {
666  //last selected range
667  QModelIndex bottomRight = model->index(row - 1, colCount - 1, root);
668  selection.append(QItemSelectionRange(topLeft, bottomRight));
669  }
670 
671  if (!selection.isEmpty())
672  selectionModel->select(selection, command);
673 }
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
QItemSelection selection(const QRect &rect) const
Definition: qlistview.cpp:1862
virtual int rowCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of rows under the given parent.
The QItemSelectionRange class manages information about a range of selected items in a model...
QPointer< QItemSelectionModel > selectionModel
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
bool isHidden(int row) const
Definition: qlistview_p.h:378
virtual QModelIndex index(int row, int column, const QModelIndex &parent=QModelIndex()) const =0
Returns the index of the item in the model specified by the given row, column and parent index...
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
QPersistentModelIndex root
The QItemSelection class manages information about selected items in a model.
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Selects the model item index using the specified command, and emits selectionChanged().
The QModelIndex class is used to locate data in a data model.
QAbstractItemModel * model

◆ selection()

QItemSelection QListViewPrivate::selection ( const QRect rect) const

Definition at line 1862 of file qlistview.cpp.

1863 {
1865  QModelIndex tl, br;
1866  const QVector<QModelIndex> intersectVector = intersectingSet(rect);
1867  QVector<QModelIndex>::const_iterator it = intersectVector.begin();
1868  for (; it != intersectVector.end(); ++it) {
1869  if (!tl.isValid() && !br.isValid()) {
1870  tl = br = *it;
1871  } else if ((*it).row() == (tl.row() - 1)) {
1872  tl = *it; // expand current range
1873  } else if ((*it).row() == (br.row() + 1)) {
1874  br = (*it); // expand current range
1875  } else {
1876  selection.select(tl, br); // select current range
1877  tl = br = *it; // start new range
1878  }
1879  }
1880 
1881  if (tl.isValid() && br.isValid())
1882  selection.select(tl, br);
1883  else if (tl.isValid())
1884  selection.select(tl, tl);
1885  else if (br.isValid())
1886  selection.select(br, br);
1887 
1888  return selection;
1889 }
#define it(className, varName)
QItemSelection selection(const QRect &rect) const
Definition: qlistview.cpp:1862
QVector< QModelIndex > intersectingSet(const QRect &area, bool doLayout=true) const
Definition: qlistview_p.h:314
iterator end()
Returns an STL-style iterator pointing to the imaginary item after the last item in the vector...
Definition: qvector.h:250
int row() const
Returns the row this model index refers to.
void select(const QModelIndex &topLeft, const QModelIndex &bottomRight)
Adds the items in the range that extends from the top-left model item, specified by the topLeft index...
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
The QItemSelection class manages information about selected items in a model.
iterator begin()
Returns an STL-style iterator pointing to the first item in the vector.
Definition: qvector.h:247
The QModelIndex class is used to locate data in a data model.

◆ selectionAllowed()

bool QListViewPrivate::selectionAllowed ( const QModelIndex index) const
inlinevirtual

Reimplemented from QAbstractItemViewPrivate.

Definition at line 354 of file qlistview_p.h.

355  { if (viewMode == QListView::ListMode && !showElasticBand) return index.isValid(); return true; }
QListView::ViewMode viewMode
Definition: qlistview_p.h:413
bool isValid() const
Returns true if this model index is valid; otherwise returns false.

◆ setContentsSize()

void QListViewPrivate::setContentsSize ( int  w,
int  h 
)
inline

Definition at line 323 of file qlistview_p.h.

323 { commonListView->contentsSize = QSize(w, h); }
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53

◆ setGridSize()

void QListViewPrivate::setGridSize ( const QSize size)
inline

Definition at line 368 of file qlistview_p.h.

368 { grid = size; }

◆ setSelectionRectVisible()

void QListViewPrivate::setSelectionRectVisible ( bool  visible)
inline

Definition at line 374 of file qlistview_p.h.

374 { showElasticBand = visible; }

◆ setSpacing()

void QListViewPrivate::setSpacing ( int  s)
inline

Definition at line 372 of file qlistview_p.h.

372 { space = s; }

◆ setWrapping()

void QListViewPrivate::setWrapping ( bool  b)
inline

Definition at line 370 of file qlistview_p.h.

370 { wrap = b; }

◆ spacing()

int QListViewPrivate::spacing ( ) const
inline

◆ verticalScrollToValue()

int QListViewPrivate::verticalScrollToValue ( const QModelIndex index,
const QRect rect,
QListView::ScrollHint  hint 
) const

Definition at line 631 of file qlistview.cpp.

633 {
634  Q_Q(const QListView);
635  const QRect area = viewport->rect();
636  const bool above = (hint == QListView::EnsureVisible && rect.top() < area.top());
637  const bool below = (hint == QListView::EnsureVisible && rect.bottom() > area.bottom());
638  return commonListView->verticalScrollToValue(q->visualIndex(index), hint, above, below, area, rect);
639 }
virtual int verticalScrollToValue(int index, QListView::ScrollHint hint, bool above, bool below, const QRect &area, const QRect &rect) const
Definition: qlistview.cpp:1951
int bottom() const
Returns the y-coordinate of the rectangle&#39;s bottom edge.
Definition: qrect.h:249
#define Q_Q(Class)
Definition: qglobal.h:2483
int top() const
Returns the y-coordinate of the rectangle&#39;s top edge.
Definition: qrect.h:243
The QListView class provides a list or icon view onto a model.
Definition: qlistview.h:57
QCommonListViewBase * commonListView
Definition: qlistview_p.h:401
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
static int area(const QSize &s)
Definition: qicon.cpp:155

◆ viewItemRect()

QRect QListViewPrivate::viewItemRect ( const QListViewItem item) const
inline

Definition at line 331 of file qlistview_p.h.

Referenced by QIconModeViewBase::itemsRect().

332  { if (q_func()->isRightToLeft()) return flipX(item.rect()); return item.rect(); }
QRect rect() const
Definition: qlistview_p.h:97
int flipX(int x) const
Definition: qlistview_p.h:325

◆ viewUpdateGeometries()

void QListViewPrivate::viewUpdateGeometries ( )
inline

Definition at line 346 of file qlistview_p.h.

346 { q_func()->updateGeometries(); }

Properties

◆ batchLayoutTimer

QBasicTimer QListViewPrivate::batchLayoutTimer

Definition at line 432 of file qlistview_p.h.

◆ batchSize

int QListViewPrivate::batchSize

Definition at line 440 of file qlistview_p.h.

◆ cachedItemSize

QSize QListViewPrivate::cachedItemSize
mutable

Definition at line 439 of file qlistview_p.h.

Referenced by clear(), QListModeViewBase::indexToListViewItem(), and itemSize().

◆ column

int QListViewPrivate::column

Definition at line 437 of file qlistview_p.h.

Referenced by QIconModeViewBase::dataChanged(), and itemSize().

◆ commonListView

QCommonListViewBase* QListViewPrivate::commonListView

◆ elasticBand

QRect QListViewPrivate::elasticBand

Definition at line 442 of file qlistview_p.h.

Referenced by scrollElasticBandBy().

◆ flow

QListView::Flow QListViewPrivate::flow

◆ grid

QSize QListViewPrivate::grid

Definition at line 407 of file qlistview_p.h.

◆ hiddenRows

QSet<QPersistentModelIndex> QListViewPrivate::hiddenRows

Definition at line 435 of file qlistview_p.h.

◆ layoutBounds

QRect QListViewPrivate::layoutBounds

Definition at line 429 of file qlistview_p.h.

Referenced by doItemsLayout(), and prepareItemsLayout().

◆ layoutMode

QListView::LayoutMode QListViewPrivate::layoutMode

Definition at line 412 of file qlistview_p.h.

◆ modeProperties

uint QListViewPrivate::modeProperties

Definition at line 427 of file qlistview_p.h.

◆ movement

QListView::Movement QListViewPrivate::movement

◆ resizeMode

QListView::ResizeMode QListViewPrivate::resizeMode

Definition at line 411 of file qlistview_p.h.

◆ showElasticBand

bool QListViewPrivate::showElasticBand

Definition at line 443 of file qlistview_p.h.

◆ space

int QListViewPrivate::space

Definition at line 406 of file qlistview_p.h.

◆ uniformItemSizes

bool QListViewPrivate::uniformItemSizes

◆ viewMode

QListView::ViewMode QListViewPrivate::viewMode

Definition at line 413 of file qlistview_p.h.

Referenced by dropOn(), and position().

◆ wrap

bool QListViewPrivate::wrap

Definition at line 405 of file qlistview_p.h.


The documentation for this class was generated from the following files: