summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2015-01-09 13:59:35 +0900
committerSlávek Banko <slavek.banko@axis.cz>2015-12-15 19:54:03 +0100
commite2922dd2085a78f85ae8f71073cb0d1d5638c032 (patch)
tree3cc24d72c936042294f44fabdc97f8ea6c62257e
parentf7fcc6acb722277e11e813d3ce97ee9f01679921 (diff)
downloadqt3-e2922dd2085a78f85ae8f71073cb0d1d5638c032.tar.gz
qt3-e2922dd2085a78f85ae8f71073cb0d1d5638c032.zip
Fixed Multicolumn view filtering item arrangement. This relates to bug 146.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it> (cherry picked from commit 9655b0b845a568b61437a9354e98eae9623b7d13)
-rw-r--r--src/iconview/qiconview.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/iconview/qiconview.cpp b/src/iconview/qiconview.cpp
index 0a1f8df..141658c 100644
--- a/src/iconview/qiconview.cpp
+++ b/src/iconview/qiconview.cpp
@@ -2342,14 +2342,15 @@ void QIconViewItem::checkRect()
When an item is inserted the QIconView allocates a position for it.
Existing items are rearranged if autoArrange() is TRUE. The
- default arrangement is \c LeftToRight -- the QIconView fills up
- the \e left-most column from top to bottom, then moves one column
- \e right and fills that from top to bottom and so on. The
+ default arrangement is \c LeftToRight -- the QIconView fills
+ the \e top-most row from left to right, then moves one row \e down
+ and fills that row from left to right and so on. The
arrangement can be modified with any of the following approaches:
\list
- \i Call setArrangement(), e.g. with \c TopToBottom which will fill
- the \e top-most row from left to right, then moves one row \e down
- and fills that row from left to right and so on.
+ \i Call setArrangement(), e.g. with \c TopToBottom which will fill up
+ the \e left-most column from top to bottom, then moves one column
+ \e right and fills that from top to bottom and so on.
+
\i Construct each QIconViewItem using a constructor which allows
you to specify which item the new one is to follow.
\i Call setSorting() or sort() to sort the items.
@@ -6035,7 +6036,7 @@ QIconViewItem *QIconView::makeRowLayout( QIconViewItem *begin, int &y, bool &cha
}
- } else { // -------------------------------- SOUTH ------------------------------
+ } else { // -------------------------------- TopToBottom ------------------------------
int x = y;
@@ -6070,6 +6071,7 @@ QIconViewItem *QIconView::makeRowLayout( QIconViewItem *begin, int &y, bool &cha
// now move the items
item = begin;
+ QIconViewItem *prevVisibleItem = NULL;
for (;;) {
item->dirty = FALSE;
if ( d->itemTextPos == Bottom ) {
@@ -6077,15 +6079,16 @@ QIconViewItem *QIconView::makeRowLayout( QIconViewItem *begin, int &y, bool &cha
changed = item->move( x + ( w - item->width() ) / 2, d->spacing ) || changed;
else
changed = item->move( x + ( w - item->width() ) / 2,
- item->prev->y() + item->prev->height() + d->spacing ) || changed;
+ prevVisibleItem->y() + prevVisibleItem->height() + d->spacing ) || changed;
} else {
if ( item == begin )
changed = item->move( x, d->spacing ) || changed;
else
- changed = item->move( x, item->prev->y() + item->prev->height() + d->spacing ) || changed;
+ changed = item->move( x, prevVisibleItem->y() + prevVisibleItem->height() + d->spacing ) || changed;
}
if ( item == end )
break;
+ prevVisibleItem = item;
item = item->next;
while (item && (item->isVisible() == FALSE)) {
item = item->next;