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

#include <qtableview_p.h>

Inheritance diagram for QTableViewPrivate:
QAbstractItemViewPrivate QAbstractScrollAreaPrivate QFramePrivate QWidgetPrivate QObjectPrivate QObjectData QTableWidgetPrivate

Public Functions

void _q_selectColumn (int column)
 
void _q_selectRow (int row)
 
void _q_updateSpanInsertedColumns (const QModelIndex &parent, int start, int end)
 Updates spans after column insertion. More...
 
void _q_updateSpanInsertedRows (const QModelIndex &parent, int start, int end)
 Updates spans after row insertion. More...
 
void _q_updateSpanRemovedColumns (const QModelIndex &parent, int start, int end)
 Updates spans after column removal. More...
 
void _q_updateSpanRemovedRows (const QModelIndex &parent, int start, int end)
 Updates spans after row removal. More...
 
int accessibleTable2Index (const QModelIndex &index) const
 
int columnSpan (int row, int column) const
 
int columnSpanEndLogical (int column, int span) const
 
int columnSpanWidth (int column, int span) const
 
void drawAndClipSpans (const QRegion &area, QPainter *painter, const QStyleOptionViewItemV4 &option, QBitArray *drawn, int firstVisualRow, int lastVisualRow, int firstVisualColumn, int lastVisualColumn)
 Draws the spanning cells within rect area, and clips them off as preparation for the main drawing loop. More...
 
void drawCell (QPainter *painter, const QStyleOptionViewItemV4 &option, const QModelIndex &index)
 Draws a table cell. More...
 
bool hasSpans () const
 
void init ()
 
bool isCellEnabled (int row, int column) const
 
bool isColumnHidden (int column) const
 
bool isHidden (int row, int col) const
 
bool isRowHidden (int row) const
 
bool isVisualColumnHiddenOrDisabled (int row, int column) const
 
bool isVisualRowHiddenOrDisabled (int row, int column) const
 
int logicalColumn (int visualCol) const
 
int logicalRow (int visualRow) const
 
 QTableViewPrivate ()
 
int rowSpan (int row, int column) const
 
int rowSpanEndLogical (int row, int span) const
 
int rowSpanHeight (int row, int span) const
 
int sectionSpanEndLogical (const QHeaderView *header, int logical, int span) const
 Returns the logical index of the last section that's part of the span. More...
 
int sectionSpanSize (const QHeaderView *header, int logical, int span) const
 Returns the size of the span starting at logical index logical and spanning span sections. More...
 
void selectColumn (int column, bool anchor)
 
void selectRow (int row, bool anchor)
 
void setSpan (int row, int column, int rowSpan, int columnSpan)
 Sets the span for the cell at (row, column). More...
 
QSpanCollection::Span span (int row, int column) const
 Gets the span information for the cell at (row, column). More...
 
bool spanContainsSection (const QHeaderView *header, int logical, int spanLogical, int span) const
 Returns true if the section at logical index logical is part of the span starting at logical index spanLogical and spanning span sections; otherwise, returns false. More...
 
void trimHiddenSelections (QItemSelectionRange *range) const
 Trims away indices that are hidden in the treeview due to hidden horizontal or vertical sections. More...
 
int visualColumn (int logicalCol) const
 
int visualRow (int logicalRow) const
 
QRect visualSpanRect (const QSpanCollection::Span &span) const
 Returns the visual rect for the given span. More...
 
- 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 ()
 
virtual QItemViewPaintPairs draggablePaintPairs (const QModelIndexList &indexes, QRect *r) const
 
virtual 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...
 
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)
 
virtual QAbstractItemView::DropIndicatorPosition position (const QPoint &pos, const QRect &rect, const QModelIndex &idx) const
 
 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)
 
virtual void selectAll (QItemSelectionModel::SelectionFlags command)
 
QModelIndexList selectedDraggableIndexes () const
 
virtual bool selectionAllowed (const QModelIndex &index) 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

int columnResizeTimerID
 
int columnSectionAnchor
 
QList< int > columnsToUpdate
 
QWidgetcornerWidget
 
bool geometryRecursionBlock
 
Qt::PenStyle gridStyle
 
QHeaderViewhorizontalHeader
 
int rowResizeTimerID
 
int rowSectionAnchor
 
QList< int > rowsToUpdate
 
bool showGrid
 
bool sortingEnabled
 
QSpanCollection spans
 
QHeaderViewverticalHeader
 
QPoint visualCursor
 
- 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

- 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 **)
 
- 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 133 of file qtableview_p.h.

Constructors and Destructors

◆ QTableViewPrivate()

QTableViewPrivate::QTableViewPrivate ( )
inline

Definition at line 137 of file qtableview_p.h.

138  : showGrid(true), gridStyle(Qt::SolidLine),
142  sortingEnabled(false), geometryRecursionBlock(false),
144  {
145  wrapItemText = true;
146 #ifndef QT_NO_DRAGANDDROP
147  overwrite = true;
148 #endif
149  }
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
Qt::PenStyle gridStyle
Definition: qtableview_p.h:184

Functions

◆ _q_selectColumn()

void QTableViewPrivate::_q_selectColumn ( int  column)

Definition at line 3184 of file qtableview.cpp.

3185 {
3186  selectColumn(column, false);
3187 }
void selectColumn(int column, bool anchor)

◆ _q_selectRow()

void QTableViewPrivate::_q_selectRow ( int  row)

Definition at line 3179 of file qtableview.cpp.

3180 {
3181  selectRow(row, false);
3182 }
void selectRow(int row, bool anchor)

◆ _q_updateSpanInsertedColumns()

void QTableViewPrivate::_q_updateSpanInsertedColumns ( const QModelIndex parent,
int  start,
int  end 
)

Updates spans after column insertion.

Warning
This function is not part of the public interface.

Definition at line 904 of file qtableview.cpp.

905 {
906  Q_UNUSED(parent)
908 }
void updateInsertedColumns(int start, int end)
Definition: qtableview.cpp:258
QSpanCollection spans
Definition: qtableview_p.h:198
static const KeyPair *const end
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ _q_updateSpanInsertedRows()

void QTableViewPrivate::_q_updateSpanInsertedRows ( const QModelIndex parent,
int  start,
int  end 
)

Updates spans after row insertion.

Warning
This function is not part of the public interface.

Definition at line 891 of file qtableview.cpp.

892 {
893  Q_UNUSED(parent)
894  spans.updateInsertedRows(start, end);
895 }
QSpanCollection spans
Definition: qtableview_p.h:198
void updateInsertedRows(int start, int end)
Definition: qtableview.cpp:208
static const KeyPair *const end
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ _q_updateSpanRemovedColumns()

void QTableViewPrivate::_q_updateSpanRemovedColumns ( const QModelIndex parent,
int  start,
int  end 
)

Updates spans after column removal.

Warning
This function is not part of the public interface.

Definition at line 930 of file qtableview.cpp.

931 {
932  Q_UNUSED(parent)
934 }
void updateRemovedColumns(int start, int end)
Definition: qtableview.cpp:470
QSpanCollection spans
Definition: qtableview_p.h:198
static const KeyPair *const end
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ _q_updateSpanRemovedRows()

void QTableViewPrivate::_q_updateSpanRemovedRows ( const QModelIndex parent,
int  start,
int  end 
)

Updates spans after row removal.

Warning
This function is not part of the public interface.

Definition at line 917 of file qtableview.cpp.

918 {
919  Q_UNUSED(parent)
920  spans.updateRemovedRows(start, end);
921 }
QSpanCollection spans
Definition: qtableview_p.h:198
void updateRemovedRows(int start, int end)
Definition: qtableview.cpp:341
static const KeyPair *const end
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
Definition: qglobal.h:1729

◆ accessibleTable2Index()

int QTableViewPrivate::accessibleTable2Index ( const QModelIndex index) const
inline

Definition at line 170 of file qtableview_p.h.

170  {
171  return (index.row() + (horizontalHeader ? 1 : 0)) * (index.model()->columnCount() + (verticalHeader ? 1 : 0))
172  + index.column() + (verticalHeader ? 1 : 0) + 1;
173  }
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
int row() const
Returns the row this model index refers to.
const QAbstractItemModel * model() const
Returns a pointer to the model containing the item that this index refers to.
int column() const
Returns the column this model index refers to.

◆ columnSpan()

int QTableViewPrivate::columnSpan ( int  row,
int  column 
) const
inline

Definition at line 205 of file qtableview_p.h.

205  {
206  return span(row, column).width();
207  }
QSpanCollection::Span span(int row, int column) const
Gets the span information for the cell at (row, column).
Definition: qtableview.cpp:721

◆ columnSpanEndLogical()

int QTableViewPrivate::columnSpanEndLogical ( int  column,
int  span 
) const
inline

Definition at line 220 of file qtableview_p.h.

220  {
222  }
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
QSpanCollection::Span span(int row, int column) const
Gets the span information for the cell at (row, column).
Definition: qtableview.cpp:721
int sectionSpanEndLogical(const QHeaderView *header, int logical, int span) const
Returns the logical index of the last section that&#39;s part of the span.
Definition: qtableview.cpp:737

◆ columnSpanWidth()

int QTableViewPrivate::columnSpanWidth ( int  column,
int  span 
) const
inline

Definition at line 214 of file qtableview_p.h.

214  {
215  return sectionSpanSize(horizontalHeader, column, span);
216  }
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
QSpanCollection::Span span(int row, int column) const
Gets the span information for the cell at (row, column).
Definition: qtableview.cpp:721
int sectionSpanSize(const QHeaderView *header, int logical, int span) const
Returns the size of the span starting at logical index logical and spanning span sections.
Definition: qtableview.cpp:757

◆ drawAndClipSpans()

void QTableViewPrivate::drawAndClipSpans ( const QRegion area,
QPainter painter,
const QStyleOptionViewItemV4 option,
QBitArray drawn,
int  firstVisualRow,
int  lastVisualRow,
int  firstVisualColumn,
int  lastVisualColumn 
)

Draws the spanning cells within rect area, and clips them off as preparation for the main drawing loop.

Warning
This function is not part of the public interface.

drawn is a QBitArray of visualRowCountxvisualCoulumnCount which say if particular cell has been drawn

Definition at line 826 of file qtableview.cpp.

829 {
830  bool alternateBase = false;
831  QRegion region = viewport->rect();
832 
833  QList<QSpanCollection::Span *> visibleSpans;
834  bool sectionMoved = verticalHeader->sectionsMoved() || horizontalHeader->sectionsMoved();
835 
836  if (!sectionMoved) {
837  visibleSpans = spans.spansInRect(logicalColumn(firstVisualColumn), logicalRow(firstVisualRow),
838  lastVisualColumn - firstVisualColumn + 1, lastVisualRow - firstVisualRow + 1);
839  } else {
841  for(int x = firstVisualColumn; x <= lastVisualColumn; x++)
842  for(int y = firstVisualRow; y <= lastVisualRow; y++)
843  set.insert(spans.spanAt(x,y));
844  set.remove(0);
845  visibleSpans = set.toList();
846  }
847 
848  foreach (QSpanCollection::Span *span, visibleSpans) {
849  int row = span->top();
850  int col = span->left();
851  QModelIndex index = model->index(row, col, root);
852  if (!index.isValid())
853  continue;
854  QRect rect = visualSpanRect(*span);
856  if (!area.intersects(rect))
857  continue;
858  QStyleOptionViewItemV4 opt = option;
859  opt.rect = rect;
860  alternateBase = alternatingColors && (span->top() & 1);
861  if (alternateBase)
863  else
864  opt.features &= ~QStyleOptionViewItemV2::Alternate;
865  drawCell(painter, opt, index);
866  region -= rect;
867  for (int r = span->top(); r <= span->bottom(); ++r) {
868  const int vr = visualRow(r);
869  if (vr < firstVisualRow || vr > lastVisualRow)
870  continue;
871  for (int c = span->left(); c <= span->right(); ++c) {
872  const int vc = visualColumn(c);
873  if (vc < firstVisualColumn || vc > lastVisualColumn)
874  continue;
875  drawn->setBit((vr - firstVisualRow) * (lastVisualColumn - firstVisualColumn + 1)
876  + vc - firstVisualColumn);
877  }
878  }
879 
880  }
881  painter->setClipRegion(region);
882 }
unsigned char c[8]
Definition: qnumeric_p.h:62
void setBit(int i)
Sets the bit at index position i to 1.
Definition: qbitarray.h:128
QRect visualSpanRect(const QSpanCollection::Span &span) const
Returns the visual rect for the given span.
Definition: qtableview.cpp:797
int visualColumn(int logicalCol) const
Definition: qtableview_p.h:160
Span * spanAt(int x, int y) const
Definition: qtableview.cpp:142
bool remove(const T &value)
Definition: qset.h:89
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:609
QList< Span * > spansInRect(int x, int y, int w, int h) const
Definition: qtableview.cpp:170
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
bool sectionsMoved() const
Returns true if sections in the header has been moved; otherwise returns false;.
The QStyleOptionViewItemV2 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:562
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...
QSpanCollection spans
Definition: qtableview_p.h:198
ViewItemFeatures features
a bitwise OR of the features that describe this view item
Definition: qstyleoption.h:577
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
void drawCell(QPainter *painter, const QStyleOptionViewItemV4 &option, const QModelIndex &index)
Draws a table cell.
Definition: qtableview.cpp:943
int logicalRow(int visualRow) const
Definition: qtableview_p.h:163
The QRegion class specifies a clip region for a painter.
Definition: qregion.h:68
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
int visualRow(int logicalRow) const
Definition: qtableview_p.h:157
QPersistentModelIndex root
QSpanCollection::Span span(int row, int column) const
Gets the span information for the cell at (row, column).
Definition: qtableview.cpp:721
void setClipRegion(const QRegion &, Qt::ClipOperation op=Qt::ReplaceClip)
Sets the clip region to the given region using the specified clip operation.
Definition: qpainter.cpp:2917
QRect rect
the internal geometry of the widget excluding any window frame
Definition: qwidget.h:168
int logicalColumn(int visualCol) const
Definition: qtableview_p.h:166
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
bool intersects(const QRegion &r) const
Returns true if this region intersects with region, otherwise returns false.
Definition: qregion.cpp:766
void translate(int dx, int dy)
Moves the rectangle dx along the x axis and dy along the y axis, relative to the current position...
Definition: qrect.h:312
QAbstractItemModel * model
QRect rect
the area that should be used for various calculations and painting
Definition: qstyleoption.h:90
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ drawCell()

void QTableViewPrivate::drawCell ( QPainter painter,
const QStyleOptionViewItemV4 option,
const QModelIndex index 
)

Draws a table cell.

Warning
This function is not part of the public interface.

Definition at line 943 of file qtableview.cpp.

944 {
945  Q_Q(QTableView);
946  QStyleOptionViewItemV4 opt = option;
947 
950  if (index == hover)
952  if (option.state & QStyle::State_Enabled) {
954  if ((model->flags(index) & Qt::ItemIsEnabled) == 0) {
955  opt.state &= ~QStyle::State_Enabled;
956  cg = QPalette::Disabled;
957  } else {
958  cg = QPalette::Normal;
959  }
961  }
962 
963  if (index == q->currentIndex()) {
964  const bool focus = (q->hasFocus() || viewport->hasFocus()) && q->currentIndex().isValid();
965  if (focus)
967  }
968 
969  q->style()->drawPrimitive(QStyle::PE_PanelItemViewRow, &opt, painter, q);
970 
971  q->itemDelegate(index)->paint(painter, opt, index);
972 }
QPersistentModelIndex hover
QStyle::State state
the style flags that are used when drawing the control
Definition: qstyleoption.h:88
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
Definition: qstyleoption.h:609
QPointer< QItemSelectionModel > selectionModel
bool hasFocus() const
Definition: qwidget.cpp:6583
#define Q_Q(Class)
Definition: qglobal.h:2483
ColorGroup
Definition: qpalette.h:92
virtual Qt::ItemFlags flags(const QModelIndex &index) const
Returns the item flags for the given index.
void setCurrentColorGroup(ColorGroup cg)
Set the palette&#39;s current color group to cg.
Definition: qpalette.h:105
bool isSelected(const QModelIndex &index) const
Returns true if the given model item index is selected.
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
QPalette palette
the palette that should be used when painting the control
Definition: qstyleoption.h:92
The QStyle class is an abstract base class that encapsulates the look and feel of a GUI...
Definition: qstyle.h:68
if(void) toggleToolbarShown
QAbstractItemModel * model

◆ hasSpans()

bool QTableViewPrivate::hasSpans ( ) const
inline

Definition at line 208 of file qtableview_p.h.

208  {
209  return !spans.spans.isEmpty();
210  }
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlinkedlist.h:103
QSpanCollection spans
Definition: qtableview_p.h:198

◆ init()

void QTableViewPrivate::init ( )

Definition at line 615 of file qtableview.cpp.

616 {
617  Q_Q(QTableView);
618 
620 
621  QHeaderView *vertical = new QHeaderView(Qt::Vertical, q);
622  vertical->setClickable(true);
623  vertical->setHighlightSections(true);
624  q->setVerticalHeader(vertical);
625 
626  QHeaderView *horizontal = new QHeaderView(Qt::Horizontal, q);
627  horizontal->setClickable(true);
628  horizontal->setHighlightSections(true);
629  q->setHorizontalHeader(horizontal);
630 
631  tabKeyNavigation = true;
632 
635  QObject::connect(cornerWidget, SIGNAL(clicked()), q, SLOT(selectAll()));
636 }
void setHighlightSections(bool highlight)
#define SLOT(a)
Definition: qobjectdefs.h:226
virtual void selectAll(QItemSelectionModel::SelectionFlags command)
#define Q_Q(Class)
Definition: qglobal.h:2483
#define SIGNAL(a)
Definition: qobjectdefs.h:227
void setClickable(bool clickable)
If clickable is true, the header will respond to single clicks.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
Definition: qobject.cpp:2580
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
QAbstractItemView::EditTriggers editTriggers
QWidget * cornerWidget
Definition: qtableview_p.h:193
void setFocusPolicy(Qt::FocusPolicy policy)
Definition: qwidget.cpp:7631
The QHeaderView class provides a header row or header column for item views.
Definition: qheaderview.h:58

◆ isCellEnabled()

bool QTableViewPrivate::isCellEnabled ( int  row,
int  column 
) const
inline

Definition at line 230 of file qtableview_p.h.

230  {
231  return isIndexEnabled(model->index(row, column, root));
232  }
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 isIndexEnabled(const QModelIndex &index) const
QPersistentModelIndex root
QAbstractItemModel * model

◆ isColumnHidden()

bool QTableViewPrivate::isColumnHidden ( int  column) const
inline

Definition at line 227 of file qtableview_p.h.

227  {
228  return horizontalHeader->isSectionHidden(column);
229  }
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
bool isSectionHidden(int logicalIndex) const
Returns true if the section specified by logicalIndex is explicitly hidden from the user; otherwise r...

◆ isHidden()

bool QTableViewPrivate::isHidden ( int  row,
int  col 
) const
inline

Definition at line 153 of file qtableview_p.h.

153  {
154  return verticalHeader->isSectionHidden(row)
156  }
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
bool isSectionHidden(int logicalIndex) const
Returns true if the section specified by logicalIndex is explicitly hidden from the user; otherwise r...
QHeaderView * verticalHeader
Definition: qtableview_p.h:192

◆ isRowHidden()

bool QTableViewPrivate::isRowHidden ( int  row) const
inline

Definition at line 224 of file qtableview_p.h.

224  {
225  return verticalHeader->isSectionHidden(row);
226  }
bool isSectionHidden(int logicalIndex) const
Returns true if the section specified by logicalIndex is explicitly hidden from the user; otherwise r...
QHeaderView * verticalHeader
Definition: qtableview_p.h:192

◆ isVisualColumnHiddenOrDisabled()

bool QTableViewPrivate::isVisualColumnHiddenOrDisabled ( int  row,
int  column 
) const
inline

Definition at line 238 of file qtableview_p.h.

238  {
239  int r = logicalRow(row);
240  int c = logicalColumn(column);
241  return isColumnHidden(c) || !isCellEnabled(r, c);
242  }
bool isCellEnabled(int row, int column) const
Definition: qtableview_p.h:230
unsigned char c[8]
Definition: qnumeric_p.h:62
bool isColumnHidden(int column) const
Definition: qtableview_p.h:227
int logicalRow(int visualRow) const
Definition: qtableview_p.h:163
int logicalColumn(int visualCol) const
Definition: qtableview_p.h:166

