45 #include <QtGui/qabstractitemview.h> 53 #ifndef QT_NO_TREEVIEW 84 int autoExpandDelay()
const;
85 void setAutoExpandDelay(
int delay);
87 int indentation()
const;
88 void setIndentation(
int i);
90 bool rootIsDecorated()
const;
91 void setRootIsDecorated(
bool show);
93 bool uniformRowHeights()
const;
94 void setUniformRowHeights(
bool uniform);
96 bool itemsExpandable()
const;
97 void setItemsExpandable(
bool enable);
99 bool expandsOnDoubleClick()
const;
100 void setExpandsOnDoubleClick(
bool enable);
102 int columnViewportPosition(
int column)
const;
103 int columnWidth(
int column)
const;
104 void setColumnWidth(
int column,
int width);
105 int columnAt(
int x)
const;
107 bool isColumnHidden(
int column)
const;
108 void setColumnHidden(
int column,
bool hide);
110 bool isHeaderHidden()
const;
111 void setHeaderHidden(
bool hide);
113 bool isRowHidden(
int row,
const QModelIndex &parent)
const;
114 void setRowHidden(
int row,
const QModelIndex &parent,
bool hide);
116 bool isFirstColumnSpanned(
int row,
const QModelIndex &parent)
const;
117 void setFirstColumnSpanned(
int row,
const QModelIndex &parent,
bool span);
122 void setSortingEnabled(
bool enable);
123 bool isSortingEnabled()
const;
125 void setAnimated(
bool enable);
126 bool isAnimated()
const;
128 void setAllColumnsShowFocus(
bool enable);
129 bool allColumnsShowFocus()
const;
131 void setWordWrap(
bool on);
132 bool wordWrap()
const;
155 void hideColumn(
int column);
156 void showColumn(
int column);
159 void resizeColumnToContents(
int column);
160 void sortByColumn(
int column);
163 void expandToDepth(
int depth);
166 void columnResized(
int column,
int oldSize,
int newSize);
167 void columnCountChanged(
int oldCount,
int newCount);
170 void rowsRemoved(
const QModelIndex &parent,
int first,
int last);
182 void setSelection(
const QRect &rect, QItemSelectionModel::SelectionFlags command);
190 virtual void drawRow(
QPainter *painter,
193 virtual void drawBranches(
QPainter *painter,
202 #ifndef QT_NO_DRAGANDDROP 229 #ifndef QT_NO_ANIMATION 231 #endif //QT_NO_ANIMATION 236 #endif // QT_NO_TREEVIEW 242 #endif // QTREEVIEW_H bool sortingEnabled
whether sorting is enabled
The QPainter class performs low-level painting on widgets and other paint devices.
bool allColumnsShowFocus
whether items should show keyboard focus using all columns
virtual void rowsAboutToBeRemoved(const QModelIndex &parent, int start, int end)
This slot is called when rows are about to be removed.
The QKeyEvent class describes a key event.
The QItemSelectionModel class keeps track of a view's selected items.
bool wordWrap
the item text word-wrapping policy
#define QT_END_NAMESPACE
This macro expands to.
virtual void setSelectionModel(QItemSelectionModel *selectionModel)
Sets the current selection model to the given selectionModel.
void mouseMoveEvent(QMouseEvent *event)
This function is called with the given event when a mouse move event is sent to the widget...
virtual bool isIndexHidden(const QModelIndex &index) const =0
Returns true if the item referred to by the given index is hidden in the view, otherwise returns fals...
virtual QRect visualRect(const QModelIndex &index) const =0
Returns the rectangle on the viewport occupied by the item at index.
void mouseDoubleClickEvent(QMouseEvent *event)
This function is called with the given event when a mouse button is double clicked inside the widget...
bool expandsOnDoubleClick
whether the items can be expanded by double-clicking.
virtual void setRootIndex(const QModelIndex &index)
Sets the root item to the item at the given index.
bool uniformRowHeights
whether all items in the treeview have the same height
void timerEvent(QTimerEvent *event)
This function is called with the given event when a timer event is sent to the widget.
#define Q_DISABLE_COPY(Class)
Disables the use of copy constructors and assignment operators for the given Class.
#define Q_PRIVATE_SLOT(d, signature)
virtual int sizeHintForColumn(int column) const
Returns the width size hint for the specified column or -1 if there is no model.
The QString class provides a Unicode character string.
virtual void doItemsLayout()
This function is intended to lay out the items in the view.
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
bool headerHidden
whether the header is shown or not.
virtual QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers)=0
Returns a QModelIndex object pointing to the next object in the view, based on the given cursorAction...
void dragMoveEvent(QDragMoveEvent *event)
This function is called continuously with the given event during a drag and drop operation over the w...
virtual int verticalOffset() const =0
Returns the vertical offset of the view.
virtual void setModel(QAbstractItemModel *model)
Sets the model for the view to present.
#define QT_BEGIN_NAMESPACE
This macro expands to.
virtual void selectAll()
Selects all items in the view.
virtual void scrollTo(const QModelIndex &index, ScrollHint hint=EnsureVisible)=0
Scrolls the view if necessary to ensure that the item at index is visible.
The QTreeView class provides a default model/view implementation of a tree view.
virtual void currentChanged(const QModelIndex ¤t, const QModelIndex &previous)
This slot is called when a new item becomes the current item.
virtual void reset()
Reset the internal state of the view.
void keyPressEvent(QKeyEvent *event)
This function is called with the given event when a key event is sent to the widget.
The QRegion class specifies a clip region for a painter.
virtual int horizontalOffset() const =0
Returns the horizontal offset of the view.
The QAbstractItemModel class provides the abstract interface for item model classes.
The QMouseEvent class contains parameters that describe a mouse event.
bool animated
whether animations are enabled
bool itemsExpandable
whether the items are expandable by the user.
int autoExpandDelay
The delay time before items in a tree are opened during a drag and drop operation.
virtual void selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)
This slot is called when the selection is changed.
The QAbstractItemView class provides the basic functionality for item view classes.
The QItemSelection class manages information about selected items in a model.
virtual void setSelection(const QRect &rect, QItemSelectionModel::SelectionFlags command)=0
Applies the selection flags to the items in or touched by the rectangle, rect.
The QTimerEvent class contains parameters that describe a timer event.
bool rootIsDecorated
whether to show controls for expanding and collapsing top-level items
virtual QModelIndexList selectedIndexes() const
This convenience function returns a list of all selected and non-hidden item indexes in the view...
The QPoint class defines a point in the plane using integer precision.
The QModelIndex class is used to locate data in a data model.
The QRect class defines a rectangle in the plane using integer precision.
void mouseReleaseEvent(QMouseEvent *event)
This function is called with the given event when a mouse button is released, after a mouse press eve...
virtual void rowsInserted(const QModelIndex &parent, int start, int end)
This slot is called when rows are inserted.
virtual void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
This slot is called when items are changed in the model.
virtual QRegion visualRegionForSelection(const QItemSelection &selection) const =0
Returns the region from the viewport of the items in the given selection.
virtual void updateGeometries()
Updates the geometry of the child widgets of the view.
#define Q_DECLARE_PRIVATE(Class)
CursorAction
This enum describes the different ways to navigate between items,.
The QStyleOptionViewItem class is used to describe the parameters used to draw an item in a view widg...
virtual void horizontalScrollbarAction(int action)
int indentation
indentation of the items in the tree view.
The QPaintEvent class contains event parameters for paint events.
static const KeyPair *const end
The QEvent class is the base class of all event classes.
void mousePressEvent(QMouseEvent *event)
This function is called with the given event when a mouse button is pressed while the cursor is insid...
bool viewportEvent(QEvent *event)
This function is used to handle tool tips, and What's This? mode, if the given event is a QEvent::Too...
virtual QModelIndex indexAt(const QPoint &point) const =0
Returns the model index of the item at the viewport coordinates point.
virtual void keyboardSearch(const QString &search)
Moves to and selects the item best matching the string search.