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

#include <qcolumnview_p.h>

Inheritance diagram for QColumnViewPrivate:
QAbstractItemViewPrivate QAbstractScrollAreaPrivate QFramePrivate QWidgetPrivate QObjectPrivate QObjectData

Public Functions

void _q_changeCurrentColumn ()
 
void _q_clicked (const QModelIndex &index)
 
void _q_columnsInserted (const QModelIndex &parent, int start, int end)
 
void _q_gripMoved (int offset)
 
void checkColumnCreation (const QModelIndex &parent)
 Makes sure we create a corresponding column as a result of changing the model. More...
 
void closeColumns (const QModelIndex &parent=QModelIndex(), bool build=false)
 Find where the current columns intersect parent's columns. More...
 
QAbstractItemViewcreateColumn (const QModelIndex &index, bool show)
 Create a new column for index. More...
 
void doLayout ()
 Place all of the columns where they belong inside of the viewport, resize as necessary. More...
 
void initialize ()
 
 QColumnViewPrivate ()
 
void setPreviewWidget (QWidget *widget)
 
void updateScrollbars ()
 
 ~QColumnViewPrivate ()
 
- 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_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

QList< QAbstractItemView * > columns
 
QVector< int > columnSizes
 
QPropertyAnimation currentAnimation
 
int offset
 
QAbstractItemViewpreviewColumn
 
QWidgetpreviewWidget
 
bool showResizeGrips
 
- 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 136 of file qcolumnview_p.h.

Constructors and Destructors

◆ QColumnViewPrivate()

QColumnViewPrivate::QColumnViewPrivate ( )

Definition at line 1053 of file qcolumnview.cpp.

1055 ,showResizeGrips(true)
1056 ,offset(0)
1057 ,previewWidget(0)
1058 ,previewColumn(0)
1059 {
1060 }
QAbstractItemView * previewColumn
QWidget * previewWidget

◆ ~QColumnViewPrivate()

QColumnViewPrivate::~QColumnViewPrivate ( )

Definition at line 1062 of file qcolumnview.cpp.

1063 {
1064 }

Functions

◆ _q_changeCurrentColumn()

void QColumnViewPrivate::_q_changeCurrentColumn ( )

Definition at line 966 of file qcolumnview.cpp.

967 {
968  Q_Q(QColumnView);
969  if (columns.isEmpty())
970  return;
971 
972  QModelIndex current = q->currentIndex();
973  if (!current.isValid())
974  return;
975 
976  // We might have scrolled far to the left so we need to close all of the children
977  closeColumns(current, true);
978 
979  // Set up the "current" column with focus
980  int currentColumn = qMax(0, columns.size() - 2);
981  QAbstractItemView *parentColumn = columns.at(currentColumn);
982  if (q->hasFocus())
983  parentColumn->setFocus(Qt::OtherFocusReason);
984  q->setFocusProxy(parentColumn);
985 
986  // find the column that is our current selection model and give it a new one.
987  for (int i = 0; i < columns.size(); ++i) {
988  if (columns.at(i)->selectionModel() == q->selectionModel()) {
989  QItemSelectionModel *replacementSelectionModel =
990  new QItemSelectionModel(parentColumn->model());
991  replacementSelectionModel->setCurrentIndex(
992  q->selectionModel()->currentIndex(), QItemSelectionModel::Current);
993  replacementSelectionModel->select(
994  q->selectionModel()->selection(), QItemSelectionModel::Select);
995  QAbstractItemView *view = columns.at(i);
996  view->setSelectionModel(replacementSelectionModel);
998  if (columns.size() > i + 1)
999  view->setCurrentIndex(columns.at(i+1)->rootIndex());
1000  break;
1001  }
1002  }
1003  parentColumn->selectionModel()->deleteLater();
1004  parentColumn->setFocusPolicy(Qt::StrongFocus);
1005  parentColumn->setSelectionModel(q->selectionModel());
1006  // We want the parent selection to stay highlighted (but dimmed depending upon the color theme)
1007  if (currentColumn > 0) {
1008  parentColumn = columns.at(currentColumn - 1);
1009  if (parentColumn->currentIndex() != current.parent())
1010  parentColumn->setCurrentIndex(current.parent());
1011  }
1012 
1013  if (columns.last()->isHidden()) {
1014  columns.last()->setVisible(true);
1015  }
1016  if (columns.last()->selectionModel())
1017  columns.last()->selectionModel()->clear();
1018  updateScrollbars();
1019 }
The QItemSelectionModel class keeps track of a view&#39;s selected items.
virtual void clear()
Clears the selection model.
virtual void setSelectionModel(QItemSelectionModel *selectionModel)
Sets the current selection model to the given selectionModel.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
void setCurrentIndex(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Sets the model item index to be the current item, and emits currentChanged().
QItemSelectionModel * selectionModel() const
Returns the current selection model.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void setCurrentIndex(const QModelIndex &index)
Sets the current item to be the item at index.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
virtual void setVisible(bool visible)
Definition: qwidget.cpp:7991
void setFocus()
Gives the keyboard input focus to this widget (or its focus proxy) if this widget or one of its paren...
Definition: qwidget.h:432
The QAbstractItemView class provides the basic functionality for item view classes.
virtual void select(const QModelIndex &index, QItemSelectionModel::SelectionFlags command)
Selects the model item index using the specified command, and emits selectionChanged().
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
The QModelIndex class is used to locate data in a data model.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QColumnView class provides a model/view implementation of a column view.
Definition: qcolumnview.h:57
QModelIndex rootIndex() const
Returns the model index of the model&#39;s root item.
void closeColumns(const QModelIndex &parent=QModelIndex(), bool build=false)
Find where the current columns intersect parent&#39;s columns.
void setFocusPolicy(Qt::FocusPolicy policy)
Definition: qwidget.cpp:7631
QList< QAbstractItemView * > columns

◆ _q_clicked()

void QColumnViewPrivate::_q_clicked ( const QModelIndex index)

Definition at line 649 of file qcolumnview.cpp.

650 {
651  Q_Q(QColumnView);
652  QModelIndex parent = index.parent();
653  QAbstractItemView *columnClicked = 0;
654  for (int column = 0; column < columns.count(); ++column) {
655  if (columns.at(column)->rootIndex() == parent) {
656  columnClicked = columns[column];
657  break;
658  }
659  }
660  if (q->selectionModel() && columnClicked) {
661  QItemSelectionModel::SelectionFlags flags = QItemSelectionModel::Current;
662  if (columnClicked->selectionModel()->isSelected(index))
664  q->selectionModel()->setCurrentIndex(index, flags);
665  }
666 }
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
#define Q_Q(Class)
Definition: qglobal.h:2483
QItemSelectionModel * selectionModel() const
Returns the current selection model.
bool isSelected(const QModelIndex &index) const
Returns true if the given model item index is selected.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QAbstractItemView class provides the basic functionality for item view classes.
The QModelIndex class is used to locate data in a data model.
The QColumnView class provides a model/view implementation of a column view.
Definition: qcolumnview.h:57
QObject * parent
Definition: qobject.h:92
QModelIndex rootIndex() const
Returns the model index of the model&#39;s root item.
QList< QAbstractItemView * > columns

◆ _q_columnsInserted()

void QColumnViewPrivate::_q_columnsInserted ( const QModelIndex parent,
int  start,
int  end 
)
virtual
Warning
This function is not part of the public interface.

Reimplemented from QAbstractItemViewPrivate.

Definition at line 1070 of file qcolumnview.cpp.

1071 {
1073  checkColumnCreation(parent);
1074 }
virtual void _q_columnsInserted(const QModelIndex &parent, int start, int end)
This slot is called when columns have been inserted.
void checkColumnCreation(const QModelIndex &parent)
Makes sure we create a corresponding column as a result of changing the model.
static const KeyPair *const end

◆ _q_gripMoved()

void QColumnViewPrivate::_q_gripMoved ( int  offset)
Warning
This function is not part of the public interface. Move all widgets from the corner grip and to the right

Definition at line 534 of file qcolumnview.cpp.

535 {
536  Q_Q(QColumnView);
537 
538  QObject *grip = q->sender();
539  Q_ASSERT(grip);
540 
541  if (q->isRightToLeft())
542  offset = -1 * offset;
543 
544  bool found = false;
545  for (int i = 0; i < columns.size(); ++i) {
546  if (!found && columns.at(i)->cornerWidget() == grip) {
547  found = true;
548  columnSizes[i] = columns.at(i)->width();
549  if (q->isRightToLeft())
550  columns.at(i)->move(columns.at(i)->x() + offset, 0);
551  continue;
552  }
553  if (!found)
554  continue;
555 
556  int currentX = columns.at(i)->x();
557  columns.at(i)->move(currentX + offset, 0);
558  }
559 
561 }
QWidget * cornerWidget() const
Returns the widget in the corner between the two scroll bars.
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
The QObject class is the base class of all Qt objects.
Definition: qobject.h:111
QObject * sender() const
Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; othe...
Definition: qobject.cpp:2327
#define Q_Q(Class)
Definition: qglobal.h:2483
int width() const
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
int x() const
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QColumnView class provides a model/view implementation of a column view.
Definition: qcolumnview.h:57
void move(int x, int y)
This corresponds to move(QPoint(x, y)).
Definition: qwidget.h:1011
QVector< int > columnSizes
QList< QAbstractItemView * > columns

◆ checkColumnCreation()

void QColumnViewPrivate::checkColumnCreation ( const QModelIndex parent)

Makes sure we create a corresponding column as a result of changing the model.

Warning
This function is not part of the public interface.

Definition at line 1085 of file qcolumnview.cpp.

Referenced by _q_columnsInserted().

1086 {
1087  if (parent == q_func()->currentIndex() && model->hasChildren(parent)) {
1088  //the parent has children and is the current
1089  //let's try to find out if there is already a mapping that is good
1090  for (int i = 0; i < columns.count(); ++i) {
1091  QAbstractItemView *view = columns.at(i);
1092  if (view->rootIndex() == parent) {
1093  if (view == previewColumn) {
1094  //let's recreate the parent
1095  closeColumns(parent, false);
1096  createColumn(parent, true /*show*/);
1097  }
1098  break;
1099  }
1100  }
1101  }
1102 }
QAbstractItemView * createColumn(const QModelIndex &index, bool show)
Create a new column for index.
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
QAbstractItemView * previewColumn
virtual bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Returns true if parent has any children; otherwise returns false.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QAbstractItemView class provides the basic functionality for item view classes.
QObject * parent
Definition: qobject.h:92
QModelIndex rootIndex() const
Returns the model index of the model&#39;s root item.
void closeColumns(const QModelIndex &parent=QModelIndex(), bool build=false)
Find where the current columns intersect parent&#39;s columns.
QAbstractItemModel * model
QList< QAbstractItemView * > columns

◆ closeColumns()

void QColumnViewPrivate::closeColumns ( const QModelIndex parent = QModelIndex(),
bool  build = false 
)

Find where the current columns intersect parent's columns.

Delete any extra columns and insert any needed columns.

Warning
This function is not part of the public interface.

Definition at line 573 of file qcolumnview.cpp.

Referenced by checkColumnCreation().

574 {
575  if (columns.isEmpty())
576  return;
577 
578  bool clearAll = !parent.isValid();
579  bool passThroughRoot = false;
580 
581  QList<QModelIndex> dirsToAppend;
582 
583  // Find the last column that matches the parent's tree
584  int currentColumn = -1;
585  QModelIndex parentIndex = parent;
586  while (currentColumn == -1 && parentIndex.isValid()) {
587  if (columns.isEmpty())
588  break;
589  parentIndex = parentIndex.parent();
590  if (root == parentIndex)
591  passThroughRoot = true;
592  if (!parentIndex.isValid())
593  break;
594  for (int i = columns.size() - 1; i >= 0; --i) {
595  if (columns.at(i)->rootIndex() == parentIndex) {
596  currentColumn = i;
597  break;
598  }
599  }
600  if (currentColumn == -1)
601  dirsToAppend.append(parentIndex);
602  }
603 
604  // Someone wants to go to an index that can be reached without changing
605  // the root index, don't allow them
606  if (!clearAll && !passThroughRoot && currentColumn == -1)
607  return;
608 
609  if (currentColumn == -1 && parent.isValid())
610  currentColumn = 0;
611 
612  // Optimization so we don't go deleting and then creating the same thing
613  bool alreadyExists = false;
614  if (build && columns.size() > currentColumn + 1) {
615  bool viewingParent = (columns.at(currentColumn + 1)->rootIndex() == parent);
616  bool viewingChild = (!model->hasChildren(parent)
617  && !columns.at(currentColumn + 1)->rootIndex().isValid());
618  if (viewingParent || viewingChild) {
619  currentColumn++;
620  alreadyExists = true;
621  }
622  }
623 
624  // Delete columns that don't match our path
625  for (int i = columns.size() - 1; i > currentColumn; --i) {
626  QAbstractItemView* notShownAnymore = columns.at(i);
627  columns.removeAt(i);
628  notShownAnymore->setVisible(false);
629  if (notShownAnymore != previewColumn)
630  notShownAnymore->deleteLater();
631  }
632 
633  if (columns.isEmpty()) {
634  offset = 0;
636  }
637 
638  // Now fill in missing columns
639  while (!dirsToAppend.isEmpty()) {
640  QAbstractItemView *newView = createColumn(dirsToAppend.takeLast(), true);
641  if (!dirsToAppend.isEmpty())
642  newView->setCurrentIndex(dirsToAppend.last());
643  }
644 
645  if (build && !alreadyExists)
646  createColumn(parent, false);
647 }
QAbstractItemView * createColumn(const QModelIndex &index, bool show)
Create a new column for index.
QModelIndex parent() const
Returns the parent of the model index, or QModelIndex() if it has no parent.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QAbstractItemView * previewColumn
virtual bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Returns true if parent has any children; otherwise returns false.
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
void setCurrentIndex(const QModelIndex &index)
Sets the current item to be the item at index.
bool isValid() const
Returns true if this model index is valid; otherwise returns false.
virtual void setVisible(bool visible)
Definition: qwidget.cpp:7991
QPersistentModelIndex root
The QAbstractItemView class provides the basic functionality for item view classes.
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
The QModelIndex class is used to locate data in a data model.
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
QObject * parent
Definition: qobject.h:92
T takeLast()
Removes the last item in the list and returns it.
Definition: qlist.h:492
QModelIndex rootIndex() const
Returns the model index of the model&#39;s root item.
QAbstractItemModel * model
void deleteLater()
Schedules this object for deletion.
Definition: qobject.cpp:2145
QList< QAbstractItemView * > columns
void removeAt(int i)
Removes the item at index position i.
Definition: qlist.h:480

◆ createColumn()

QAbstractItemView * QColumnViewPrivate::createColumn ( const QModelIndex index,
bool  show 
)

Create a new column for index.

Warning
This function is not part of the public interface. A grip is attached if requested and it is shown if requested.

Return the new view

See also
createColumn() setPreviewWidget()
doLayout()

Definition at line 681 of file qcolumnview.cpp.

Referenced by checkColumnCreation().

682 {
683  Q_Q(QColumnView);
684  QAbstractItemView *view = 0;
685  if (model->hasChildren(index)) {
686  view = q->createColumn(index);
687  q->connect(view, SIGNAL(clicked(QModelIndex)),
689  } else {
690  if (!previewColumn)
691  setPreviewWidget(new QWidget(q));
692  view = previewColumn;
694  }
695 
696  q->connect(view, SIGNAL(activated(QModelIndex)),
697  q, SIGNAL(activated(QModelIndex)));
698  q->connect(view, SIGNAL(clicked(QModelIndex)),
699  q, SIGNAL(clicked(QModelIndex)));
700  q->connect(view, SIGNAL(doubleClicked(QModelIndex)),
701  q, SIGNAL(doubleClicked(QModelIndex)));
702  q->connect(view, SIGNAL(entered(QModelIndex)),
703  q, SIGNAL(entered(QModelIndex)));
704  q->connect(view, SIGNAL(pressed(QModelIndex)),
705  q, SIGNAL(pressed(QModelIndex)));
706 
708  view->setParent(viewport);
709  Q_ASSERT(view);
710 
711  // Setup corner grip
712  if (showResizeGrips) {
713  QColumnViewGrip *grip = new QColumnViewGrip(view);
714  view->setCornerWidget(grip);
715  q->connect(grip, SIGNAL(gripMoved(int)), q, SLOT(_q_gripMoved(int)));
716  }
717 
718  if (columnSizes.count() > columns.count()) {
719  view->setGeometry(0, 0, columnSizes.at(columns.count()), viewport->height());
720  } else {
721  int initialWidth = view->sizeHint().width();
722  if (q->isRightToLeft())
723  view->setGeometry(viewport->width() - initialWidth, 0, initialWidth, viewport->height());
724  else
725  view->setGeometry(0, 0, initialWidth, viewport->height());
727  columnSizes[columns.count()] = initialWidth;
728  }
729  if (!columns.isEmpty() && columns.last()->isHidden())
730  columns.last()->setVisible(true);
731 
732  columns.append(view);
733  doLayout();
735  if (show && view->isHidden())
736  view->setVisible(true);
737  return view;
738 }
void setParent(QWidget *parent)
Sets the parent of the widget to parent, and resets the window flags.
Definition: qwidget.cpp:10479
int width
the width of the widget excluding any window frame
Definition: qwidget.h:166
int count(const T &t) const
Returns the number of occurrences of value in the vector.
Definition: qvector.h:742
#define SLOT(a)
Definition: qobjectdefs.h:226
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
int count(const T &t) const
Returns the number of occurrences of value in the list.
Definition: qlist.h:891
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qwidget.h:1017
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
void setPreviewWidget(QWidget *widget)
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
void resize(int size)
Sets the size of the vector to size.
Definition: qvector.h:342
#define Q_Q(Class)
Definition: qglobal.h:2483
bool isHidden() const
Returns true if the widget is hidden, otherwise returns false.
Definition: qwidget.h:1008
#define SIGNAL(a)
Definition: qobjectdefs.h:227
int width() const
Returns the width.
Definition: qsize.h:126
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
QAbstractItemView * previewColumn
virtual bool hasChildren(const QModelIndex &parent=QModelIndex()) const
Returns true if parent has any children; otherwise returns false.
int height
the height of the widget excluding any window frame
Definition: qwidget.h:167
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
void doLayout()
Place all of the columns where they belong inside of the viewport, resize as necessary.
virtual void setVisible(bool visible)
Definition: qwidget.cpp:7991
const T & at(int i) const
Returns the item at index position i in the vector.
Definition: qvector.h:350
int minimumWidth
the widget&#39;s minimum width in pixels
Definition: qwidget.h:174
The QAbstractItemView class provides the basic functionality for item view classes.
void setCornerWidget(QWidget *widget)
Sets the widget in the corner between the two scroll bars to be widget.
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
The QModelIndex class is used to locate data in a data model.
void setMinimumWidth(int minw)
Definition: qwidget.cpp:4325
The QColumnView class provides a model/view implementation of a column view.
Definition: qcolumnview.h:57
QWidget * previewWidget
int minimumWidth() const
QSize sizeHint() const
Reimplemented Function
QAbstractItemModel * model
void _q_gripMoved(int offset)
void _q_clicked(const QModelIndex &index)
QVector< int > columnSizes
void setFocusPolicy(Qt::FocusPolicy policy)
Definition: qwidget.cpp:7631
QList< QAbstractItemView * > columns

◆ doLayout()

void QColumnViewPrivate::doLayout ( )

Place all of the columns where they belong inside of the viewport, resize as necessary.

Warning
This function is not part of the public interface.

Definition at line 1111 of file qcolumnview.cpp.

1112 {
1113  Q_Q(QColumnView);
1114  if (!model || columns.isEmpty())
1115  return;
1116 
1117  int viewportHeight = viewport->height();
1118  int x = columns.at(0)->x();
1119 
1120  if (q->isRightToLeft()) {
1121  x = viewport->width() + q->horizontalOffset();
1122  for (int i = 0; i < columns.size(); ++i) {
1123  QAbstractItemView *view = columns.at(i);
1124  x -= view->width();
1125  if (x != view->x() || viewportHeight != view->height())
1126  view->setGeometry(x, 0, view->width(), viewportHeight);
1127  }
1128  } else {
1129  for (int i = 0; i < columns.size(); ++i) {
1130  QAbstractItemView *view = columns.at(i);
1131  int currentColumnWidth = view->width();
1132  if (x != view->x() || viewportHeight != view->height())
1133  view->setGeometry(x, 0, currentColumnWidth, viewportHeight);
1134  x += currentColumnWidth;
1135  }
1136  }
1137 }
int width
the width of the widget excluding any window frame
Definition: qwidget.h:166
void setGeometry(int x, int y, int w, int h)
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition: qwidget.h:1017
int height() const
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
int height
the height of the widget excluding any window frame
Definition: qwidget.h:167
int width() const
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
The QAbstractItemView class provides the basic functionality for item view classes.
int x() const
int size() const
Returns the number of items in the list.
Definition: qlist.h:137
The QColumnView class provides a model/view implementation of a column view.
Definition: qcolumnview.h:57
QAbstractItemModel * model
QList< QAbstractItemView * > columns

◆ initialize()

void QColumnViewPrivate::initialize ( )

Definition at line 109 of file qcolumnview.cpp.

110 {
111  Q_Q(QColumnView);
112  q->setTextElideMode(Qt::ElideMiddle);
113 #ifndef QT_NO_ANIMATION
119 #endif //QT_NO_ANIMATION
120  delete itemDelegate;
121  q->setItemDelegate(new QColumnViewDelegate(q));
122 }
#define ANIMATION_DURATION_MSEC
Definition: qcolumnview.cpp:58
#define SLOT(a)
Definition: qobjectdefs.h:226
void setEasingCurve(const QEasingCurve &easing)
#define Q_Q(Class)
Definition: qglobal.h:2483
void setDuration(int msecs)
#define SIGNAL(a)
Definition: qobjectdefs.h:227
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
void setPropertyName(const QByteArray &propertyName)
This is a delegate that will paint the triangle.
QPointer< QAbstractItemDelegate > itemDelegate
void setTargetObject(QObject *target)
The QColumnView class provides a model/view implementation of a column view.
Definition: qcolumnview.h:57
void _q_changeCurrentColumn()
QPropertyAnimation currentAnimation

◆ setPreviewWidget()

void QColumnViewPrivate::setPreviewWidget ( QWidget widget)
Warning
This function is not part of the public interface.

Definition at line 850 of file qcolumnview.cpp.

851 {
852  Q_Q(QColumnView);
853  if (previewColumn) {
854  if (!columns.isEmpty() && columns.last() == previewColumn)
857  }
859  column->setPreviewWidget(widget);
860  previewColumn = column;
861  previewColumn->hide();
869 }
void setSelectionMode(QAbstractItemView::SelectionMode mode)
void setParent(QWidget *parent)
Sets the parent of the widget to parent, and resets the window flags.
Definition: qwidget.cpp:10479
QPointer< QWidget > widget
QScrollBar * verticalScrollBar() const
Returns the vertical scroll bar.
void removeLast()
Removes the last item in the list.
Definition: qlist.h:287
void setPreviewWidget(QWidget *widget)
Definition: qcolumnview_p.h:79
Q_DECL_CONSTEXPR const T & qMax(const T &a, const T &b)
Definition: qglobal.h:1217
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
QWidget * viewport() const
Returns the viewport widget.
QAbstractItemView * previewColumn
int width() const
void setFrameShape(Shape)
Definition: qframe.cpp:284
void hide()
Hides the widget.
Definition: qwidget.h:501
void setVerticalScrollBarPolicy(Qt::ScrollBarPolicy)
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
void setMinimumWidth(int minw)
Definition: qwidget.cpp:4325
The QColumnView class provides a model/view implementation of a column view.
Definition: qcolumnview.h:57
QWidget * previewWidget
int minimumWidth() const
void deleteLater()
Schedules this object for deletion.
Definition: qobject.cpp:2145
QList< QAbstractItemView * > columns

◆ updateScrollbars()

void QColumnViewPrivate::updateScrollbars ( )
Warning
This function is not part of the public interface.

Definition at line 411 of file qcolumnview.cpp.

412 {
413  Q_Q(QColumnView);
414 #ifndef QT_NO_ANIMATION
416  return;
417 #endif //QT_NO_ANIMATION
418 
419  // find the total horizontal length of the laid out columns
420  int horizontalLength = 0;
421  if (!columns.isEmpty()) {
422  horizontalLength = (columns.last()->x() + columns.last()->width()) - columns.first()->x();
423  if (horizontalLength <= 0) // reverse mode
424  horizontalLength = (columns.first()->x() + columns.first()->width()) - columns.last()->x();
425  }
426 
427  QSize viewportSize = viewport->size();
428  if (horizontalLength < viewportSize.width() && hbar->value() == 0) {
429  hbar->setRange(0, 0);
430  } else {
431  int visibleLength = qMin(horizontalLength + q->horizontalOffset(), viewportSize.width());
432  int hiddenLength = horizontalLength - visibleLength;
433  if (hiddenLength != hbar->maximum())
434  hbar->setRange(0, hiddenLength);
435  }
436  if (!columns.isEmpty()) {
437  int pageStepSize = columns.at(0)->width();
438  if (pageStepSize != hbar->pageStep())
439  hbar->setPageStep(pageStepSize);
440  }
441  bool visible = (hbar->maximum() > 0);
442  if (visible != hbar->isVisible())
443  hbar->setVisible(visible);
444 }
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
Definition: qglobal.h:1215
bool isVisible() const
Definition: qwidget.h:1005
State state() const
void setRange(int min, int max)
Sets the slider&#39;s minimum to min and its maximum to max.
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Definition: qlist.h:152
#define Q_Q(Class)
Definition: qglobal.h:2483
int width() const
Returns the width.
Definition: qsize.h:126
int value() const
int width() const
const T & at(int i) const
Returns the item at index position i in the list.
Definition: qlist.h:468
QSize size
the size of the widget excluding any window frame
Definition: qwidget.h:165
virtual void setVisible(bool visible)
Definition: qwidget.cpp:7991
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
int x() const
T & last()
Returns a reference to the last item in the list.
Definition: qlist.h:284
The QColumnView class provides a model/view implementation of a column view.
Definition: qcolumnview.h:57
QPropertyAnimation currentAnimation
The QSize class defines the size of a two-dimensional object using integer point precision.
Definition: qsize.h:53
int maximum() const
int pageStep() const
QList< QAbstractItemView * > columns

Properties

◆ columns

QList<QAbstractItemView*> QColumnViewPrivate::columns

Definition at line 159 of file qcolumnview_p.h.

Referenced by checkColumnCreation(), and doLayout().

◆ columnSizes

QVector<int> QColumnViewPrivate::columnSizes

Definition at line 160 of file qcolumnview_p.h.

◆ currentAnimation

QPropertyAnimation QColumnViewPrivate::currentAnimation

Definition at line 164 of file qcolumnview_p.h.

◆ offset

int QColumnViewPrivate::offset

Definition at line 162 of file qcolumnview_p.h.

◆ previewColumn

QAbstractItemView* QColumnViewPrivate::previewColumn

Definition at line 167 of file qcolumnview_p.h.

Referenced by checkColumnCreation().

◆ previewWidget

QWidget* QColumnViewPrivate::previewWidget

Definition at line 166 of file qcolumnview_p.h.

◆ showResizeGrips

bool QColumnViewPrivate::showResizeGrips

Definition at line 161 of file qcolumnview_p.h.


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