◆ isVisualRowHiddenOrDisabled()

bool QTableViewPrivate::isVisualRowHiddenOrDisabled ( int  row,
int  column 
) const
inline

Definition at line 233 of file qtableview_p.h.

233  {
234  int r = logicalRow(row);
235  int c = logicalColumn(column);
236  return isRowHidden(r) || !isCellEnabled(r, c);
237  }
bool isCellEnabled(int row, int column) const
Definition: qtableview_p.h:230
unsigned char c[8]
Definition: qnumeric_p.h:62
int logicalRow(int visualRow) const
Definition: qtableview_p.h:163
bool isRowHidden(int row) const
Definition: qtableview_p.h:224
int logicalColumn(int visualCol) const
Definition: qtableview_p.h:166

◆ logicalColumn()

int QTableViewPrivate::logicalColumn ( int  visualCol) const
inline

Definition at line 166 of file qtableview_p.h.

166  {
167  return horizontalHeader->logicalIndex(visualCol);
168  }
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
int logicalIndex(int visualIndex) const
Returns the logicalIndex for the section at the given visualIndex position, or -1 if visualIndex < 0 ...

◆ logicalRow()

int QTableViewPrivate::logicalRow ( int  visualRow) const
inline

Definition at line 163 of file qtableview_p.h.

163  {
165  }
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
int visualRow(int logicalRow) const
Definition: qtableview_p.h:157
int logicalIndex(int visualIndex) const
Returns the logicalIndex for the section at the given visualIndex position, or -1 if visualIndex < 0 ...

◆ rowSpan()

int QTableViewPrivate::rowSpan ( int  row,
int  column 
) const
inline

Definition at line 202 of file qtableview_p.h.

202  {
203  return span(row, column).height();
204  }
QSpanCollection::Span span(int row, int column) const
Gets the span information for the cell at (row, column).
Definition: qtableview.cpp:721

◆ rowSpanEndLogical()

int QTableViewPrivate::rowSpanEndLogical ( int  row,
int  span 
) const
inline

Definition at line 217 of file qtableview_p.h.

217  {
219  }
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
QSpanCollection::Span span(int row, int column) const
Gets the span information for the cell at (row, column).
Definition: qtableview.cpp:721
int sectionSpanEndLogical(const QHeaderView *header, int logical, int span) const
Returns the logical index of the last section that&#39;s part of the span.
Definition: qtableview.cpp:737

◆ rowSpanHeight()

int QTableViewPrivate::rowSpanHeight ( int  row,
int  span 
) const
inline

Definition at line 211 of file qtableview_p.h.

211  {
212  return sectionSpanSize(verticalHeader, row, span);
213  }
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
QSpanCollection::Span span(int row, int column) const
Gets the span information for the cell at (row, column).
Definition: qtableview.cpp:721
int sectionSpanSize(const QHeaderView *header, int logical, int span) const
Returns the size of the span starting at logical index logical and spanning span sections.
Definition: qtableview.cpp:757

◆ sectionSpanEndLogical()

int QTableViewPrivate::sectionSpanEndLogical ( const QHeaderView header,
int  logical,
int  span 
) const

Returns the logical index of the last section that's part of the span.

Warning
This function is not part of the public interface.

Definition at line 737 of file qtableview.cpp.

738 {
739  int visual = header->visualIndex(logical);
740  for (int i = 1; i < span; ) {
741  if (++visual >= header->count())
742  break;
743  logical = header->logicalIndex(visual);
744  ++i;
745  }
746  return logical;
747 }
int visualIndex(int logicalIndex) const
Returns the visual index position of the section specified by the given logicalIndex, or -1 otherwise.
QSpanCollection::Span span(int row, int column) const
Gets the span information for the cell at (row, column).
Definition: qtableview.cpp:721
int logicalIndex(int visualIndex) const
Returns the logicalIndex for the section at the given visualIndex position, or -1 if visualIndex < 0 ...
int count() const
Returns the number of sections in the header.

◆ sectionSpanSize()

int QTableViewPrivate::sectionSpanSize ( const QHeaderView header,
int  logical,
int  span 
) const

Returns the size of the span starting at logical index logical and spanning span sections.

Warning
This function is not part of the public interface.

Definition at line 757 of file qtableview.cpp.

758 {
759  int endLogical = sectionSpanEndLogical(header, logical, span);
760  return header->sectionPosition(endLogical)
761  - header->sectionPosition(logical)
762  + header->sectionSize(endLogical);
763 }
QSpanCollection::Span span(int row, int column) const
Gets the span information for the cell at (row, column).
Definition: qtableview.cpp:721
int sectionSpanEndLogical(const QHeaderView *header, int logical, int span) const
Returns the logical index of the last section that&#39;s part of the span.
Definition: qtableview.cpp:737
int sectionSize(int logicalIndex) const
Returns the width (or height for vertical headers) of the given logicalIndex.
int sectionPosition(int logicalIndex) const
Returns the section position of the given logicalIndex, or -1 if the section is hidden.

