|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QFrame
com.trolltech.qt.gui.QAbstractScrollArea
com.trolltech.qt.gui.QAbstractItemView
com.trolltech.qt.gui.QTreeView
public class QTreeView
The QTreeView class provides a default model/view implementation of a tree view.
A QTreeView implements a tree representation of items from a model. This class is used to provide standard hierarchical lists that were previously provided by the QListView class, but using the more flexible approach provided by Qt's model/view architecture.
The QTreeView class is one of the Model/View Classes and is part of Qt's model/view framework.
QTreeView implements the interfaces defined by the QAbstractItemView class to allow it to display data provided by models derived from the QAbstractItemModel class.
It is simple to construct a tree view displaying data from a model. In the following example, the contents of a directory are supplied by a QDirModel and displayed as a tree:
QDirModel *model = new QDirModel; QTreeView *tree = new QTreeView(splitter); tree->setModel(model);
The model/view architecture ensures that the contents of the tree view are updated as the model changes.
Items that have children can be in an expanded (children are visible) or collapsed (children are hidden) state. When this state changes a collapsed or expanded signal is emitted with the model index of the relevant item.
The amount of indentation used to indicate levels of hierarchy is controlled by the indentation property.
Headers in tree views are constructed using the QHeaderView class and can be hidden using header->hide. Note that each header is configured with its stretchLastSection property set to true, ensuring that the view does not waste any of the space assigned to it for its header.
QTreeView supports a set of key bindings that enable the user to navigate in the view and interact with the contents of items:
Key | Action |
---|---|
UpArrow | Moves the cursor to the item in the same column on the previous row. If the parent of the current item has no more rows to navigate to, the cursor moves to the relevant item in the last row of the sibling that precedes the parent. |
DownArrow | Moves the cursor to the item in the same column on the next row. If the parent of the current item has no more rows to navigate to, the cursor moves to the relevant item in the first row of the sibling that follows the parent. |
LeftArrow | Hides the children of the current item (if present) by collapsing a branch. |
Minus | Same as LeftArrow. |
RightArrow | Reveals the children of the current item (if present) by expanding a branch. |
Plus | Same as RightArrow. |
Asterisk | Expands all children of the current item (if present). |
PageUp | Moves the cursor up one page. |
PageDown | Moves the cursor down one page. |
Home | Moves the cursor to an item in the same column of the first row of the first top-level item in the model. |
End | Moves the cursor to an item in the same column of the last row of the last top-level item in the model. |
F2 | In editable models, this opens the current item for editing. The Escape key can be used to cancel the editing process and revert any changes to the data displayed. |
![]() | ![]() | ![]() |
A Windows XP style tree view. | A Macintosh style tree view. | A Plastique style tree view. |
It is possible to give the view hints about the data it is handling in order to improve its performance when displaying large numbers of items. One approach that can be taken for views that are intended to display items with equal heights is to set the uniformRowHeights property to true.
View Example
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QAbstractItemView |
---|
QAbstractItemView.CursorAction, QAbstractItemView.DragDropMode, QAbstractItemView.DropIndicatorPosition, QAbstractItemView.EditTrigger, QAbstractItemView.EditTriggers, QAbstractItemView.ScrollHint, QAbstractItemView.ScrollMode, QAbstractItemView.SelectionBehavior, QAbstractItemView.SelectionMode, QAbstractItemView.State |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QFrame |
---|
QFrame.Shadow, QFrame.Shape, QFrame.StyleMask |
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1<A>, QSignalEmitter.Signal2<A,B>, QSignalEmitter.Signal3<A,B,C>, QSignalEmitter.Signal4<A,B,C,D>, QSignalEmitter.Signal5<A,B,C,D,E>, QSignalEmitter.Signal6<A,B,C,D,E,F>, QSignalEmitter.Signal7<A,B,C,D,E,F,G>, QSignalEmitter.Signal8<A,B,C,D,E,F,G,H>, QSignalEmitter.Signal9<A,B,C,D,E,F,G,H,I> |
Field Summary | |
---|---|
QSignalEmitter.Signal1<QModelIndex> |
collapsed
This signal is emitted when the item specified by index is collapsed. |
QSignalEmitter.Signal1<QModelIndex> |
expanded
This signal is emitted when the item specified by index is expanded. |
Fields inherited from class com.trolltech.qt.gui.QAbstractItemView |
---|
activated, clicked, doubleClicked, entered, pressed, viewportEntered |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QTreeView()
Equivalent to QTreeView(0). |
|
QTreeView(QWidget parent)
Constructs a table view with a parent to represent a model's data. |
Method Summary | |
---|---|
boolean |
allColumnsShowFocus()
Returns whether items should show keyboard focus using all columns. |
int |
autoExpandDelay()
Returns The delay time before items in a tree are opened during a drag and drop operation.. |
void |
collapse(QModelIndex index)
Collapses the model item specified by the index. |
void |
collapseAll()
Collapses all expanded items. |
int |
columnAt(int x)
Returns the column in the tree view whose header covers the x coordinate given. |
protected void |
columnCountChanged(int oldCount,
int newCount)
Informs the tree view that the number of columns in the tree view has changed from oldCount to newCount. |
protected void |
columnMoved()
This slot is called whenever a column has been moved. |
protected void |
columnResized(int column,
int oldSize,
int newSize)
This function is called whenever column's size is changed in the header. |
int |
columnViewportPosition(int column)
Returns the horizontal position of the column in the viewport. |
int |
columnWidth(int column)
Returns the width of the column. |
protected void |
currentChanged(QModelIndex current,
QModelIndex previous)
This function is reimplemented for internal reasons. |
protected void |
dataChanged(QModelIndex topLeft,
QModelIndex bottomRight)
This function is reimplemented for internal reasons. |
void |
doItemsLayout()
This function is reimplemented for internal reasons. |
protected void |
dragMoveEvent(QDragMoveEvent event)
This function is reimplemented for internal reasons. |
protected void |
drawBranches(QPainter painter,
QRect rect,
QModelIndex index)
Draws the branches in the tree view on the same row as the model item index, using the painter given. |
protected void |
drawRow(QPainter painter,
QStyleOptionViewItem options,
QModelIndex index)
Draws the row in the tree view that contains the model item index, using the painter given. |
protected void |
drawTree(QPainter painter,
QRegion region)
Draws the part of the tree intersecting the given region using the specified painter. |
void |
expand(QModelIndex index)
Expands the model item specified by the index. |
void |
expandAll()
Expands all expandable items. |
void |
expandToDepth(int depth)
Expands all expandable items to the given depth. |
static QTreeView |
fromNativePointer(QNativePointer nativePointer)
This function returns the QTreeView instance pointed to by nativePointer |
QHeaderView |
header()
Returns the header for the tree view. |
void |
hideColumn(int column)
Hides the column given. |
protected int |
horizontalOffset()
Returns the horizontal offset of the items in the treeview. |
protected void |
horizontalScrollbarAction(int action)
This function is reimplemented for internal reasons. |
int |
indentation()
Returns indentation of the items in the tree view.. |
QModelIndex |
indexAbove(QModelIndex index)
Returns the model index of the item above index. |
QModelIndex |
indexAt(QPoint p)
This function is reimplemented for internal reasons. |
QModelIndex |
indexBelow(QModelIndex index)
Returns the model index of the item below index. |
protected int |
indexRowSizeHint(QModelIndex index)
Returns the size hint for the row indicated by index. |
boolean |
isAnimated()
Returns whether animations are enabled. |
boolean |
isColumnHidden(int column)
Returns true if the column is hidden; otherwise returns false. |
boolean |
isExpanded(QModelIndex index)
Returns true if the model item index is expanded; otherwise returns false. |
boolean |
isFirstColumnSpanned(int row,
QModelIndex parent)
Returns true if the item in first column in the given row of the parent is spanning all the columns; otherwise returns false. |
protected boolean |
isIndexHidden(QModelIndex index)
This function is reimplemented for internal reasons. |
boolean |
isRowHidden(int row,
QModelIndex parent)
Returns true if the item in the given row of the parent is hidden; otherwise returns false. |
boolean |
isSortingEnabled()
Returns whether sorting is enabled. |
boolean |
itemsExpandable()
Returns whether the items are expandable by the user.. |
void |
keyboardSearch(java.lang.String search)
This function is reimplemented for internal reasons. |
protected void |
keyPressEvent(QKeyEvent event)
This function is reimplemented for internal reasons. |
protected void |
mouseDoubleClickEvent(QMouseEvent event)
This function is reimplemented for internal reasons. |
protected void |
mouseMoveEvent(QMouseEvent event)
This function is reimplemented for internal reasons. |
protected void |
mousePressEvent(QMouseEvent event)
This function is reimplemented for internal reasons. |
protected void |
mouseReleaseEvent(QMouseEvent event)
This function is reimplemented for internal reasons. |
protected QModelIndex |
moveCursor(QAbstractItemView.CursorAction cursorAction,
Qt.KeyboardModifiers modifiers)
Move the cursor in the way described by cursorAction, using the information provided by the button modifiers. |
protected void |
paintEvent(QPaintEvent event)
This function is reimplemented for internal reasons. |
protected void |
reexpand()
|
void |
reset()
This function is reimplemented for internal reasons. |
void |
resizeColumnToContents(int column)
Resizes the column given to the size of its contents. |
boolean |
rootIsDecorated()
Returns whether to show controls for expanding and collapsing top-level items. |
protected int |
rowHeight(QModelIndex index)
Returns the height of the row indicated by the given index. |
protected void |
rowsAboutToBeRemoved(QModelIndex parent,
int start,
int end)
Informs the view that the rows from the start row to the end row inclusive are about to removed from the given parent model item. |
protected void |
rowsInserted(QModelIndex parent,
int start,
int end)
Informs the view that the rows from the start row to the end row inclusive have been inserted into the parent model item. |
protected void |
rowsRemoved(QModelIndex parent,
int first,
int last)
Informs the view that the rows from the first row to the last row inclusive have been removed from the given parent model item. |
protected void |
scrollContentsBy(int dx,
int dy)
Scrolls the contents of the tree view by (dx, dy). |
void |
scrollTo(QModelIndex index,
QAbstractItemView.ScrollHint hint)
Scroll the contents of the tree view until the given model item index is visible. |
void |
selectAll()
Selects all the items in the underlying model. |
protected java.util.List<QModelIndex> |
selectedIndexes()
This function is reimplemented for internal reasons. |
protected void |
selectionChanged(QItemSelection selected,
QItemSelection deselected)
This function is reimplemented for internal reasons. |
void |
setAllColumnsShowFocus(boolean enable)
Sets whether items should show keyboard focus using all columns to enable. |
void |
setAnimated(boolean enable)
Sets whether animations are enabled to enable. |
void |
setAutoExpandDelay(int delay)
Sets The delay time before items in a tree are opened during a drag and drop operation. |
void |
setColumnHidden(int column,
boolean hide)
If hide is true the column is hidden, otherwise the column is shown. |
void |
setColumnWidth(int column,
int width)
Sets the width of the given column to the width specified. |
void |
setExpanded(QModelIndex index,
boolean expand)
Sets the item referred to by index to either collapse or expanded, depending on the value of expand. |
void |
setFirstColumnSpanned(int row,
QModelIndex parent,
boolean span)
If span is true the item in the first column in the row with the given parent is set to span all columns, otherwise all items on the row are shown. |
void |
setHeader(QHeaderView header)
Sets the header for the tree view, to the given header. |
void |
setIndentation(int i)
Sets indentation of the items in the tree view. |
void |
setItemsExpandable(boolean enable)
Sets whether the items are expandable by the user. |
void |
setModel(QAbstractItemModel model)
This function is reimplemented for internal reasons. |
void |
setRootIndex(QModelIndex index)
This function is reimplemented for internal reasons. |
void |
setRootIsDecorated(boolean show)
Sets whether to show controls for expanding and collapsing top-level items to show. |
void |
setRowHidden(int row,
QModelIndex parent,
boolean hide)
If hide is true the row with the given parent is hidden, otherwise the row is shown. |
protected void |
setSelection(QRect rect,
QItemSelectionModel.SelectionFlags command)
Applies the selection command to the items in or touched by the rectangle, rect. |
void |
setSelectionModel(QItemSelectionModel selectionModel)
This function is reimplemented for internal reasons. |
void |
setSortingEnabled(boolean enable)
Sets whether sorting is enabled to enable. |
void |
setUniformRowHeights(boolean uniform)
Sets whether all items in the treeview have the same height to uniform. |
void |
setWordWrap(boolean on)
Sets the item text word-wrapping policy to on. |
void |
showColumn(int column)
Shows the given column in the tree view. |
int |
sizeHintForColumn(int column)
Returns the size hint for the column's width or -1 if there is no model. |
void |
sortByColumn(int column,
Qt.SortOrder order)
Sets the model up for sorting by the values in the given column and order. |
protected void |
timerEvent(QTimerEvent event)
This function is reimplemented for internal reasons. |
boolean |
uniformRowHeights()
Returns whether all items in the treeview have the same height. |
protected void |
updateGeometries()
This function is reimplemented for internal reasons. |
protected int |
verticalOffset()
Returns the vertical offset of the items in the tree view. |
protected boolean |
viewportEvent(QEvent event)
This function is reimplemented for internal reasons. |
QRect |
visualRect(QModelIndex index)
Returns the rectangle on the viewport occupied by the item at index. |
protected QRegion |
visualRegionForSelection(QItemSelection selection)
Returns the rectangle from the viewport of the items in the given selection. |
boolean |
wordWrap()
Returns the item text word-wrapping policy. |
Methods inherited from class com.trolltech.qt.gui.QFrame |
---|
changeEvent, drawFrame, frameRect, frameShadow, frameShape, frameStyle, frameWidth, lineWidth, midLineWidth, setFrameRect, setFrameShadow, setFrameShape, setFrameStyle, setLineWidth, setMidLineWidth |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
blockSignals, childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, property, removeEventFilter, setObjectName, setParent, setProperty, signalsBlocked, startTimer, thread |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
disconnect, disconnect, signalSender |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1<QModelIndex> collapsed
This signal is emitted when the item specified by index is collapsed.
public final QSignalEmitter.Signal1<QModelIndex> expanded
This signal is emitted when the item specified by index is expanded.
Constructor Detail |
---|
public QTreeView()
Equivalent to QTreeView(0).
public QTreeView(QWidget parent)
Constructs a table view with a parent to represent a model's data. Use setModel to set the model.
Method Detail |
---|
public final boolean allColumnsShowFocus()
Returns whether items should show keyboard focus using all columns.
If this property is true all columns will show focus, otherwise only one column will show focus.
The default is false.
public final int autoExpandDelay()
Returns The delay time before items in a tree are opened during a drag and drop operation..
This property holds the amount of time in milliseconds that the user must wait over a node before that node will automatically open or close. If the time is set to less then 0 then it will not be activated.
public final void collapse(QModelIndex index)
Collapses the model item specified by the index.
public final void collapseAll()
Collapses all expanded items.
public final int columnAt(int x)
Returns the column in the tree view whose header covers the x coordinate given.
protected final void columnCountChanged(int oldCount, int newCount)
Informs the tree view that the number of columns in the tree view has changed from oldCount to newCount.
protected final void columnMoved()
This slot is called whenever a column has been moved.
protected final void columnResized(int column, int oldSize, int newSize)
This function is called whenever column's size is changed in the header. oldSize and newSize give the previous size and the new size in pixels.
public final int columnViewportPosition(int column)
Returns the horizontal position of the column in the viewport.
public final int columnWidth(int column)
Returns the width of the column.
protected final void drawTree(QPainter painter, QRegion region)
Draws the part of the tree intersecting the given region using the specified painter.
public final void expand(QModelIndex index)
Expands the model item specified by the index.
public final void expandAll()
Expands all expandable items.
Warning: if the model contains a large number of items, this function will be take time to execute.
public final void expandToDepth(int depth)
Expands all expandable items to the given depth.
public final QHeaderView header()
Returns the header for the tree view.
public final void hideColumn(int column)
Hides the column given.
Note: This function should only be called after the model has been initialized, as the view needs to know the number of columns in order to hide column.
public final int indentation()
Returns indentation of the items in the tree view..
This property holds the indentation measured in pixels of the items for each level in the tree view. For top-level items, the indentation specifies the horizontal distance from the viewport edge to the items in the first column; for child items, it specifies their indentation from their parent items.
public final QModelIndex indexAbove(QModelIndex index)
Returns the model index of the item above index.
public final QModelIndex indexBelow(QModelIndex index)
Returns the model index of the item below index.
protected final int indexRowSizeHint(QModelIndex index)
Returns the size hint for the row indicated by index.
public final boolean isAnimated()
Returns whether animations are enabled.
If this property is true the treeview will animate expandsion and collasping of branches. If this property is false, the treeview will expand or collapse branches immediately without showing the animation.
public final boolean isColumnHidden(int column)
Returns true if the column is hidden; otherwise returns false.
public final boolean isExpanded(QModelIndex index)
Returns true if the model item index is expanded; otherwise returns false.
public final boolean isFirstColumnSpanned(int row, QModelIndex parent)
Returns true if the item in first column in the given row of the parent is spanning all the columns; otherwise returns false.
public final boolean isRowHidden(int row, QModelIndex parent)
Returns true if the item in the given row of the parent is hidden; otherwise returns false.
public final boolean isSortingEnabled()
Returns whether sorting is enabled.
If this property is true, sorting is enabled for the tree; if the property is false, sorting is not enabled. The default value is false.
public final boolean itemsExpandable()
Returns whether the items are expandable by the user..
This property holds whether the user can expand and collapse items interactively.
protected final void reexpand()
public final void resizeColumnToContents(int column)
Resizes the column given to the size of its contents.
public final boolean rootIsDecorated()
Returns whether to show controls for expanding and collapsing top-level items.
Items with children are typically shown with controls to expand and collapse them, allowing their children to be shown or hidden. If this property is false, these controls are not shown for top-level items. This can be used to make a single level tree structure appear like a simple list of items.
By default, this property is true.
protected final int rowHeight(QModelIndex index)
Returns the height of the row indicated by the given index.
protected final void rowsRemoved(QModelIndex parent, int first, int last)
Informs the view that the rows from the first row to the last row inclusive have been removed from the given parent model item.
public final void setAllColumnsShowFocus(boolean enable)
Sets whether items should show keyboard focus using all columns to enable.
If this property is true all columns will show focus, otherwise only one column will show focus.
The default is false.
public final void setAnimated(boolean enable)
Sets whether animations are enabled to enable.
If this property is true the treeview will animate expandsion and collasping of branches. If this property is false, the treeview will expand or collapse branches immediately without showing the animation.
public final void setAutoExpandDelay(int delay)
Sets The delay time before items in a tree are opened during a drag and drop operation. to delay.
This property holds the amount of time in milliseconds that the user must wait over a node before that node will automatically open or close. If the time is set to less then 0 then it will not be activated.
public final void setColumnHidden(int column, boolean hide)
If hide is true the column is hidden, otherwise the column is shown.
public final void setColumnWidth(int column, int width)
Sets the width of the given column to the width specified.
public final void setExpanded(QModelIndex index, boolean expand)
Sets the item referred to by index to either collapse or expanded, depending on the value of expand.
public final void setFirstColumnSpanned(int row, QModelIndex parent, boolean span)
If span is true the item in the first column in the row with the given parent is set to span all columns, otherwise all items on the row are shown.
public final void setHeader(QHeaderView header)
Sets the header for the tree view, to the given header.
The view takes ownership over the given header and deletes it when a new header is set.
public final void setIndentation(int i)
Sets indentation of the items in the tree view. to i.
This property holds the indentation measured in pixels of the items for each level in the tree view. For top-level items, the indentation specifies the horizontal distance from the viewport edge to the items in the first column; for child items, it specifies their indentation from their parent items.
public final void setItemsExpandable(boolean enable)
Sets whether the items are expandable by the user. to enable.
This property holds whether the user can expand and collapse items interactively.
public final void setRootIsDecorated(boolean show)
Sets whether to show controls for expanding and collapsing top-level items to show.
Items with children are typically shown with controls to expand and collapse them, allowing their children to be shown or hidden. If this property is false, these controls are not shown for top-level items. This can be used to make a single level tree structure appear like a simple list of items.
By default, this property is true.
public final void setRowHidden(int row, QModelIndex parent, boolean hide)
If hide is true the row with the given parent is hidden, otherwise the row is shown.
public final void setSortingEnabled(boolean enable)
Sets whether sorting is enabled to enable.
If this property is true, sorting is enabled for the tree; if the property is false, sorting is not enabled. The default value is false.
public final void setUniformRowHeights(boolean uniform)
Sets whether all items in the treeview have the same height to uniform.
This property should only be set to true if it is guaranteed that all items in the view has the same height. This enables the view to do some optimizations.
The height is obtained from the first item in the view. It is updated when the data changes on that item.
public final void setWordWrap(boolean on)
Sets the item text word-wrapping policy to on.
If this property is true then the item text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. This property is false by default.
public final void showColumn(int column)
Shows the given column in the tree view.
public final void sortByColumn(int column, Qt.SortOrder order)
Sets the model up for sorting by the values in the given column and order.
public final boolean uniformRowHeights()
Returns whether all items in the treeview have the same height.
This property should only be set to true if it is guaranteed that all items in the view has the same height. This enables the view to do some optimizations.
The height is obtained from the first item in the view. It is updated when the data changes on that item.
public final boolean wordWrap()
Returns the item text word-wrapping policy.
If this property is true then the item text is wrapped where necessary at word-breaks; otherwise it is not wrapped at all. This property is false by default.
protected void currentChanged(QModelIndex current, QModelIndex previous)
This function is reimplemented for internal reasons.
currentChanged
in class QAbstractItemView
protected void dataChanged(QModelIndex topLeft, QModelIndex bottomRight)
This function is reimplemented for internal reasons.
dataChanged
in class QAbstractItemView
public void doItemsLayout()
This function is reimplemented for internal reasons.
doItemsLayout
in class QAbstractItemView
protected void dragMoveEvent(QDragMoveEvent event)
This function is reimplemented for internal reasons.
dragMoveEvent
in class QAbstractItemView
protected void drawBranches(QPainter painter, QRect rect, QModelIndex index)
Draws the branches in the tree view on the same row as the model item index, using the painter given. The branches are drawn in the rectangle specified by rect.
protected void drawRow(QPainter painter, QStyleOptionViewItem options, QModelIndex index)
Draws the row in the tree view that contains the model item index, using the painter given. The options control how the item is displayed.
protected int horizontalOffset()
Returns the horizontal offset of the items in the treeview.
Note that the tree view uses the horizontal header section positions to determine the positions of columns in the view.
horizontalOffset
in class QAbstractItemView
protected void horizontalScrollbarAction(int action)
This function is reimplemented for internal reasons.
horizontalScrollbarAction
in class QAbstractItemView
public QModelIndex indexAt(QPoint p)
This function is reimplemented for internal reasons.
indexAt
in class QAbstractItemView
protected boolean isIndexHidden(QModelIndex index)
This function is reimplemented for internal reasons.
isIndexHidden
in class QAbstractItemView
protected void keyPressEvent(QKeyEvent event)
This function is reimplemented for internal reasons.
keyPressEvent
in class QAbstractItemView
public void keyboardSearch(java.lang.String search)
This function is reimplemented for internal reasons.
keyboardSearch
in class QAbstractItemView
protected void mouseDoubleClickEvent(QMouseEvent event)
This function is reimplemented for internal reasons.
mouseDoubleClickEvent
in class QAbstractItemView
protected void mouseMoveEvent(QMouseEvent event)
This function is reimplemented for internal reasons.
mouseMoveEvent
in class QAbstractItemView
protected void mousePressEvent(QMouseEvent event)
This function is reimplemented for internal reasons.
mousePressEvent
in class QAbstractItemView
protected void mouseReleaseEvent(QMouseEvent event)
This function is reimplemented for internal reasons.
mouseReleaseEvent
in class QAbstractItemView
protected QModelIndex moveCursor(QAbstractItemView.CursorAction cursorAction, Qt.KeyboardModifiers modifiers)
Move the cursor in the way described by cursorAction, using the information provided by the button modifiers.
moveCursor
in class QAbstractItemView
protected void paintEvent(QPaintEvent event)
This function is reimplemented for internal reasons.
paintEvent
in class QAbstractScrollArea
public void reset()
This function is reimplemented for internal reasons.
reset
in class QAbstractItemView
protected void rowsAboutToBeRemoved(QModelIndex parent, int start, int end)
Informs the view that the rows from the start row to the end row inclusive are about to removed from the given parent model item.
rowsAboutToBeRemoved
in class QAbstractItemView
protected void rowsInserted(QModelIndex parent, int start, int end)
Informs the view that the rows from the start row to the end row inclusive have been inserted into the parent model item.
rowsInserted
in class QAbstractItemView
protected void scrollContentsBy(int dx, int dy)
Scrolls the contents of the tree view by (dx, dy).
scrollContentsBy
in class QAbstractScrollArea
public void scrollTo(QModelIndex index, QAbstractItemView.ScrollHint hint)
Scroll the contents of the tree view until the given model item index is visible. The hint parameter specifies more precisely where the item should be located after the operation. If any of the parents of the model item are collapsed, they will be expanded to ensure that the model item is visible.
scrollTo
in class QAbstractItemView
public void selectAll()
Selects all the items in the underlying model.
selectAll
in class QAbstractItemView
protected java.util.List<QModelIndex> selectedIndexes()
This function is reimplemented for internal reasons.
selectedIndexes
in class QAbstractItemView
protected void selectionChanged(QItemSelection selected, QItemSelection deselected)
This function is reimplemented for internal reasons.
selectionChanged
in class QAbstractItemView
public void setModel(QAbstractItemModel model)
This function is reimplemented for internal reasons.
setModel
in class QAbstractItemView
public void setRootIndex(QModelIndex index)
This function is reimplemented for internal reasons.
setRootIndex
in class QAbstractItemView
protected void setSelection(QRect rect, QItemSelectionModel.SelectionFlags command)
Applies the selection command to the items in or touched by the rectangle, rect.
setSelection
in class QAbstractItemView
public void setSelectionModel(QItemSelectionModel selectionModel)
This function is reimplemented for internal reasons.
setSelectionModel
in class QAbstractItemView
public int sizeHintForColumn(int column)
Returns the size hint for the column's width or -1 if there is no model.
If you need to set the width of a given column to a fixed value, call QHeaderView::resizeSection() on the view's header.
If you reimplement this function in a subclass, note that the value you return is only used when resizeColumnToContents is called. In that case, if a larger column width is required by either the view's header or the item delegate, that width will be used instead.
sizeHintForColumn
in class QAbstractItemView
protected void timerEvent(QTimerEvent event)
This function is reimplemented for internal reasons.
timerEvent
in class QAbstractItemView
protected void updateGeometries()
This function is reimplemented for internal reasons.
updateGeometries
in class QAbstractItemView
protected int verticalOffset()
Returns the vertical offset of the items in the tree view.
verticalOffset
in class QAbstractItemView
protected boolean viewportEvent(QEvent event)
This function is reimplemented for internal reasons.
viewportEvent
in class QAbstractItemView
public QRect visualRect(QModelIndex index)
Returns the rectangle on the viewport occupied by the item at index. If the index is not visible or explicitly hidden, the returned rectangle is invalid.
visualRect
in class QAbstractItemView
protected QRegion visualRegionForSelection(QItemSelection selection)
Returns the rectangle from the viewport of the items in the given selection.
visualRegionForSelection
in class QAbstractItemView
public static QTreeView fromNativePointer(QNativePointer nativePointer)
nativePointer
- the QNativePointer of which object should be returned.
|
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |