QAbstractItemView Class Reference |
enum | DragDropMode { NoDragDrop, DragOnly, DropOnly, DragDrop, InternalMove } |
enum | EditTrigger { NoEditTriggers, CurrentChanged, DoubleClicked, SelectedClicked, ..., AllEditTriggers } |
flags | EditTriggers |
enum | ScrollHint { EnsureVisible, PositionAtTop, PositionAtBottom, PositionAtCenter } |
enum | ScrollMode { ScrollPerItem, ScrollPerPixel } |
enum | SelectionBehavior { SelectItems, SelectRows, SelectColumns } |
enum | SelectionMode { SingleSelection, ContiguousSelection, ExtendedSelection, MultiSelection, NoSelection } |
|
|
QAbstractItemView ( QWidget * parent = 0 ) | |
~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 |
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 |
virtual QVariant | inputMethodQuery ( Qt::InputMethodQuery query ) const |
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 ) |
void | activated ( const QModelIndex & index ) |
void | clicked ( const QModelIndex & index ) |
void | doubleClicked ( const QModelIndex & index ) |
void | entered ( const QModelIndex & index ) |
void | pressed ( const QModelIndex & index ) |
void | viewportEntered () |
enum | CursorAction { MoveUp, MoveDown, MoveLeft, MoveRight, ..., MovePrevious } |
enum | DropIndicatorPosition { OnItem, AboveItem, BelowItem, OnViewport } |
enum | State { NoState, DraggingState, DragSelectingState, EditingState, ..., AnimatingState } |
QPoint | dirtyRegionOffset () const |
DropIndicatorPosition | dropIndicatorPosition () const |
virtual bool | edit ( const QModelIndex & index, EditTrigger trigger, QEvent * event ) |
void | executeDelayedItemsLayout () |
virtual int | horizontalOffset () const = 0 |
virtual bool | isIndexHidden ( const QModelIndex & index ) const = 0 |
virtual QModelIndex | moveCursor ( CursorAction cursorAction, Qt::KeyboardModifiers modifiers ) = 0 |
void | scheduleDelayedItemsLayout () |
void | scrollDirtyRegion ( int dx, int dy ) |
virtual QModelIndexList | selectedIndexes () const |
virtual QItemSelectionModel::SelectionFlags | selectionCommand ( const QModelIndex & index, const QEvent * event = 0 ) const |
void | setDirtyRegion ( const QRegion & region ) |
virtual void | setSelection ( const QRect & rect, QItemSelectionModel::SelectionFlags flags ) = 0 |
void | setState ( State state ) |
virtual void | startDrag ( Qt::DropActions supportedActions ) |
State | state () const |
virtual int | verticalOffset () const = 0 |
virtual QStyleOptionViewItem | viewOptions () const |
virtual QRegion | visualRegionForSelection ( const QItemSelection & selection ) const = 0 |
virtual void | dragEnterEvent ( QDragEnterEvent * event ) |
virtual void | dragLeaveEvent ( QDragLeaveEvent * event ) |
virtual void | dragMoveEvent ( QDragMoveEvent * event ) |
virtual void | dropEvent ( QDropEvent * event ) |
virtual bool | event ( QEvent * event ) |
virtual void | focusInEvent ( QFocusEvent * event ) |
virtual bool | focusNextPrevChild ( bool next ) |
virtual void | focusOutEvent ( QFocusEvent * event ) |
virtual void | inputMethodEvent ( QInputMethodEvent * event ) |
virtual void | keyPressEvent ( QKeyEvent * event ) |
virtual void | mouseDoubleClickEvent ( QMouseEvent * event ) |
virtual void | mouseMoveEvent ( QMouseEvent * event ) |
virtual void | mousePressEvent ( QMouseEvent * event ) |
virtual void | mouseReleaseEvent ( QMouseEvent * event ) |
virtual void | resizeEvent ( QResizeEvent * event ) |
virtual void | timerEvent ( QTimerEvent * event ) |
virtual bool | viewportEvent ( QEvent * event ) |
virtual void | closeEditor ( QWidget * editor, QAbstractItemDelegate::EndEditHint hint ) |
virtual void | commitData ( QWidget * editor ) |
virtual void | currentChanged ( const QModelIndex & current, const QModelIndex & previous ) |
virtual void | dataChanged ( const QModelIndex & topLeft, const QModelIndex & bottomRight ) |
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 () |
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 cannot 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. The previously selected item(s) is not deselected. |
Ctr+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. |
Note that the above table assumes that the selection mode allows the operations. For instance, you cannot select items if the selection mode is QAbstractItemView::NoSelection.
The QAbstractItemView class is one of the Model/View Classes and is part of Qt's model/view framework.
The view classes that inherit QAbstractItemView only need to implement their own view-specific functionality, such as drawing items, returning the geometry of items, finding items, etc.
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 functions are concerned with scrolling, for example setHorizontalScrollMode() and setVerticalScrollMode(). To set the range of the scroll bars, you can, for example, reimplement the view's resizeEvent() function:
void MyView::resizeEvent(QResizeEvent *event) { horizontalScrollBar()->setRange(0, realWidth - width()); ... }
Note that the range is not updated until the widget is shown.
Several other functions 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 functions. Some are concerned with editing, for example, edit(), and commitData(), whilst others are keyboard and mouse event handlers.
Note: 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.
See also View Classes, Model/View Programming, QAbstractItemModel, and Chart Example.
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. |
See also moveCursor().
Describes the various drag and drop events the view can act upon. By default the view does not support dragging or dropping (NoDragDrop).
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. |
Note that the model used needs to provide support for drag and drop operations.
This enum was introduced in Qt 4.2.
See also setDragDropMode() and Using Drag and Drop with Item Views.
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. |
The EditTriggers type is a typedef for QFlags<EditTrigger>. It stores an OR combination of EditTrigger values.
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. |
This enum was introduced in Qt 4.2.
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:
Constant | Value | Description |
---|---|---|
QAbstractItemView::SingleSelection | 1 | When the user selects an item, any already-selected item becomes unselected, and the user cannot 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 cannot be selected. |
The most commonly used modes are SingleSelection and ExtendedSelection.
Describes the different states the view can be in. This is usually only interesting 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. |
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.
Access functions:
bool | alternatingRowColors () const |
void | setAlternatingRowColors ( bool enable ) |
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.
Access functions:
bool | hasAutoScroll () const |
void | setAutoScroll ( bool enable ) |
This property holds the size of the area when auto scrolling is triggered.
This property controlls the size of the area at the edge of the viewport that triggers autoscrolling. The default value is 16 pixels.
This property was introduced in Qt 4.4.
Access functions:
int | autoScrollMargin () const |
void | setAutoScrollMargin ( int margin ) |
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.
This property was introduced in Qt 4.6.
Access functions:
Qt::DropAction | defaultDropAction () const |
void | setDefaultDropAction ( Qt::DropAction dropAction ) |
See also showDropIndicator and dragDropOverwriteMode.
This property holds the drag and drop event the view will act upon.
This property was introduced in Qt 4.2.
Access functions:
DragDropMode | dragDropMode () const |
void | setDragDropMode ( DragDropMode behavior ) |
See also showDropIndicator and dragDropOverwriteMode.
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, as in the QListView and QTreeView subclasses. In the QTableView subclass, on the other hand, the property has been set to true.
Note: This is not intended to prevent overwriting of items. The model's implementation of flags() should do that by not returning Qt::ItemIsDropEnabled.
This property was introduced in Qt 4.2.
Access functions:
bool | dragDropOverwriteMode () const |
void | setDragDropOverwriteMode ( bool overwrite ) |
See also dragDropMode.
This property holds whether the view supports dragging of its own items.
Access functions:
bool | dragEnabled () const |
void | setDragEnabled ( bool enable ) |
See also showDropIndicator, DragDropMode, dragDropOverwriteMode, and acceptDrops.
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.
Access functions:
EditTriggers | editTriggers () const |
void | setEditTriggers ( EditTriggers triggers ) |
This property holds how the view scrolls its contents in the horizontal direction.
This property controlls how the view scroll its contents horizontally. Scrolling can be done either per pixel or per item.
This property was introduced in Qt 4.2.
Access functions:
ScrollMode | horizontalScrollMode () const |
void | setHorizontalScrollMode ( ScrollMode mode ) |
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.
Access functions:
QSize | iconSize () const |
void | setIconSize ( const QSize & size ) |
This property holds which selection behavior the view uses.
This property holds whether selections are done in terms of single items, rows or columns.
Access functions:
QAbstractItemView::SelectionBehavior | selectionBehavior () const |
void | setSelectionBehavior ( QAbstractItemView::SelectionBehavior behavior ) |
See also SelectionMode and SelectionBehavior.
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.
Access functions:
QAbstractItemView::SelectionMode | selectionMode () const |
void | setSelectionMode ( QAbstractItemView::SelectionMode mode ) |
See also SelectionMode and SelectionBehavior.
This property holds whether the drop indicator is shown when dragging items and dropping.
Access functions:
bool | showDropIndicator () const |
void | setDropIndicatorShown ( bool enable ) |
See also dragEnabled, DragDropMode, dragDropOverwriteMode, and acceptDrops.
This property holds whether item navigation with tab and backtab is enabled.
Access functions:
bool | tabKeyNavigation () const |
void | setTabKeyNavigation ( bool enable ) |
This property holds the position of the "..." in elided text.
The default value for all item views is Qt::ElideRight.
Access functions:
Qt::TextElideMode | textElideMode () const |
void | setTextElideMode ( Qt::TextElideMode mode ) |
This property holds how the view scrolls its contents in the vertical direction.
This property controlls how the view scroll its contents vertically. Scrolling can be done either per pixel or per item.
This property was introduced in Qt 4.2.
Access functions:
ScrollMode | verticalScrollMode () const |
void | setVerticalScrollMode ( ScrollMode mode ) |
Constructs an abstract item view with the given parent.
Destroys the view.
This signal is emitted when the item specified by index is activated by the user. How to activate items depends on the platform; e.g., by single- or double-clicking the item, or by pressing the Return or Enter key when the item is current.
See also clicked(), doubleClicked(), entered(), and pressed().
Deselects all selected items. The current index will not be changed.
See also setSelection() and selectAll().
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.
See also activated(), doubleClicked(), entered(), and pressed().
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 that the next item in the view should be opened for editing.
See also edit() and commitData().
Closes the persistent editor for the item at the given index.
See also openPersistentEditor().
Commit the data in the editor to the model.
See also closeEditor().
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.
If you want to know about changes to items see the dataChanged() signal.
Returns the model index of the current item.
See also setCurrentIndex().
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.
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 function.
See also scrollDirtyRegion() and setDirtyRegion().
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.
See also clicked() and activated().
Reimplemented from QWidget::dragEnterEvent().
This function is called with the given event when a drag and drop operation enters the widget. If the drag is over a valid dropping place (e.g. over an item that accepts drops), the event is accepted; otherwise it is ignored.
See also dropEvent() and startDrag().
Reimplemented from QWidget::dragLeaveEvent().
This function is called when the item being dragged leaves the view. The event describes the state of the drag and drop operation.
Reimplemented from QWidget::dragMoveEvent().
This function 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.
See also dropEvent() and startDrag().
Reimplemented from QWidget::dropEvent().
This function is called with the given event when a drop event occurs over the widget. If the model accepts the even position the drop event is accepted; otherwise it is ignored.
See also startDrag().
Returns the position of the drop indicator in relation to the closest item.
This function was introduced in Qt 4.1.
Starts editing the item corresponding to the given index if it is editable.
Note that this function 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 function with the same model index.
See also QModelIndex::flags().
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.
See also closeEditor().
This function is called when the given editor has been destroyed.
See also closeEditor().
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.
See also viewportEntered(), activated(), clicked(), doubleClicked(), and pressed().
Reimplemented from QObject::event().
Executes the scheduled layouts without waiting for the event processing to begin.
See also scheduleDelayedItemsLayout().
Reimplemented from QWidget::focusInEvent().
This function is called with the given event when the widget obtains the focus. By default, the event is ignored.
See also setFocus() and focusOutEvent().
Reimplemented from QWidget::focusNextPrevChild().
Reimplemented from QWidget::focusOutEvent().
This function is called with the given event when the widget looses the focus. By default, the event is ignored.
See also clearFocus() and focusInEvent().
Returns the horizontal offset of the view.
In the base class this is a pure virtual function.
See also verticalOffset().
Returns the model index of the item at the viewport coordinates point.
In the base class this is a pure virtual function.
See also visualRect().
Returns the widget for the item at the given index.
This function was introduced in Qt 4.1.
See also setIndexWidget().
Reimplemented from QWidget::inputMethodEvent().
Reimplemented from QWidget::inputMethodQuery().
Cette page est une traduction d'une page de la documentation de Qt, écrite par Nokia Corporation and/or its subsidiary(-ies). Les éventuels problèmes résultant d'une mauvaise traduction ne sont pas imputables à Nokia. | Qt 4.6-snapshot | |
Copyright © 2012 Developpez LLC. Tous droits réservés Developpez LLC. Aucune reproduction, même partielle, ne peut être faite de ce site et de l'ensemble de son contenu : textes, documents et images sans l'autorisation expresse de Developpez LLC. Sinon, vous encourez selon la loi jusqu'à 3 ans de prison et jusqu'à 300 000 E de dommages et intérêts. Cette page est déposée à la SACD. | ||
Vous avez déniché une erreur ? Un bug ? Une redirection cassée ? Ou tout autre problème, quel qu'il soit ? Ou bien vous désirez participer à ce projet de traduction ? N'hésitez pas à nous contacter ou par MP ! |
Copyright © 2000-2012 - www.developpez.com