◆ selectColumn()

void QTableViewPrivate::selectColumn ( int  column,
bool  anchor 
)

Definition at line 3227 of file qtableview.cpp.

3228 {
3229  Q_Q(QTableView);
3230 
3231  if (q->selectionBehavior() == QTableView::SelectRows
3232  || (q->selectionMode() == QTableView::SingleSelection
3233  && q->selectionBehavior() == QTableView::SelectItems))
3234  return;
3235 
3236  if (column >= 0 && column < model->columnCount(root)) {
3237  int row = verticalHeader->logicalIndexAt(0);
3238  QModelIndex index = model->index(row, column, root);
3239  QItemSelectionModel::SelectionFlags command = q->selectionCommand(index);
3241  if ((anchor && !(command & QItemSelectionModel::Current))
3242  || (q->selectionMode() == QTableView::SingleSelection))
3243  columnSectionAnchor = column;
3244 
3245  if (q->selectionMode() != QTableView::SingleSelection
3246  && command.testFlag(QItemSelectionModel::Toggle)) {
3247  if (anchor)
3250  command &= ~QItemSelectionModel::Toggle;
3251  command |= ctrlDragSelectionFlag;
3252  if (!anchor)
3253  command |= QItemSelectionModel::Current;
3254  }
3255 
3256  QModelIndex tl = model->index(0, qMin(columnSectionAnchor, column), root);
3257  QModelIndex br = model->index(model->rowCount(root) - 1,
3258  qMax(columnSectionAnchor, column), root);
3259  if (horizontalHeader->sectionsMoved() && tl.column() != br.column())
3260  q->setSelection(q->visualRect(tl)|q->visualRect(br), command);
3261  else
3262  selectionModel->select(QItemSelection(tl, br), command);
3263  }
3264 }
The QItemSelectionModel class keeps track of a view&#39;s selected items.
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.
QPointer< QItemSelectionModel > selectionModel
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
bool sectionsMoved() const
Returns true if sections in the header has been moved; otherwise returns false;.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define Q_Q(Class)
Definition: qglobal.h:2483
void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Sets the model item index to be the current item, and emits currentChanged().
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...
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Definition: qlist.h:880
QItemSelectionModel * selectionModel() const
Returns the current selection model.
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
QItemSelectionModel::SelectionFlag ctrlDragSelectionFlag
QPersistentModelIndex root
The QItemSelection class manages information about selected items in a model.
QModelIndexList selectedColumns(int row=0) const
Returns the indexes in the given row for columns where all rows are selected.
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.
quint16 index
int logicalIndexAt(int position) const
Returns the section that covers the given position in the viewport.
QAbstractItemModel * model
int column() const
Returns the column this model index refers to.

◆ selectRow()

void QTableViewPrivate::selectRow ( int  row,
bool  anchor 
)

Definition at line 3189 of file qtableview.cpp.

3190 {
3191  Q_Q(QTableView);
3192 
3193  if (q->selectionBehavior() == QTableView::SelectColumns
3194  || (q->selectionMode() == QTableView::SingleSelection
3195  && q->selectionBehavior() == QTableView::SelectItems))
3196  return;
3197 
3198  if (row >= 0 && row < model->rowCount(root)) {
3199  int column = horizontalHeader->logicalIndexAt(q->isRightToLeft() ? viewport->width() : 0);
3200  QModelIndex index = model->index(row, column, root);
3201  QItemSelectionModel::SelectionFlags command = q->selectionCommand(index);
3203  if ((anchor && !(command & QItemSelectionModel::Current))
3204  || (q->selectionMode() == QTableView::SingleSelection))
3205  rowSectionAnchor = row;
3206 
3207  if (q->selectionMode() != QTableView::SingleSelection
3208  && command.testFlag(QItemSelectionModel::Toggle)) {
3209  if (anchor)
3212  command &= ~QItemSelectionModel::Toggle;
3213  command |= ctrlDragSelectionFlag;
3214  if (!anchor)
3215  command |= QItemSelectionModel::Current;
3216  }
3217 
3218  QModelIndex tl = model->index(qMin(rowSectionAnchor, row), 0, root);
3220  if (verticalHeader->sectionsMoved() && tl.row() != br.row())
3221  q->setSelection(q->visualRect(tl)|q->visualRect(br), command);
3222  else
3223  selectionModel->select(QItemSelection(tl, br), command);
3224  }
3225 }
QModelIndexList selectedRows(int column=0) const
Returns the indexes in the given column for the rows where all columns are selected.
virtual int columnCount(const QModelIndex &parent=QModelIndex()) const =0
Returns the number of columns for the children of the given parent.
The QItemSelectionModel class keeps track of a view&#39;s selected items.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
int width
the width of the widget excluding any window frame
Definition: qwidget.h:166
QPointer< QItemSelectionModel > selectionModel
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
bool sectionsMoved() const
Returns true if sections in the header has been moved; otherwise returns false;.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
#define Q_Q(Class)
Definition: qglobal.h:2483
void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Sets the model item index to be the current item, and emits currentChanged().
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...
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Definition: qlist.h:880
QItemSelectionModel * selectionModel() const
Returns the current selection model.
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
int row() const
Returns the row this model index refers to.
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
QItemSelectionModel::SelectionFlag ctrlDragSelectionFlag
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.
quint16 index
int logicalIndexAt(int position) const
Returns the section that covers the given position in the viewport.
QAbstractItemModel * model

