mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 19:02:59 +00:00
QTreeViewItem cleanup
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
133b048e6d
commit
d927b344d7
2 changed files with 11 additions and 11 deletions
|
@ -1789,9 +1789,9 @@ void QTreeView::drawBranches(QPainter *painter, const QRect &rect,
|
|||
} else {
|
||||
int successor = item + viewItem.total + 1;
|
||||
while (successor < d->viewItems.size()
|
||||
&& d->viewItems.at(successor).level >= uint(level)) {
|
||||
&& d->viewItems.at(successor).level >= level) {
|
||||
const QTreeViewItem &successorItem = d->viewItems.at(successor);
|
||||
if (successorItem.level == uint(level)) {
|
||||
if (successorItem.level == level) {
|
||||
moreSiblings = true;
|
||||
break;
|
||||
}
|
||||
|
@ -2614,7 +2614,7 @@ void QTreeView::expandToDepth(int depth)
|
|||
d->interruptDelayedItemsLayout();
|
||||
d->layout(-1);
|
||||
for (int i = 0; i < d->viewItems.count(); ++i) {
|
||||
if (d->viewItems.at(i).level <= (uint)depth) {
|
||||
if (d->viewItems.at(i).level <= depth) {
|
||||
d->viewItems[i].expanded = true;
|
||||
d->layout(i);
|
||||
d->storeExpanded(d->viewItems.at(i).index);
|
||||
|
@ -3119,7 +3119,7 @@ void QTreeViewPrivate::layout(int i, bool recursiveExpanding, bool afterIsUninit
|
|||
}
|
||||
viewItems.resize(count);
|
||||
afterIsUninitialized = true;
|
||||
} else if (viewItems[i].total != (uint)count) {
|
||||
} else if (viewItems[i].total != count) {
|
||||
if (!afterIsUninitialized)
|
||||
insertViewItems(i + 1, count, QTreeViewItem()); // expand
|
||||
else if (count > 0)
|
||||
|
|
|
@ -59,13 +59,13 @@ struct QTreeViewItem
|
|||
hasMoreSiblings(false), total(0), level(0), height(0) {}
|
||||
QModelIndex index; // we remove items whenever the indexes are invalidated
|
||||
int parentItem; // parent item index in viewItems
|
||||
uint expanded : 1;
|
||||
uint spanning : 1;
|
||||
uint hasChildren : 1; // if the item has visible children (even if collapsed)
|
||||
uint hasMoreSiblings : 1;
|
||||
uint total : 28; // total number of children visible
|
||||
uint level : 16; // indentation
|
||||
int height : 16; // row height
|
||||
bool expanded;
|
||||
bool spanning;
|
||||
bool hasChildren; // if the item has visible children (even if collapsed)
|
||||
bool hasMoreSiblings;
|
||||
int total; // total number of children visible
|
||||
int level; // indentation
|
||||
int height; // row height
|
||||
};
|
||||
|
||||
Q_DECLARE_TYPEINFO(QTreeViewItem, Q_MOVABLE_TYPE);
|
||||
|
|
Loading…
Add table
Reference in a new issue