56 #include "private/qabstractitemview_p.h" 57 #include <QtCore/qvariantanimation.h> 58 #include <QtCore/qabstractitemmodel.h> 60 #ifndef QT_NO_TREEVIEW 88 header(0), indent(20), lastViewedItem(0), defaultItemHeight(-1),
89 uniformRowHeights(false), rootDecoration(true),
90 itemsExpandable(true), sortingEnabled(false),
91 expandsOnDoubleClick(true),
92 allColumnsShowFocus(false), current(0),
spanning(false),
93 animationsEnabled(false), columnResizeTimerID(0),
94 autoExpandDelay(-1), hoverBranch(-1), geometryRecursionBlock(false), hasRemovedItems(false) {}
102 #ifndef QT_NO_ANIMATION 110 int top()
const {
return startValue().toInt(); }
116 void beginAnimatedOperation();
117 void drawAnimatedOperation(
QPainter *painter)
const;
118 QPixmap renderTreeToPixmapForAnimation(
const QRect &rect)
const;
119 void _q_endAnimatedOperation();
120 #endif //QT_NO_ANIMATION 122 void expand(
int item,
bool emitSignal);
123 void collapse(
int item,
bool emitSignal);
125 void _q_columnsAboutToBeRemoved(
const QModelIndex &,
int,
int);
126 void _q_columnsRemoved(
const QModelIndex &,
int,
int);
127 void _q_modelAboutToBeReset();
128 void _q_sortIndicatorChanged(
int column,
Qt::SortOrder order);
129 void _q_modelDestroyed();
131 void layout(
int item,
bool recusiveExpanding =
false,
bool afterIsUninitialized =
false);
133 int pageUp(
int item)
const;
134 int pageDown(
int item)
const;
136 int itemHeight(
int item)
const;
137 int indentationForItem(
int item)
const;
138 int coordinateForItem(
int item)
const;
139 int itemAtCoordinate(
int coordinate)
const;
142 QModelIndex modelIndex(
int i,
int column = 0)
const;
144 void insertViewItems(
int pos,
int count,
const QTreeViewItem &viewItem);
145 void removeViewItems(
int pos,
int count);
147 bool checkViewItems()
const;
150 int firstVisibleItem(
int *offset = 0)
const;
151 int columnAt(
int x)
const;
152 bool hasVisibleChildren(
const QModelIndex& parent)
const;
154 bool expandOrCollapseItemAtPos(
const QPoint &pos);
156 void updateScrollBars();
158 int itemDecorationAt(
const QPoint &pos)
const;
167 void updateChildCount(
const int parentItem,
const int delta);
200 expandedIndexes.
insert(idx);
206 return isPersistent(idx) && expandedIndexes.
contains(idx);
214 return isPersistent(idx) && hiddenIndexes.
contains(idx);
218 if (i < 0 || i >= viewItems.
count())
221 return isRowHidden(index) || !isIndexEnabled(index);
225 {
int i = item;
while (isItemHiddenOrDisabled(--item)){}
return item < 0 ? i : item; }
227 {
int i = item;
while (isItemHiddenOrDisabled(++item)){}
return item >= viewItems.
count() ? i : item; }
229 { viewItems[item].height = 0; }
232 return (viewIndex(index) + (header ? 1 : 0)) * model->columnCount()+index.
column() + 1;
258 #endif // QT_NO_TREEVIEW 260 #endif // QTREEVIEW_P_H The QVariant class acts like a union for the most common Qt data types.
The QPainter class performs low-level painting on widgets and other paint devices.
#define QT_END_NAMESPACE
This macro expands to.
bool isItemHiddenOrDisabled(int i) const
int count(const T &t) const
Returns the number of occurrences of value in the vector.
QSet< QPersistentModelIndex > expandedIndexes
The QStyleOptionViewItemV4 class is used to describe the parameters necessary for drawing a frame in ...
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
QVector< QPersistentModelIndex > spanningIndexes
void updateState(State state, State)
Q_CORE_EXPORT QTextStream & right(QTextStream &s)
bool isIndexExpanded(const QModelIndex &idx) const
#define QT_BEGIN_NAMESPACE
This macro expands to.
Direction
This enum describes the direction of the animation when in Running state.
bool contains(const T &value) const
The QVariantAnimation class provides an abstract base class for animations.
The QTreeView class provides a default model/view implementation of a tree view.
void updateCurrentValue(const QVariant &)
This pure virtual function is called every time the animation's current value changes.
const_iterator insert(const T &value)
QPair< int, int > leftAndRight
QList< int > columnsToUpdate
The State element defines configurations of objects and properties.
int above(int item) const
const T & at(int i) const
Returns the item at index position i in the vector.
void invalidateHeightCache(int item) const
bool isRowHidden(const QModelIndex &idx) const
QSet< QPersistentModelIndex > hiddenIndexes
#define Q_DECLARE_PUBLIC(Class)
The QPersistentModelIndex class is used to locate data in a data model.
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.
bool storeExpanded(const QPersistentModelIndex &idx)
QVector< QTreeViewItem > viewItems
bool expandsOnDoubleClick
The QPixmap class is an off-screen image representation that can be used as a paint device...
The QBasicTimer class provides timer events for objects.
int accessibleTable2Index(const QModelIndex &index) const
int below(int item) const
Q_DECLARE_TYPEINFO(QTreeViewItem, Q_MOVABLE_TYPE)
void moveTop(int pos)
Moves the rectangle vertically, leaving the rectangle's top edge at the given y coordinate.
Q_CORE_EXPORT QTextStream & left(QTextStream &s)
int column() const
Returns the column this model index refers to.
The QList class is a template class that provides lists.
bool geometryRecursionBlock