◆ setSpan()

void QTableViewPrivate::setSpan ( int  row,
int  column,
int  rowSpan,
int  columnSpan 
)

Sets the span for the cell at (row, column).

Warning
This function is not part of the public interface.

Definition at line 686 of file qtableview.cpp.

687 {
688  if (row < 0 || column < 0 || rowSpan <= 0 || columnSpan <= 0) {
689  qWarning() << "QTableView::setSpan: invalid span given: (" << row << ',' << column << ',' << rowSpan << ',' << columnSpan << ')';
690  return;
691  }
692  QSpanCollection::Span *sp = spans.spanAt(column, row);
693  if (sp) {
694  if (sp->top() != row || sp->left() != column) {
695  qWarning() << "QTableView::setSpan: span cannot overlap";
696  return;
697  }
698  if (rowSpan == 1 && columnSpan == 1) {
699  rowSpan = columnSpan = 0;
700  }
701  const int old_height = sp->height();
702  sp->m_bottom = row + rowSpan - 1;
703  sp->m_right = column + columnSpan - 1;
704  spans.updateSpan(sp, old_height);
705  return;
706  } else if (rowSpan == 1 && columnSpan == 1) {
707  qWarning() << "QTableView::setSpan: single cell span won't be added";
708  return;
709  }
710  sp = new QSpanCollection::Span(row, column, rowSpan, columnSpan);
711  spans.addSpan(sp);
712 }
void addSpan(Span *span)
Definition: qtableview.cpp:65
Span * spanAt(int x, int y) const
Definition: qtableview.cpp:142
void updateSpan(Span *span, int old_height)
Definition: qtableview.cpp:103
int rowSpan(int row, int column) const
Definition: qtableview_p.h:202
QSpanCollection spans
Definition: qtableview_p.h:198
Q_CORE_EXPORT void qWarning(const char *,...)
int columnSpan(int row, int column) const
Definition: qtableview_p.h:205

◆ span()

QSpanCollection::Span QTableViewPrivate::span ( int  row,
int  column 
) const

Gets the span information for the cell at (row, column).

Warning
This function is not part of the public interface.

Definition at line 721 of file qtableview.cpp.

722 {
723  QSpanCollection::Span *sp = spans.spanAt(column, row);
724  if (sp)
725  return *sp;
726 
727  return QSpanCollection::Span(row, column, 1, 1);
728 }
Span * spanAt(int x, int y) const
Definition: qtableview.cpp:142
QSpanCollection spans
Definition: qtableview_p.h:198

◆ spanContainsSection()

bool QTableViewPrivate::spanContainsSection ( const QHeaderView header,
int  logical,
int  spanLogical,
int  span 
) const

Returns true if the section at logical index logical is part of the span starting at logical index spanLogical and spanning span sections; otherwise, returns false.

Warning
This function is not part of the public interface.

Definition at line 774 of file qtableview.cpp.

775 {
776  if (logical == spanLogical)
777  return true; // it's the start of the span
778  int visual = header->visualIndex(spanLogical);
779  for (int i = 1; i < span; ) {
780  if (++visual >= header->count())
781  break;
782  spanLogical = header->logicalIndex(visual);
783  if (logical == spanLogical)
784  return true;
785  ++i;
786  }
787  return false;
788 }
int visualIndex(int logicalIndex) const
Returns the visual index position of the section specified by the given logicalIndex, or -1 otherwise.
QSpanCollection::Span span(int row, int column) const
Gets the span information for the cell at (row, column).
Definition: qtableview.cpp:721
int logicalIndex(int visualIndex) const
Returns the logicalIndex for the section at the given visualIndex position, or -1 if visualIndex < 0 ...
int count() const
Returns the number of sections in the header.

◆ trimHiddenSelections()

void QTableViewPrivate::trimHiddenSelections ( QItemSelectionRange range) const

Trims away indices that are hidden in the treeview due to hidden horizontal or vertical sections.

Warning
This function is not part of the public interface.

Definition at line 645 of file qtableview.cpp.

646 {
647  Q_ASSERT(range && range->isValid());
648 
649  int top = range->top();
650  int left = range->left();
651  int bottom = range->bottom();
652  int right = range->right();
653 
654  while (bottom >= top && verticalHeader->isSectionHidden(bottom))
655  --bottom;
656  while (right >= left && horizontalHeader->isSectionHidden(right))
657  --right;
658 
659  if (top > bottom || left > right) { // everything is hidden
660  *range = QItemSelectionRange();
661  return;
662  }
663 
664  while (verticalHeader->isSectionHidden(top) && top <= bottom)
665  ++top;
666  while (horizontalHeader->isSectionHidden(left) && left <= right)
667  ++left;
668 
669  if (top > bottom || left > right) { // everything is hidden
670  *range = QItemSelectionRange();
671  return;
672  }
673 
674  QModelIndex bottomRight = model->index(bottom, right, range->parent());
675  QModelIndex topLeft = model->index(top, left, range->parent());
676  *range = QItemSelectionRange(topLeft, bottomRight);
677 }
int left() const
Returns the column index corresponding to the leftmost selected column in the selection range...
bool isValid() const
Returns true if the selection range is valid; otherwise returns false.
The QItemSelectionRange class manages information about a range of selected items in a model...
int bottom() const
Returns the row index corresponding to the lowermost selected row in the selection range...
int right() const
Returns the column index corresponding to the rightmost selected column in the selection range...
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
QModelIndex parent() const
Returns the parent model item index of the items in the selection range.
bool isSectionHidden(int logicalIndex) const
Returns true if the section specified by logicalIndex is explicitly hidden from the user; otherwise r...
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...
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
The QModelIndex class is used to locate data in a data model.
int top() const
Returns the row index corresponding to the uppermost selected row in the selection range...
QAbstractItemModel * model

