CopperSpice API
1.9.2
|
The QAbstractItemView class provides the basic functionality for item view classes. More...
Public Typedefs | |
using | EditTriggers = QFlags< EditTrigger > |
Public Typedefs inherited from QWidget | |
using | RenderFlags = QFlags< RenderFlag > |
Public Types | |
enum | DragDropMode |
enum | EditTrigger |
enum | ScrollHint |
enum | ScrollMode |
enum | SelectionBehavior |
enum | SelectionMode |
Public Types inherited from QFrame | |
enum | Shadow |
enum | Shape |
enum | StyleMask |
Public Types inherited from QWidget | |
enum | RenderFlag |
Public Types inherited from QPaintDevice | |
enum | PaintDeviceMetric |
Public Signals | |
void | activated (const QModelIndex &index) |
void | clicked (const QModelIndex &index) |
void | doubleClicked (const QModelIndex &index) |
void | entered (const QModelIndex &index) |
void | iconSizeChanged (const QSize &size) |
void | pressed (const QModelIndex &index) |
void | viewportEntered () |
Public Signals inherited from QWidget | |
void | customContextMenuRequested (const QPoint &pos) |
void | windowIconChanged (const QIcon &icon) |
void | windowIconTextChanged (const QString &iconText) |
void | windowTitleChanged (const QString &title) |
Public Signals inherited from QObject | |
void | destroyed (QObject *obj=nullptr) |
void | objectNameChanged (const QString &objectName) |
Public Slots | |
void | clearSelection () |
void | edit (const QModelIndex &index) |
virtual void | reset () |
void | scrollToBottom () |
void | scrollToTop () |
virtual void | selectAll () |
void | setCurrentIndex (const QModelIndex &index) |
virtual void | setRootIndex (const QModelIndex &index) |
void | update (const QModelIndex &index) |
Public Slots inherited from QWidget | |
bool | close () |
void | hide () |
void | lower () |
void | raise () |
void | repaint () |
void | setDisabled (bool disable) |
void | setEnabled (bool enable) |
void | setFocus () |
void | setHidden (bool hidden) |
void | setStyleSheet (const QString &styleSheet) |
virtual void | setVisible (bool visible) |
void | setWindowModified (bool modified) |
void | setWindowTitle (const QString &title) |
void | show () |
void | showFullScreen () |
void | showMaximized () |
void | showMinimized () |
void | showNormal () |
void | update () |
Public Slots inherited from QObject | |
void | deleteLater () |
Public Methods | |
QAbstractItemView (QWidget *parent=nullptr) | |
~QAbstractItemView () | |
bool | alternatingRowColors () const |
int | autoScrollMargin () const |
void | closePersistentEditor (const QModelIndex &index) |
QModelIndex | currentIndex () const |
Qt::DropAction | defaultDropAction () const |
DragDropMode | dragDropMode () const |
bool | dragDropOverwriteMode () const |
bool | dragEnabled () const |
EditTriggers | editTriggers () const |
bool | hasAutoScroll () const |
ScrollMode | horizontalScrollMode () const |
QSize | iconSize () const |
virtual QModelIndex | indexAt (const QPoint &point) const = 0 |
QWidget * | indexWidget (const QModelIndex &index) const |
QVariant | inputMethodQuery (Qt::InputMethodQuery query) const override |
QAbstractItemDelegate * | itemDelegate () const |
QAbstractItemDelegate * | itemDelegate (const QModelIndex &index) const |
QAbstractItemDelegate * | itemDelegateForColumn (int column) const |
QAbstractItemDelegate * | itemDelegateForRow (int row) const |
virtual void | keyboardSearch (const QString &search) |
QAbstractItemModel * | model () const |
void | openPersistentEditor (const QModelIndex &index) |
QModelIndex | rootIndex () const |
virtual void | scrollTo (const QModelIndex &index, ScrollHint hint=EnsureVisible) = 0 |
QAbstractItemView::SelectionBehavior | selectionBehavior () const |
QAbstractItemView::SelectionMode | selectionMode () const |
QItemSelectionModel * | selectionModel () const |
void | setAlternatingRowColors (bool enable) |
void | setAutoScroll (bool enable) |
void | setAutoScrollMargin (int margin) |
void | setDefaultDropAction (Qt::DropAction dropAction) |
void | setDragDropMode (DragDropMode behavior) |
void | setDragDropOverwriteMode (bool overwrite) |
void | setDragEnabled (bool enable) |
void | setDropIndicatorShown (bool enable) |
void | setEditTriggers (EditTriggers triggers) |
void | setHorizontalScrollMode (ScrollMode mode) |
void | setIconSize (const QSize &size) |
void | setIndexWidget (const QModelIndex &index, QWidget *widget) |
void | setItemDelegate (QAbstractItemDelegate *delegate) |
void | setItemDelegateForColumn (int column, QAbstractItemDelegate *delegate) |
void | setItemDelegateForRow (int row, QAbstractItemDelegate *delegate) |
virtual void | setModel (QAbstractItemModel *model) |
void | setSelectionBehavior (QAbstractItemView::SelectionBehavior behavior) |
void | setSelectionMode (QAbstractItemView::SelectionMode mode) |
virtual void | setSelectionModel (QItemSelectionModel *selectionModel) |
void | setTabKeyNavigation (bool enable) |
void | setTextElideMode (Qt::TextElideMode mode) |
void | setVerticalScrollMode (ScrollMode mode) |
bool | showDropIndicator () const |
virtual int | sizeHintForColumn (int column) const |
QSize | sizeHintForIndex (const QModelIndex &index) const |
virtual int | sizeHintForRow (int row) const |
bool | tabKeyNavigation () const |
Qt::TextElideMode | textElideMode () const |
ScrollMode | verticalScrollMode () const |
virtual QRect | visualRect (const QModelIndex &index) const = 0 |
Public Methods inherited from QAbstractScrollArea | |
QAbstractScrollArea (QWidget *parent=nullptr) | |
~QAbstractScrollArea () | |
void | addScrollBarWidget (QWidget *widget, Qt::Alignment alignment) |
QWidget * | cornerWidget () const |
QScrollBar * | horizontalScrollBar () const |
Qt::ScrollBarPolicy | horizontalScrollBarPolicy () const |
QSize | maximumViewportSize () const |
QSize | minimumSizeHint () const override |
QWidgetList | scrollBarWidgets (Qt::Alignment alignment) |
void | setCornerWidget (QWidget *widget) |
void | setHorizontalScrollBar (QScrollBar *scrollBar) |
void | setHorizontalScrollBarPolicy (Qt::ScrollBarPolicy policy) |
void | setSizeAdjustPolicy (SizeAdjustPolicy policy) |
virtual void | setupViewport (QWidget *viewport) |
void | setVerticalScrollBar (QScrollBar *scrollBar) |
void | setVerticalScrollBarPolicy (Qt::ScrollBarPolicy policy) |
void | setViewport (QWidget *widget) |
SizeAdjustPolicy | sizeAdjustPolicy () const |
QSize | sizeHint () const override |
QScrollBar * | verticalScrollBar () const |
Qt::ScrollBarPolicy | verticalScrollBarPolicy () const |
QWidget * | viewport () const |
Public Methods inherited from QFrame | |
QFrame (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag) | |
~QFrame () | |
QRect | frameRect () const |
Shadow | frameShadow () const |
Shape | frameShape () const |
int | frameStyle () const |
int | frameWidth () const |
int | lineWidth () const |
int | midLineWidth () const |
void | setFrameRect (const QRect &rect) |
void | setFrameShadow (Shadow value) |
void | setFrameShape (Shape value) |
void | setFrameStyle (int style) |
void | setLineWidth (int width) |
void | setMidLineWidth (int width) |
QSize | sizeHint () const override |
Public Methods inherited from QWidget | |
QWidget (QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag) | |
~QWidget () | |
bool | acceptDrops () const |
QString | accessibleDescription () const |
QString | accessibleName () const |
QList< QAction * > | actions () const |
void | activateWindow () |
void | addAction (QAction *action) |
void | addActions (const QList< QAction * > &actions) |
void | adjustSize () |
bool | autoFillBackground () const |
QPalette::ColorRole | backgroundRole () const |
QBackingStore * | backingStore () const |
QSize | baseSize () const |
QWidget * | childAt (const QPoint &position) const |
QWidget * | childAt (int x, int y) const |
QRect | childrenRect () const |
QRegion | childrenRegion () const |
void | clearFocus () |
void | clearMask () |
QMargins | contentsMargins () const |
QRect | contentsRect () const |
Qt::ContextMenuPolicy | contextMenuPolicy () const |
QCursor | cursor () const |
WId | effectiveWinId () const |
void | ensurePolished () const |
Qt::FocusPolicy | focusPolicy () const |
QWidget * | focusProxy () const |
QWidget * | focusWidget () const |
const QFont & | font () const |
QFontInfo | fontInfo () const |
QFontMetrics | fontMetrics () const |
QPalette::ColorRole | foregroundRole () const |
QRect | frameGeometry () const |
QSize | frameSize () const |
const QRect & | geometry () const |
void | getContentsMargins (int *left, int *top, int *right, int *bottom) const |
QPixmap | grab (const QRect &rectangle=QRect (QPoint (0, 0), QSize (-1,-1))) |
void | grabGesture (Qt::GestureType gestureType, Qt::GestureFlags flags=Qt::GestureFlags ()) |
void | grabKeyboard () |
void | grabMouse () |
void | grabMouse (const QCursor &cursor) |
int | grabShortcut (const QKeySequence &key, Qt::ShortcutContext context=Qt::WindowShortcut) |
QGraphicsEffect * | graphicsEffect () const |
QGraphicsProxyWidget * | graphicsProxyWidget () const |
bool | hasEditFocus () const |
bool | hasFocus () const |
virtual bool | hasHeightForWidth () const |
bool | hasMouseTracking () const |
int | height () const |
virtual int | heightForWidth (int width) const |
Qt::InputMethodHints | inputMethodHints () const |
void | insertAction (QAction *before, QAction *action) |
void | insertActions (QAction *before, QList< QAction * > actions) |
bool | isActiveWindow () const |
bool | isAncestorOf (const QWidget *child) const |
bool | isEnabled () const |
bool | isEnabledTo (const QWidget *parent) const |
bool | isEnabledToTLW () const |
bool | isFullScreen () const |
bool | isHidden () const |
bool | isMaximized () const |
bool | isMinimized () const |
bool | isModal () const |
bool | isTopLevel () const |
bool | isVisible () const |
bool | isVisibleTo (const QWidget *parent) const |
bool | isWindow () const |
bool | isWindowModified () const |
QLayout * | layout () const |
Qt::LayoutDirection | layoutDirection () const |
QLocale | locale () const |
QPoint | mapFrom (const QWidget *parent, const QPoint &pos) const |
QPoint | mapFromGlobal (const QPoint &pos) const |
QPoint | mapFromParent (const QPoint &pos) const |
QPoint | mapTo (const QWidget *parent, const QPoint &pos) const |
QPoint | mapToGlobal (const QPoint &pos) const |
QPoint | mapToParent (const QPoint &pos) const |
QRegion | mask () const |
int | maximumHeight () const |
QSize | maximumSize () const |
int | maximumWidth () const |
int | minimumHeight () const |
QSize | minimumSize () const |
int | minimumWidth () const |
void | move (const QPoint &point) |
void | move (int x, int y) |
QWidget * | nativeParentWidget () const |
QWidget * | nextInFocusChain () const |
QRect | normalGeometry () const |
void | overrideWindowFlags (Qt::WindowFlags flags) |
QPaintEngine * | paintEngine () const override |
const QPalette & | palette () const |
QWidget * | parentWidget () const |
QPoint | pos () const |
QWidget * | previousInFocusChain () const |
QRect | rect () const |
void | releaseKeyboard () |
void | releaseMouse () |
void | releaseShortcut (int id) |
void | removeAction (QAction *action) |
void | render (QPaintDevice *target, const QPoint &targetOffset=QPoint (), const QRegion &sourceRegion=QRegion (), RenderFlags renderFlags=RenderFlags (DrawWindowBackground|DrawChildren)) |
void | render (QPainter *painter, const QPoint &targetOffset=QPoint (), const QRegion &sourceRegion=QRegion (), RenderFlags renderFlags=RenderFlags (DrawWindowBackground|DrawChildren)) |
void | repaint (const QRect &rect) |
void | repaint (const QRegion ®ion) |
void | repaint (int x, int y, int w, int h) |
void | resize (const QSize &size) |
void | resize (int w, int h) |
bool | restoreGeometry (const QByteArray &geometry) |
QByteArray | saveGeometry () const |
void | scroll (int dx, int dy) |
void | scroll (int dx, int dy, const QRect &rect) |
void | setAcceptDrops (bool on) |
void | setAccessibleDescription (const QString &description) |
void | setAccessibleName (const QString &name) |
void | setAttribute (Qt::WidgetAttribute attribute, bool enable=true) |
void | setAutoFillBackground (bool enable) |
void | setBackgroundRole (QPalette::ColorRole role) |
void | setBaseSize (const QSize &size) |
void | setBaseSize (int basew, int baseh) |
void | setContentsMargins (const QMargins &margins) |
void | setContentsMargins (int left, int top, int right, int bottom) |
void | setContextMenuPolicy (Qt::ContextMenuPolicy policy) |
void | setCursor (const QCursor &cursor) |
void | setEditFocus (bool enable) |
void | setFixedHeight (int h) |
void | setFixedSize (const QSize &size) |
void | setFixedSize (int w, int h) |
void | setFixedWidth (int w) |
void | setFocus (Qt::FocusReason reason) |
void | setFocusPolicy (Qt::FocusPolicy policy) |
void | setFocusProxy (QWidget *widget) |
void | setFont (const QFont &font) |
void | setForegroundRole (QPalette::ColorRole role) |
void | setGeometry (const QRect &rect) |
void | setGeometry (int x, int y, int w, int h) |
void | setGraphicsEffect (QGraphicsEffect *effect) |
void | setInputMethodHints (Qt::InputMethodHints hints) |
void | setLayout (QLayout *layout) |
void | setLayoutDirection (Qt::LayoutDirection direction) |
void | setLocale (const QLocale &locale) |
void | setMask (const QBitmap &bitmap) |
void | setMask (const QRegion ®ion) |
void | setMaximumHeight (int maxh) |
void | setMaximumSize (const QSize &size) |
void | setMaximumSize (int maxw, int maxh) |
void | setMaximumWidth (int maxw) |
void | setMinimumHeight (int minh) |
void | setMinimumSize (const QSize &size) |
void | setMinimumSize (int minw, int minh) |
void | setMinimumWidth (int minw) |
void | setMouseTracking (bool enable) |
void | setPalette (const QPalette &palette) |
void | setParent (QWidget *parent) |
void | setParent (QWidget *parent, Qt::WindowFlags flags) |
void | setShortcutAutoRepeat (int id, bool enable=true) |
void | setShortcutEnabled (int id, bool enable=true) |
void | setSizeIncrement (const QSize &size) |
void | setSizeIncrement (int w, int h) |
void | setSizePolicy (QSizePolicy policy) |
void | setSizePolicy (QSizePolicy::Policy horizontal, QSizePolicy::Policy vertical) |
void | setStatusTip (const QString &data) |
void | setStyle (QStyle *style) |
void | setToolTip (const QString &data) |
void | setToolTipDuration (int msec) |
void | setUpdatesEnabled (bool enable) |
void | setWhatsThis (const QString &str) |
void | setWindowFilePath (const QString &filePath) |
void | setWindowFlags (Qt::WindowFlags flags) |
void | setWindowIcon (const QIcon &icon) |
void | setWindowModality (Qt::WindowModality windowModality) |
void | setWindowOpacity (qreal level) |
void | setWindowRole (const QString &role) |
void | setWindowState (Qt::WindowStates windowState) |
QSize | size () const |
QSize | sizeIncrement () const |
QSizePolicy | sizePolicy () const |
void | stackUnder (QWidget *widget) |
QString | statusTip () const |
QStyle * | style () const |
QString | styleSheet () const |
bool | testAttribute (Qt::WidgetAttribute attribute) const |
QString | toolTip () const |
int | toolTipDuration () const |
QWidget * | topLevelWidget () const |
bool | underMouse () const |
void | ungrabGesture (Qt::GestureType gestureType) |
void | unsetCursor () |
void | unsetLayoutDirection () |
void | unsetLocale () |
void | update (const QRect &rect) |
void | update (const QRegion ®ion) |
void | update (int x, int y, int w, int h) |
void | updateGeometry () |
bool | updatesEnabled () const |
QRegion | visibleRegion () const |
QString | whatsThis () const |
int | width () const |
QWidget * | window () const |
QString | windowFilePath () const |
Qt::WindowFlags | windowFlags () const |
QWindow * | windowHandle () const |
QIcon | windowIcon () const |
Qt::WindowModality | windowModality () const |
qreal | windowOpacity () const |
QString | windowRole () const |
Qt::WindowStates | windowState () const |
QString | windowTitle () const |
Qt::WindowType | windowType () const |
WId | winId () const |
int | x () const |
int | y () const |
Public Methods inherited from QObject | |
QObject (QObject *parent=nullptr) | |
~QObject () | |
bool | blockSignals (bool block) |
const QList< QObject * > & | children () const |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
bool | disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
bool | disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QString > | dynamicPropertyNames () const |
virtual bool | event (QEvent *event) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
template<typename T > | |
T | findChild (const QString &childName=QString ()) const |
template<class T > | |
QList< T > | findChildren (const QRegularExpression ®Exp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
template<class T > | |
QList< T > | findChildren (const QString &childName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const |
bool | inherits (const QString &className) const |
void | installEventFilter (QObject *filterObj) |
bool | isWidgetType () const |
bool | isWindowType () const |
void | killTimer (int id) |
const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
QString | objectName () const |
QObject * | parent () const |
template<class T = QVariant> | |
T | property (const QString &name) const |
void | removeEventFilter (QObject *obj) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const QString &name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer) |
QThread * | thread () const |
Public Methods inherited from QPaintDevice | |
virtual | ~QPaintDevice () |
int | colorCount () const |
int | depth () const |
int | devicePixelRatio () const |
qreal | devicePixelRatioF () const |
int | height () const |
int | heightMM () const |
int | logicalDpiX () const |
int | logicalDpiY () const |
bool | paintingActive () const |
int | physicalDpiX () const |
int | physicalDpiY () const |
int | width () const |
int | widthMM () const |
Protected Types | |
enum | CursorAction |
enum | DropIndicatorPosition |
enum | State |
Protected Slots | |
virtual void | closeEditor (QWidget *editor, QAbstractItemDelegate::EndEditHint hint) |
virtual void | commitData (QWidget *editor) |
virtual void | currentChanged (const QModelIndex ¤t, const QModelIndex &previous) |
virtual void | dataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight, const QVector< int > &roles=QVector< int >()) |
virtual void | editorDestroyed (QObject *editor) |
virtual void | rowsAboutToBeRemoved (const QModelIndex &parent, int start, int end) |
virtual void | rowsInserted (const QModelIndex &parent, int start, int end) |
virtual void | selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) |
virtual void | updateGeometries () |
Protected Slots inherited from QWidget | |
void | updateMicroFocus () |
Protected Methods | |
QPoint | dirtyRegionOffset () const |
void | dragEnterEvent (QDragEnterEvent *event) override |
void | dragLeaveEvent (QDragLeaveEvent *event) override |
void | dragMoveEvent (QDragMoveEvent *event) override |
void | dropEvent (QDropEvent *event) override |
DropIndicatorPosition | dropIndicatorPosition () const |
virtual bool | edit (const QModelIndex &index, EditTrigger trigger, QEvent *event) |
bool | event (QEvent *event) override |
void | executeDelayedItemsLayout () |
void | focusInEvent (QFocusEvent *event) override |
bool | focusNextPrevChild (bool next) override |
void | focusOutEvent (QFocusEvent *event) override |
virtual int | horizontalOffset () const = 0 |
int | horizontalStepsPerItem () const |
void | inputMethodEvent (QInputMethodEvent *event) override |
virtual bool | isIndexHidden (const QModelIndex &index) const = 0 |
void | keyPressEvent (QKeyEvent *event) override |
void | mouseDoubleClickEvent (QMouseEvent *event) override |
void | mouseMoveEvent (QMouseEvent *event) override |
void | mousePressEvent (QMouseEvent *event) override |
void | mouseReleaseEvent (QMouseEvent *event) override |
virtual QModelIndex | moveCursor (CursorAction cursorAction, Qt::KeyboardModifiers modifiers) = 0 |
void | resizeEvent (QResizeEvent *event) override |
void | scheduleDelayedItemsLayout () |
void | scrollDirtyRegion (int dx, int dy) |
virtual QModelIndexList | selectedIndexes () const |
virtual QItemSelectionModel::SelectionFlags | selectionCommand (const QModelIndex &index, const QEvent *event=nullptr) const |
void | setDirtyRegion (const QRegion ®ion) |
void | setHorizontalStepsPerItem (int steps) |
virtual void | setSelection (const QRect &rect, QItemSelectionModel::SelectionFlags flags) = 0 |
void | setState (State state) |
void | setVerticalStepsPerItem (int steps) |
virtual void | startDrag (Qt::DropActions supportedActions) |
State | state () const |
void | timerEvent (QTimerEvent *event) override |
virtual int | verticalOffset () const = 0 |
int | verticalStepsPerItem () const |
virtual QStyleOptionViewItem | viewOptions () const |
bool | viewportEvent (QEvent *event) override |
QSize | viewportSizeHint () const override |
virtual QRegion | visualRegionForSelection (const QItemSelection &selection) const = 0 |
Protected Methods inherited from QAbstractScrollArea | |
void | contextMenuEvent (QContextMenuEvent *event) override |
void | dragEnterEvent (QDragEnterEvent *event) override |
void | dragLeaveEvent (QDragLeaveEvent *event) override |
void | dragMoveEvent (QDragMoveEvent *event) override |
void | dropEvent (QDropEvent *event) override |
bool | event (QEvent *event) override |
void | keyPressEvent (QKeyEvent *event) override |
void | mouseDoubleClickEvent (QMouseEvent *event) override |
void | mouseMoveEvent (QMouseEvent *event) override |
void | mousePressEvent (QMouseEvent *event) override |
void | mouseReleaseEvent (QMouseEvent *event) override |
void | paintEvent (QPaintEvent *event) override |
void | resizeEvent (QResizeEvent *event) override |
virtual void | scrollContentsBy (int dx, int dy) |
void | setViewportMargins (const QMargins &margins) |
void | setViewportMargins (int left, int top, int right, int bottom) |
QMargins | viewportMargins () const |
void | wheelEvent (QWheelEvent *event) override |
Protected Methods inherited from QFrame | |
void | changeEvent (QEvent *event) override |
void | drawFrame (QPainter *painter) |
bool | event (QEvent *event) override |
void | initStyleOption (QStyleOptionFrame *option) const |
void | paintEvent (QPaintEvent *event) override |
Protected Methods inherited from QWidget | |
virtual void | actionEvent (QActionEvent *event) |
virtual void | closeEvent (QCloseEvent *event) |
void | create (WId window=0, bool initializeWindow=true, bool destroyOldWindow=true) |
void | destroy (bool destroyWindow=true, bool destroySubWindows=true) |
virtual void | enterEvent (QEvent *event) |
bool | event (QEvent *event) override |
bool | focusNextChild () |
bool | focusPreviousChild () |
virtual void | hideEvent (QHideEvent *event) |
void | initPainter (QPainter *painter) const override |
virtual void | keyReleaseEvent (QKeyEvent *event) |
virtual void | leaveEvent (QEvent *event) |
int | metric (PaintDeviceMetric metric) const override |
virtual void | moveEvent (QMoveEvent *event) |
virtual bool | nativeEvent (const QByteArray &eventType, void *message, long *result) |
virtual void | showEvent (QShowEvent *event) |
virtual void | tabletEvent (QTabletEvent *event) |
Protected Methods inherited from QObject | |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const QMetaMethod &signalMethod) const |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const QMetaMethod &signalMethod) const |
bool | isSignalConnected (const QMetaMethod &signalMethod) const |
int | receivers (const QString &signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Methods inherited from QPaintDevice | |
QPaintDevice () | |
Friends | |
class | QTreeView |
Additional Inherited Members | |
Static Public Methods inherited from QWidget | |
static QWidget * | createWindowContainer (QWindow *window, QWidget *parent=nullptr, Qt::WindowFlags flags=Qt::EmptyFlag) |
static QWidget * | find (WId id) |
static QWidget * | keyboardGrabber () |
static QWidget * | mouseGrabber () |
static void | setTabOrder (QWidget *firstWidget, QWidget *secondWidget) |
Static Public Methods inherited from QObject | |
static bool | connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ()) |
static bool | connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection) |
static bool | disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod) |
static bool | disconnect (const QObject *sender, std::nullptr_t, const QObject *receiver, std::nullptr_t) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...)) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr) |
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T > | |
static bool | disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod) |
static QMetaObject & | staticMetaObject () |
static QString | tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >()) |
Related Functions inherited from QWidget | |
QWidgetList | |
WId | |
Related Functions inherited from QObject | |
T | qobject_cast (QObject *object) |
QObjectList | |
The QAbstractItemView class provides the basic functionality for item view classes.
QAbstractItemView class is the base class for every standard view that uses a QAbstractItemModel. QAbstractItemView is an abstract class and can not itself be instantiated. It provides a standard interface for interoperating with models through the signals and slots mechanism, enabling subclasses to be kept up-to-date with changes to their models. This class provides standard support for keyboard and mouse navigation, viewport scrolling, item editing, and selections. The keyboard navigation implements this functionality.
Keys | Functionality |
---|---|
Arrow keys | Changes the current item and selects it. |
Ctrl+Arrow keys | Changes the current item but does not select it. |
Shift+Arrow keys | Changes the current item and selects it, previously selected items are not deselected. |
Ctrl+Space | Toggles selection of the current item. |
Tab/Backtab | Changes the current item to the next/previous item. |
Home/End | Selects the first/last item in the model. |
Page up/Page down | Scrolls the rows shown up/down by the number of visible rows in the view. |
Ctrl+A | Selects all items in the model. |
The table shown above assumes the selection mode allows the operations. For instance, you can not select items if the selection mode is QAbstractItemView::NoSelection. The view classes which inherit from QAbstractItemView only need to implement custom functionality, such as drawing items, returning the geometry of items, or finding items.
QAbstractItemView provides common slots such as edit() and setCurrentIndex(). Many protected slots are also provided, including dataChanged(), rowsInserted(), rowsAboutToBeRemoved(), selectionChanged(), and currentChanged(). The root item is returned by rootIndex() and the current item by currentIndex(). To make sure that an item is visible use scrollTo().
Some of QAbstractItemView's methods are concerned with scrolling, for example setHorizontalScrollMode() and setVerticalScrollMode(). To set the range of the scroll bars reimplement the view's resizeEvent() method.
The range is not updated until the widget is shown.
Several other methods are concerned with selection control. For example setSelectionMode(), and setSelectionBehavior(). This class provides a default selection model to work with (selectionModel()), but this can be replaced by using setSelectionModel() with an instance of QItemSelectionModel. For complete control over the display and editing of items you can specify a delegate with setItemDelegate().
QAbstractItemView provides a lot of protected methods. Some are concerned with editing, for example, edit(), and commitData(), whilst others are keyboard and mouse event handlers.
If you inherit QAbstractItemView and intend to update the contents of the viewport, you should use viewport->update() instead of update() as all painting operations take place on the viewport.
Typedef for QFlags<EditTrigger> which contains an OR combination of EditTrigger values.
Refer to QAbstractItemView::EditTrigger for the enum documentation.
|
protected |
This enum describes the different ways to navigate between items.
Constant | Value | Description |
---|---|---|
QAbstractItemView::MoveUp | 0 | Move to the item above the current item. |
QAbstractItemView::MoveDown | 1 | Move to the item below the current item. |
QAbstractItemView::MoveLeft | 2 | Move to the item left of the current item. |
QAbstractItemView::MoveRight | 3 | Move to the item right of the current item. |
QAbstractItemView::MoveHome | 4 | Move to the top-left corner item. |
QAbstractItemView::MoveEnd | 5 | Move to the bottom-right corner item. |
QAbstractItemView::MovePageUp | 6 | Move one page up above the current item. |
QAbstractItemView::MovePageDown | 7 | Move one page down below the current item. |
QAbstractItemView::MoveNext | 8 | Move to the item after the current item. |
QAbstractItemView::MovePrevious | 9 | Move to the item before the current item. |
Describes the various drag and drop events the view can act upon. By default the view does not support dragging or dropping (NoDragDrop
). The model used needs to provide support for drag and drop operations.
Constant | Value | Description |
---|---|---|
QAbstractItemView::NoDragDrop | 0 | Does not support dragging or dropping. |
QAbstractItemView::DragOnly | 1 | The view supports dragging of its own items |
QAbstractItemView::DropOnly | 2 | The view accepts drops |
QAbstractItemView::DragDrop | 3 | The view supports both dragging and dropping |
QAbstractItemView::InternalMove | 4 | The view accepts move (not copy) operations only from itself. |
|
protected |
This enum indicates the position of the drop indicator in relation to the index at the current mouse position:
Constant | Value | Description |
---|---|---|
QAbstractItemView::OnItem | 0 | The item will be dropped on the index. |
QAbstractItemView::AboveItem | 1 | The item will be dropped above the index. |
QAbstractItemView::BelowItem | 2 | The item will be dropped below the index. |
QAbstractItemView::OnViewport | 3 | The item will be dropped onto a region of the viewport with no items. The way each view handles items dropped onto the viewport depends on the behavior of the underlying model in use. |
This enum describes actions which will initiate item editing.
Constant | Value | Description |
---|---|---|
QAbstractItemView::NoEditTriggers | 0 | No editing possible. |
QAbstractItemView::CurrentChanged | 1 | Editing start whenever current item changes. |
QAbstractItemView::DoubleClicked | 2 | Editing starts when an item is double clicked. |
QAbstractItemView::SelectedClicked | 4 | Editing starts when clicking on an already selected item. |
QAbstractItemView::EditKeyPressed | 8 | Editing starts when the platform edit key has been pressed over an item. |
QAbstractItemView::AnyKeyPressed | 16 | Editing starts when any key is pressed over an item. |
QAbstractItemView::AllEditTriggers | 31 | Editing starts for all above actions. |
Constant | Value | Description |
---|---|---|
QAbstractItemView::EnsureVisible | 0 | Scroll to ensure that the item is visible. |
QAbstractItemView::PositionAtTop | 1 | Scroll to position the item at the top of the viewport. |
QAbstractItemView::PositionAtBottom | 2 | Scroll to position the item at the bottom of the viewport. |
QAbstractItemView::PositionAtCenter | 3 | Scroll to position the item at the center of the viewport. |
Constant | Value | Description |
---|---|---|
QAbstractItemView::ScrollPerItem | 0 | The view will scroll the contents one item at a time. |
QAbstractItemView::ScrollPerPixel | 1 | The view will scroll the contents one pixel at a time. |
Constant | Value | Description |
---|---|---|
QAbstractItemView::SelectItems | 0 | Selecting single items. |
QAbstractItemView::SelectRows | 1 | Selecting only rows. |
QAbstractItemView::SelectColumns | 2 | Selecting only columns. |
This enum indicates how the view responds to user selections. The most commonly used modes are SingleSelection and ExtendedSelection.
Constant | Value | Description |
---|---|---|
QAbstractItemView::SingleSelection | 1 | When the user selects an item, any already-selected item becomes unselected, and the user can not unselect the selected item by clicking on it. |
QAbstractItemView::ContiguousSelection | 4 | When the user selects an item in the usual way, the selection is cleared and the new item selected. However, if the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item. |
QAbstractItemView::ExtendedSelection | 3 | When the user selects an item in the usual way, the selection is cleared and the new item selected. However, if the user presses the Ctrl key when clicking on an item, the clicked item gets toggled and all other items are left untouched. If the user presses the Shift key while clicking on an item, all items between the current item and the clicked item are selected or unselected, depending on the state of the clicked item. Multiple items can be selected by dragging the mouse over them. |
QAbstractItemView::MultiSelection | 2 | When the user selects an item in the usual way, the selection status of that item is toggled and the other items are left alone. Multiple items can be toggled by dragging the mouse over them. |
QAbstractItemView::NoSelection | 0 | Items can not be selected. |
|
protected |
Describes the different states the view can be in. This is of value when reimplementing your own view.
Constant | Value | Description |
---|---|---|
QAbstractItemView::NoState | 0 | The is the default state. |
QAbstractItemView::DraggingState | 1 | The user is dragging items. |
QAbstractItemView::DragSelectingState | 2 | The user is selecting items. |
QAbstractItemView::EditingState | 3 | The user is editing an item in a widget editor. |
QAbstractItemView::ExpandingState | 4 | The user is opening a branch of items. |
QAbstractItemView::CollapsingState | 5 | The user is closing a branch of items. |
QAbstractItemView::AnimatingState | 6 | The item view is performing an animation. |
|
explicit |
Constructs an abstract item view with the given parent.
QAbstractItemView::~QAbstractItemView | ( | ) |
Destroys the view.
|
signal |
This signal is emitted when the item specified by index is activated by the user. Clicking the mouse on an item or pressing the Return or Enter key while the item is current, is considered activation.
bool QAbstractItemView::alternatingRowColors | ( | ) | const |
Returns the value of the property.
int QAbstractItemView::autoScrollMargin | ( | ) | const |
Returns the value of the property.
|
slot |
Deselects all selected items. The current index will not be changed.
|
signal |
This signal is emitted when a mouse button is clicked. The item the mouse was clicked on is specified by index. The signal is only emitted when the index is valid.
|
protectedslot |
Closes the given editor, and releases it. The hint is used to specify how the view should respond to the end of the editing operation. For example, the hint may indicate the next item in the view should be opened for editing.
void QAbstractItemView::closePersistentEditor | ( | const QModelIndex & | index | ) |
Closes the persistent editor for the item at the given index.
|
protectedslot |
Commit the data in the editor to the model.
|
protectedslot |
This slot is called when a new item becomes the current item. The previous current item is specified by the previous index, and the new item by the current index.
QModelIndex QAbstractItemView::currentIndex | ( | ) | const |
Returns the model index of the current item.
|
protectedslot |
This slot is called when items are changed in the model. The changed items are those from topLeft to bottomRight inclusive. If just one item is changed topLeft == bottomRight.
Qt::DropAction QAbstractItemView::defaultDropAction | ( | ) | const |
Returns the value of the property.
|
protected |
Returns the offset of the dirty regions in the view. If you use scrollDirtyRegion() and implement a paintEvent() in a subclass of QAbstractItemView, you should translate the area given by the paint event with the offset returned from this method.
|
signal |
This signal is emitted when a mouse button is double clicked. The item the mouse was double-clicked on is specified by index. The signal is only emitted when the index is valid.
DragDropMode QAbstractItemView::dragDropMode | ( | ) | const |
Returns the value of the property.
bool QAbstractItemView::dragDropOverwriteMode | ( | ) | const |
Returns the value of the property.
bool QAbstractItemView::dragEnabled | ( | ) | const |
Returns the value of the property.
|
overrideprotectedvirtual |
This method is called with the given event when a drag and drop operation enters the widget. If the drag is over a valid dropping target the event is accepted, otherwise it is ignored.
Reimplemented from QWidget::dragEnterEvent()
|
overrideprotectedvirtual |
This method is called when the item being dragged leaves the view. The event describes the state of the drag and drop operation.
Reimplemented from QWidget::dragLeaveEvent()
Reimplemented in QListView::dragLeaveEvent()
|
overrideprotectedvirtual |
This method is called continuously with the given event during a drag and drop operation over the widget. It can cause the view to scroll if, for example, the user drags a selection to view's right or bottom edge. In this case, the event will be accepted, otherwise it will be ignored.
Reimplemented from QWidget::dragMoveEvent()
Reimplemented in QTreeView::dragMoveEvent(), QListView::dragMoveEvent()
|
overrideprotectedvirtual |
This method is called with the given event when a drop event occurs over the widget. If the model accepts the event position the drop event is accepted, otherwise it is ignored.
Reimplemented from QWidget::dropEvent()
Reimplemented in QTreeWidget::dropEvent(), QTableWidget::dropEvent(), QListWidget::dropEvent(), QListView::dropEvent()
|
protected |
Returns the position of the drop indicator in relation to the closest item.
|
slot |
Starts editing the item corresponding to the given index if it is editable.
This method does not change the current index. Since the current index defines the next and previous items to edit, users may find that keyboard navigation does not work as expected. To provide consistent navigation behavior, call setCurrentIndex() before this method with the same model index.
|
protectedvirtual |
Starts editing the item at index, creating an editor if necessary, and returns true if the view's State is now EditingState, otherwise returns false. The action that caused the editing process is described by trigger, and the associated event is specified by event. Editing can be forced by specifying the trigger to be QAbstractItemView::AllEditTriggers.
|
protectedslot |
This method is called when the given editor has been destroyed.
EditTriggers QAbstractItemView::editTriggers | ( | ) | const |
Returns the value of the property.
|
signal |
This signal is emitted when the mouse cursor enters the item specified by index. Mouse tracking needs to be enabled for this feature to work.
|
overrideprotected |
Reimplemented from QAbstractScrollArea::event()
|
protected |
Executes the scheduled layouts without waiting for the event processing to begin.
|
overrideprotectedvirtual |
This method is called with the given event when the widget obtains the focus. By default, the event is ignored.
Reimplemented from QWidget::focusInEvent()
|
overrideprotectedvirtual |
Reimplemented from QWidget::focusNextPrevChild()
|
overrideprotectedvirtual |
This method is called with the given event when the widget looses the focus. By default, the event is ignored.
Reimplemented from QWidget::focusOutEvent()
bool QAbstractItemView::hasAutoScroll | ( | ) | const |
Returns the value of the property.
|
protectedpure virtual |
Returns the horizontal offset of the view.
Implemented in QHeaderView::horizontalOffset(), QListView::horizontalOffset(), QTreeView::horizontalOffset(), QTableView::horizontalOffset(), QColumnView::horizontalOffset()
ScrollMode QAbstractItemView::horizontalScrollMode | ( | ) | const |
Returns the value of the property.
|
deprecatedprotected |
QSize QAbstractItemView::iconSize | ( | ) | const |
Returns the value of the property.
|
signal |
Signal emitted when the iconSize property changes. The size parameter indicates the new icon size.
|
pure virtual |
Returns the model index of the item at the viewport coordinates point.
Implemented in QTableView::indexAt(), QTreeView::indexAt(), QColumnView::indexAt(), QHeaderView::indexAt(), QListView::indexAt()
QWidget * QAbstractItemView::indexWidget | ( | const QModelIndex & | index | ) | const |
Returns the widget for the item at the given index.
|
overrideprotectedvirtual |
Reimplemented from QWidget::inputMethodEvent()
|
overridevirtual |
Reimplemented from QWidget::inputMethodQuery()
|
protectedpure virtual |
Returns true if the item referred to by the given index is hidden in the view, otherwise returns false. The way items are hidden depends on the view. For example TableView allows hiding columns and TreeView allows rows.
Implemented in QHeaderView::isIndexHidden(), QListView::isIndexHidden(), QTreeView::isIndexHidden(), QTableView::isIndexHidden(), QColumnView::isIndexHidden()
QAbstractItemDelegate * QAbstractItemView::itemDelegate | ( | ) | const |
Returns the item delegate used by this view and model. This is either one set with setItemDelegate() or the default one.
QAbstractItemDelegate * QAbstractItemView::itemDelegate | ( | const QModelIndex & | index | ) | const |
Returns the item delegate used by this view and model for the given index.
QAbstractItemDelegate * QAbstractItemView::itemDelegateForColumn | ( | int | column | ) | const |
Returns the item delegate used by this view and model for the given column. You can call itemDelegate() to get a pointer to the current delegate for a given index.
QAbstractItemDelegate * QAbstractItemView::itemDelegateForRow | ( | int | row | ) | const |
Returns the item delegate used by this view and model for the given row or a nullptr if no delegate has been assigned. You can call itemDelegate() to get a pointer to the current delegate for a given index.
|
virtual |
Moves to and selects the item best matching the string search. If no item is found nothing happens. In the default implementation, the search is reset if search is empty, or the time interval since the last search has exceeded QApplication::keyboardInputInterval().
Reimplemented in QTreeView::keyboardSearch()
|
overrideprotectedvirtual |
This method is called with the given event when a key event is sent to the widget. The default implementation handles basic cursor movement like Up, Down, Left, Right, Home, PageUp, and PageDown. The activated() signal is emitted if the current index is valid and the activation key like Enter or Return are pressed. This method is where editing is initiated by key press, for example when F2 is pressed.
Reimplemented from QWidget::keyPressEvent()
Reimplemented in QTreeView::keyPressEvent()
QAbstractItemModel * QAbstractItemView::model | ( | ) | const |
Returns the model this view is presenting.
|
overrideprotectedvirtual |
This method is called with the given event when a mouse button is double clicked inside the widget. If the double-click is on a valid item it emits the doubleClicked() signal and calls edit() on the item.
Reimplemented from QWidget::mouseDoubleClickEvent()
Reimplemented in QHeaderView::mouseDoubleClickEvent(), QTreeView::mouseDoubleClickEvent()
|
overrideprotectedvirtual |
This method is called with the given event when a mouse move event is sent to the widget. If a selection is in progress and new items are moved over the selection is extended. If a drag is in progress it is continued.
Reimplemented from QWidget::mouseMoveEvent()
Reimplemented in QHeaderView::mouseMoveEvent(), QTreeView::mouseMoveEvent(), QListView::mouseMoveEvent()
|
overrideprotectedvirtual |
This method is called with the given event when a mouse button is pressed while the cursor is inside the widget. If a valid item is pressed on it is made into the current item. This method emits the pressed() signal.
Reimplemented from QWidget::mousePressEvent()
Reimplemented in QHeaderView::mousePressEvent(), QTreeView::mousePressEvent()
|
overrideprotectedvirtual |
This method is called with the given event when a mouse button is released, after a mouse press event on the widget. If a user presses the mouse inside your widget and then drags the mouse to another location before releasing the mouse button, your widget receives the release event. The method will emit the clicked() signal if an item was being pressed.
Reimplemented from QWidget::mouseReleaseEvent()
Reimplemented in QHeaderView::mouseReleaseEvent(), QTreeView::mouseReleaseEvent(), QListView::mouseReleaseEvent()
|
protectedpure virtual |
Returns a QModelIndex object pointing to the next object in the view, based on the given cursorAction and keyboard modifiers specified by modifiers.
Implemented in QHeaderView::moveCursor(), QListView::moveCursor(), QTreeView::moveCursor(), QTableView::moveCursor(), QColumnView::moveCursor()
void QAbstractItemView::openPersistentEditor | ( | const QModelIndex & | index | ) |
Opens a persistent editor on the item at the given index. If no editor exists the delegate will create a new editor.
|
signal |
This signal is emitted when a mouse button is pressed. The item the mouse was pressed on is specified by index. The signal is only emitted when the index is valid. Use the QApplication::mouseButtons() method to get the state of the mouse buttons.
|
slot |
Reset the internal state of the view.
This method will reset open editors, scroll bar positions, selections, etc. Existing changes will not be committed. If you would like to save your changes when resetting the view, you can reimplement this method, commit your changes, and then call the superclass' implementation.
|
overrideprotectedvirtual |
This method is called with the given event when a resize event is sent to the widget.
Reimplemented from QWidget::resizeEvent()
Reimplemented in QListView::resizeEvent(), QColumnView::resizeEvent()
QModelIndex QAbstractItemView::rootIndex | ( | ) | const |
Returns the model index of the root item. The root item is the parent of all top level items
|
protectedslot |
This slot is called when rows are about to be removed. The deleted rows are those under the given parent from start to end inclusive.
|
protectedslot |
This slot is called when rows are inserted. The new rows are those under the given parent from start to end inclusive. The base class implementation calls fetchMore() on the model to check for more data.
|
protected |
Schedules a layout of the items in the view to be executed when the event processing starts. Even if scheduleDelayedItemsLayout() is called multiple times before events are processed, the view will only do the layout once.
|
protected |
Prepares the view for scrolling by (dx,dy) pixels by moving the dirty regions in the opposite direction. You only need to call this method if you are implementing a scrolling viewport in your view subclass. If you implement scrollContentsBy() in a subclass of QAbstractItemView, call this method before you call QWidget::scroll() on the viewport. Alternatively, call update().
|
pure virtual |
Scrolls the view if necessary to ensure that the item at index is visible. The view will try to position the item according to the given hint.
Implemented in QListView::scrollTo(), QTreeView::scrollTo(), QTableView::scrollTo(), QColumnView::scrollTo(), QHeaderView::scrollTo()
|
slot |
Scrolls the view to the bottom.
|
slot |
Scrolls the view to the top.
|
slot |
Selects all items in the view. This method will use the selection behavior set on the view when selecting.
|
protectedvirtual |
Returns a list of all selected and non-hidden item indexes in the view. The list contains no duplicates and is not sorted.
Reimplemented in QListView::selectedIndexes(), QTreeView::selectedIndexes(), QTableView::selectedIndexes()
QAbstractItemView::SelectionBehavior QAbstractItemView::selectionBehavior | ( | ) | const |
Returns the value of the property.
|
protectedslot |
This slot is called when the selection is changed. The previous selection (which may be empty), is specified by deselected, and the new selection by selected.
|
protectedvirtual |
Returns the SelectionFlags to be used when updating a selection with to include the index specified. The event is a user input event, such as a mouse or keyboard event.
Reimplement this method to define your own selection behavior.
QAbstractItemView::SelectionMode QAbstractItemView::selectionMode | ( | ) | const |
Returns the value of the property.
QItemSelectionModel * QAbstractItemView::selectionModel | ( | ) | const |
Returns the current selection model.
void QAbstractItemView::setAlternatingRowColors | ( | bool | enable | ) |
Sets the value of the property to enable.
void QAbstractItemView::setAutoScroll | ( | bool | enable | ) |
Sets the value of the property to enable.
void QAbstractItemView::setAutoScrollMargin | ( | int | margin | ) |
Sets the value of the property to margin.
|
slot |
Sets the current item based on the given index. If the current selection mode is not SelectionMode::NoSelection, the item will be selected. This method also updates the starting position for any new selections the user performs.
To set an item as the current item without selecting it, use the following code.
void QAbstractItemView::setDefaultDropAction | ( | Qt::DropAction | dropAction | ) |
Sets the value of the property to dropAction.
|
protected |
Marks the given region as dirty and schedules it to be updated. You only need to call this method if you are implementing your own view subclass.
void QAbstractItemView::setDragDropMode | ( | DragDropMode | behavior | ) |
Sets the value of the property to behavior.
void QAbstractItemView::setDragDropOverwriteMode | ( | bool | overwrite | ) |
Sets the value of the property to overwrite.
void QAbstractItemView::setDragEnabled | ( | bool | enable | ) |
Sets the value of the property to enable.
void QAbstractItemView::setDropIndicatorShown | ( | bool | enable | ) |
Sets the value of the property to enable.
void QAbstractItemView::setEditTriggers | ( | EditTriggers | triggers | ) |
Sets the value of the property to triggers.
void QAbstractItemView::setHorizontalScrollMode | ( | ScrollMode | mode | ) |
Sets the value of the property to mode.
|
deprecatedprotected |
This is the number of steps used by the horizontal scroll bar to represent the width of an item. If the view has a horizontal header, the item steps will be ignored and the header section size will be used instead.
void QAbstractItemView::setIconSize | ( | const QSize & | size | ) |
Sets the value of the property to size.
void QAbstractItemView::setIndexWidget | ( | const QModelIndex & | index, |
QWidget * | widget | ||
) |
Sets the given widget on the item at the given index, passing the ownership of the widget to the viewport. If index is invalid (e.g., if you pass the root index), this method will do nothing. The given widget's autoFillBackground property must be set to true, otherwise the widget's background will be transparent, showing both the model data and the item at the given index.
This method should only be used to display static content within the visible area corresponding to an item of data. If you want to display custom dynamic content or implement a custom editor widget, subclass QItemDelegate instead.
If index widget A is replaced with index widget B the old index widget will be deleted. For example, in the code below the QLineEdit object will be deleted.
void QAbstractItemView::setItemDelegate | ( | QAbstractItemDelegate * | delegate | ) |
Sets the item delegate for this view and its model to delegate. This is useful if you want complete control over the editing and display of items. Any existing delegate will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.
You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the closeEditor() signal, and attempt to access, modify or close an editor that has already been closed.
void QAbstractItemView::setItemDelegateForColumn | ( | int | column, |
QAbstractItemDelegate * | delegate | ||
) |
Sets the given item delegate used by this view and model for the given column. All items on column will be drawn and managed by delegate instead of using the default delegate (i.e., itemDelegate()). Any existing column delegate for column will be removed, but not deleted. QAbstractItemView does not take ownership of delegate.
If a delegate has been assigned to both a row and a column, the row delegate will take precedence and manage the intersecting cell index.
void QAbstractItemView::setItemDelegateForRow | ( | int | row, |
QAbstractItemDelegate * | delegate | ||
) |
Sets the given item delegate used by this view and model for the given row. All items on row will be drawn and managed by delegate instead of using the default delegate (i.e., itemDelegate()). Any existing row delegate for row will be removed, but not deleted. QAbstractItemView does not take ownership of the given delegate.
If a delegate has been assigned to both a row and a column, the row delegate (i.e., this delegate) will take precedence and manage the intersecting cell index.
You should not share the same instance of a delegate between views. Doing so can cause incorrect or unintuitive editing behavior since each view connected to a given delegate may receive the close Editor() signal, and attempt to access, modify or close an editor that has already been closed.
|
virtual |
Sets the model for the view to present.
This method will create and set a new selection model, replacing any model that was previously set with setSelectionModel(). However, the old selection model will not be deleted as it may be shared between several views. We recommend that you delete the old selection model if it is no longer required.
If both the old model and the old selection model do not have parents, or if their parents are long-lived objects, it may be preferable to call their deleteLater() methods to explicitly delete them.
The view does not take ownership of the model unless it is the model's parent object because the model may be shared between many different views.
Reimplemented in QHeaderView::setModel(), QTreeView::setModel(), QTableView::setModel(), QColumnView::setModel()
|
slot |
Sets the root item to the given index. This will limit the view to only display children of the given index.
|
protectedpure virtual |
Applies the selection flags to the items in or touched by the given rect.
When inheriting from QAbstractItemView your implementation of this method should call selectionModel()->select(selection, flags) where selection is either an empty QModelIndex or a QItemSelection which contains all items that are contained in rect.
Implemented in QHeaderView::setSelection(), QListView::setSelection(), QTableView::setSelection(), QColumnView::setSelection(), QTreeView::setSelection()
void QAbstractItemView::setSelectionBehavior | ( | QAbstractItemView::SelectionBehavior | behavior | ) |
Sets the value of the property to behavior.
void QAbstractItemView::setSelectionMode | ( | QAbstractItemView::SelectionMode | mode | ) |
Sets the value of the property to mode.
|
virtual |
Sets the current selection model to the given selectionModel. If you call setModel() after this method, the given selectionModel will be replaced by one created by the view.
It is up to the application to delete the old selection model if it is no longer needed. This will happen automatically when its parent object is deleted. However, if it does not have a parent, or if the parent is a long-lived object, it may be preferable to call its deleteLater() method to explicitly delete it.
Reimplemented in QTreeWidget::setSelectionModel(), QTreeView::setSelectionModel(), QTableView::setSelectionModel(), QColumnView::setSelectionModel()
|
protected |
Sets the item view's state to the given state.
void QAbstractItemView::setTabKeyNavigation | ( | bool | enable | ) |
Sets the value of the property to enable.
void QAbstractItemView::setTextElideMode | ( | Qt::TextElideMode | mode | ) |
Sets the value of the property to mode.
void QAbstractItemView::setVerticalScrollMode | ( | ScrollMode | mode | ) |
Sets the value of the property to mode.
|
deprecatedprotected |
This is the number of steps used by the vertical scroll bar to represent the height of an item. If the view has a vertical header, the item steps will be ignored and the header section size will be used instead.
bool QAbstractItemView::showDropIndicator | ( | ) | const |
Returns the value of the property.
|
virtual |
Returns the width size hint for the specified column or -1 if there is no model. This method is used in views with a horizontal header to find the size hint for a header section based on the contents of the given column.
Reimplemented in QTreeView::sizeHintForColumn(), QTableView::sizeHintForColumn()
QSize QAbstractItemView::sizeHintForIndex | ( | const QModelIndex & | index | ) | const |
Returns the size hint for the item with the specified index or an invalid size for invalid indexes.
|
virtual |
Returns the height size hint for the specified row or -1 if there is no model. The returned height is calculated using the size hints of the given row's items, i.e. the returned value is the maximum height among the items.
To control the height of a row, you must reimplement the QAbstractItemDelegate::sizeHint() method. This method is used in views with a vertical header to find the size hint for a header section based on the contents of the given row.
Reimplemented in QTableView::sizeHintForRow()
|
protectedvirtual |
Starts a drag by calling drag->exec() using the given supportedActions.
Reimplemented in QListView::startDrag()
|
protected |
Returns the item view's state.
bool QAbstractItemView::tabKeyNavigation | ( | ) | const |
Returns the value of the property.
Qt::TextElideMode QAbstractItemView::textElideMode | ( | ) | const |
Returns the value of the property.
|
overrideprotected |
This method is called with the given event when a timer event is sent to the widget.
|
slot |
Updates the area occupied by the given index.
|
protectedslot |
Updates the geometry of the child widgets of the view.
|
protectedpure virtual |
Returns the vertical offset of the view.
Implemented in QHeaderView::verticalOffset(), QListView::verticalOffset(), QTreeView::verticalOffset(), QTableView::verticalOffset(), QColumnView::verticalOffset()
ScrollMode QAbstractItemView::verticalScrollMode | ( | ) | const |
Returns the value of the property.
|
deprecatedprotected |
|
protectedvirtual |
Returns a QStyleOptionViewItem structure populated with the view's palette, font, state, alignments etc.
Reimplemented in QListView::viewOptions(), QTableView::viewOptions()
|
signal |
This signal is emitted when the mouse cursor enters the viewport. Mouse tracking needs to be enabled for this feature to work.
|
overrideprotectedvirtual |
This method is used to handle tool tips, and "What's This?" mode, if the given event is a QEvent::ToolTip,or a QEvent::WhatsThis. It passes all other events on to its base class viewportEvent() handler.
Reimplemented from QAbstractScrollArea::viewportEvent()
Reimplemented in QHeaderView::viewportEvent(), QTreeView::viewportEvent()
|
overrideprotectedvirtual |
Returns the value of the property.
Reimplemented from QAbstractScrollArea::viewportSizeHint()
Reimplemented in QListView::viewportSizeHint(), QTreeView::viewportSizeHint(), QTableView::viewportSizeHint()
|
pure virtual |
Returns the rectangle on the viewport occupied by the item at index.
If your item is displayed in several areas then this method should return the primary area which contains index and not the complete area that index might encompasses, touch or cause drawing.
Implemented in QHeaderView::visualRect(), QListView::visualRect(), QTreeView::visualRect(), QTableView::visualRect(), QColumnView::visualRect()
|
protectedpure virtual |
Returns the region from the viewport of the items in the given selection.
Implemented in QHeaderView::visualRegionForSelection(), QListView::visualRegionForSelection(), QTreeView::visualRegionForSelection(), QTableView::visualRegionForSelection(), QColumnView::visualRegionForSelection()
|
This property holds whether to draw the background using alternating colors. If this property is true, the item background will be drawn using QPalette::Base and QPalette::AlternateBase, otherwise the background will be drawn using the QPalette::Base color.
By default, this property is false.
Properties | Class Methods |
---|---|
read | alternatingRowColors |
write | setAlternatingRowColors |
|
This property holds whether autoscrolling in drag move events is enabled. If this property is set to true (the default), the QAbstractItemView automatically scrolls the contents of the view if the user drags within 16 pixels of the viewport edge. If the current item changes, then the view will scroll automatically to ensure that the current item is fully visible.
This property only works if the viewport accepts drops. Autoscroll is switched off by setting this property to false.
Properties | Class Methods |
---|---|
read | hasAutoScroll |
write | setAutoScroll |
|
This property holds the size of the area when auto scrolling is triggered. This property controls the size of the area at the edge of the viewport that triggers autoscrolling. The default value is 16 pixels.
Properties | Class Methods |
---|---|
read | autoScrollMargin |
write | setAutoScrollMargin |
|
This property holds the drop action that will be used by default in QAbstractItemView::drag(). If the property is not set, the drop action is CopyAction when the supported actions support CopyAction.
Properties | Class Methods |
---|---|
read | defaultDropAction |
write | setDefaultDropAction |
|
This property holds the drag and drop event the view will act upon.
Properties | Class Methods |
---|---|
read | dragDropMode |
write | setDragDropMode |
|
This property holds the view's drag and drop behavior. If its value is true the selected data will overwrite the existing item data when dropped, while moving the data will clear the item. If its value is false the selected data will be inserted as a new item when the data is dropped. When the data is moved, the item is removed as well.
The default value is false for QListView and QTreeView subclasses. In QTableView subclass the property is set to true.
Properties | Class Methods |
---|---|
read | dragDropOverwriteMode |
write | setDragDropOverwriteMode |
|
This property holds whether the view supports dragging of its own items.
Properties | Class Methods |
---|---|
read | dragEnabled |
write | setDragEnabled |
|
This property holds which actions will initiate item editing. This property is a selection of flags defined by EditTrigger, combined using the OR operator. The view will only initiate the editing of an item if the action performed is set in this property.
Properties | Class Methods |
---|---|
read | editTriggers |
write | setEditTriggers |
|
This property holds how the view scrolls its contents in the horizontal direction. This property controls how the view scroll its contents horizontally. Scrolling can be done either per pixel or per item.
Properties | Class Methods |
---|---|
read | horizontalScrollMode |
write | setHorizontalScrollMode |
|
This property holds the size of items' icons. Setting this property when the view is visible will cause the items to be laid out again.
Properties | Class Methods |
---|---|
read | iconSize |
write | setIconSize |
notify | iconSizeChanged |
|
This property holds which selection behavior the view uses. This property holds whether selections are done in terms of single items, rows or columns.
Properties | Class Methods |
---|---|
read | selectionBehavior |
write | setSelectionBehavior |
|
This property holds which selection mode the view operates in. This property controls whether the user can select one or many items and, in many-item selections, whether the selection must be a continuous range of items.
Properties | Class Methods |
---|---|
read | selectionMode |
write | setSelectionMode |
|
This property holds whether the drop indicator is shown when dragging items and dropping.
Properties | Class Methods |
---|---|
read | showDropIndicator |
write | setDropIndicatorShown |
|
This property holds whether item navigation with tab and backtab is enabled.
Properties | Class Methods |
---|---|
read | tabKeyNavigation |
write | setTabKeyNavigation |
|
This property holds the position of the "..." in elided text. The default value for all item views is Qt::ElideRight.
Properties | Class Methods |
---|---|
read | textElideMode |
write | setTextElideMode |
|
This property holds how the view scrolls its contents in the vertical direction. This property controls how the view scroll its contents vertically. Scrolling can be done either per pixel or per item.
Properties | Class Methods |
---|---|
read | verticalScrollMode |
write | setVerticalScrollMode |