◆ visualColumn()

int QTableViewPrivate::visualColumn ( int  logicalCol) const
inline

Definition at line 160 of file qtableview_p.h.

160  {
161  return horizontalHeader->visualIndex(logicalCol);
162  }
int visualIndex(int logicalIndex) const
Returns the visual index position of the section specified by the given logicalIndex, or -1 otherwise.
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191

◆ visualRow()

int QTableViewPrivate::visualRow ( int  logicalRow) const
inline

Definition at line 157 of file qtableview_p.h.

157  {
159  }
int visualIndex(int logicalIndex) const
Returns the visual index position of the section specified by the given logicalIndex, or -1 otherwise.
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
int logicalRow(int visualRow) const
Definition: qtableview_p.h:163

◆ visualSpanRect()

QRect QTableViewPrivate::visualSpanRect ( const QSpanCollection::Span span) const

Returns the visual rect for the given span.

Warning
This function is not part of the public interface.

Definition at line 797 of file qtableview.cpp.

798 {
799  Q_Q(const QTableView);
800  // vertical
801  int row = span.top();
802  int rowp = verticalHeader->sectionViewportPosition(row);
803  int rowh = rowSpanHeight(row, span.height());
804  // horizontal
805  int column = span.left();
806  int colw = columnSpanWidth(column, span.width());
807  if (q->isRightToLeft())
808  column = span.right();
809  int colp = horizontalHeader->sectionViewportPosition(column);
810 
811  const int i = showGrid ? 1 : 0;
812  if (q->isRightToLeft())
813  return QRect(colp + i, rowp, colw - i, rowh - i);
814  return QRect(colp, rowp, colw - i, rowh - i);
815 }
QHeaderView * horizontalHeader
Definition: qtableview_p.h:191
int columnSpanWidth(int column, int span) const
Definition: qtableview_p.h:214
#define Q_Q(Class)
Definition: qglobal.h:2483
QHeaderView * verticalHeader
Definition: qtableview_p.h:192
int sectionViewportPosition(int logicalIndex) const
Returns the section viewport position of the given logicalIndex.
The QTableView class provides a default model/view implementation of a table view.
Definition: qtableview.h:58
The QRect class defines a rectangle in the plane using integer precision.
Definition: qrect.h:58
int rowSpanHeight(int row, int span) const
Definition: qtableview_p.h:211

Properties

◆ columnResizeTimerID

int QTableViewPrivate::columnResizeTimerID

Definition at line 187 of file qtableview_p.h.

◆ columnSectionAnchor

int QTableViewPrivate::columnSectionAnchor

Definition at line 186 of file qtableview_p.h.

◆ columnsToUpdate

QList<int> QTableViewPrivate::columnsToUpdate

Definition at line 189 of file qtableview_p.h.

◆ cornerWidget

QWidget* QTableViewPrivate::cornerWidget

Definition at line 193 of file qtableview_p.h.

◆ geometryRecursionBlock

bool QTableViewPrivate::geometryRecursionBlock

Definition at line 195 of file qtableview_p.h.

◆ gridStyle

Qt::PenStyle QTableViewPrivate::gridStyle

Definition at line 184 of file qtableview_p.h.

◆ horizontalHeader

QHeaderView* QTableViewPrivate::horizontalHeader

Definition at line 191 of file qtableview_p.h.

◆ rowResizeTimerID

int QTableViewPrivate::rowResizeTimerID

Definition at line 188 of file qtableview_p.h.

◆ rowSectionAnchor

int QTableViewPrivate::rowSectionAnchor

Definition at line 185 of file qtableview_p.h.

◆ rowsToUpdate

QList<int> QTableViewPrivate::rowsToUpdate

Definition at line 190 of file qtableview_p.h.

◆ showGrid

bool QTableViewPrivate::showGrid

Definition at line 183 of file qtableview_p.h.

◆ sortingEnabled

bool QTableViewPrivate::sortingEnabled

Definition at line 194 of file qtableview_p.h.

◆ spans

QSpanCollection QTableViewPrivate::spans

Definition at line 198 of file qtableview_p.h.

◆ verticalHeader

QHeaderView* QTableViewPrivate::verticalHeader

Definition at line 192 of file qtableview_p.h.

◆ visualCursor

QPoint QTableViewPrivate::visualCursor

Definition at line 196 of file qtableview_p.h.


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