summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-04-10 04:07:12 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-04-10 04:07:12 (GMT)
commitf64ad3687c428644139690d565fe555ed2199aea (patch)
tree71254975baa06a8ebae38bd41c315fd16f050efb /src/gui/itemviews
parent7690bab57ef7ae6d669c6df23e9de72fd8a85d62 (diff)
parentf9d26f506b30dcdb1fc50c824f20455756d67cc4 (diff)
downloadQt-f64ad3687c428644139690d565fe555ed2199aea.zip
Qt-f64ad3687c428644139690d565fe555ed2199aea.tar.gz
Qt-f64ad3687c428644139690d565fe555ed2199aea.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: (27 commits) Fix the doc for QFrame::frameStyle Don't use texture-from-pixmap if the target isn't GL_TEXTURE_2D Add runtime check for GLX >= 1.3 before using glXCreatePixmap QDrawHelper: Reduce code duplications Improve matching X11 VisualIDs to EGL configs Remove obsolete function set_winapp_name() Speedup fetchTransformedBilinear in the fast_matrix case Allow y-interted pixmaps for brushes in GL2 paint engine Build fix for mingw Fix build with mingw (64 bit) Make configure.exe compatible with mingw 64 Adjust indentation e-Ink support cleanup Tweak the display update IOCTL calls Support 8-Track e-Ink devices Get stride from LinuxFB instead of calculating it ourselves. Use DIR_SEPARATOR when setting up variables for RCC and UIC in features. Fixed bug in QPainterPath::intersected(). Fix compile error with QT_NO_ANIMATION O(n^2) to O(n) optimization in QTreeWidget::selectedItems() ...
Diffstat (limited to 'src/gui/itemviews')
-rw-r--r--src/gui/itemviews/qtreeview.cpp4
-rw-r--r--src/gui/itemviews/qtreewidget.cpp6
2 files changed, 9 insertions, 1 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp
index d934683..c3ff2bd 100644
--- a/src/gui/itemviews/qtreeview.cpp
+++ b/src/gui/itemviews/qtreeview.cpp
@@ -3194,12 +3194,16 @@ void QTreeViewPrivate::layout(int i, bool recursiveExpanding, bool afterIsUninit
int QTreeViewPrivate::pageUp(int i) const
{
int index = itemAtCoordinate(coordinateForItem(i) - viewport->height());
+ while (isItemHiddenOrDisabled(index))
+ index--;
return index == -1 ? 0 : index;
}
int QTreeViewPrivate::pageDown(int i) const
{
int index = itemAtCoordinate(coordinateForItem(i) + viewport->height());
+ while (isItemHiddenOrDisabled(index))
+ index++;
return index == -1 ? viewItems.count() - 1 : index;
}
diff --git a/src/gui/itemviews/qtreewidget.cpp b/src/gui/itemviews/qtreewidget.cpp
index 19ed10b..4c80325 100644
--- a/src/gui/itemviews/qtreewidget.cpp
+++ b/src/gui/itemviews/qtreewidget.cpp
@@ -3039,10 +3039,14 @@ QList<QTreeWidgetItem*> QTreeWidget::selectedItems() const
Q_D(const QTreeWidget);
QModelIndexList indexes = selectionModel()->selectedIndexes();
QList<QTreeWidgetItem*> items;
+ items.reserve(indexes.count());
+ QSet<QTreeWidgetItem *> seen;
+ seen.reserve(indexes.count());
for (int i = 0; i < indexes.count(); ++i) {
QTreeWidgetItem *item = d->item(indexes.at(i));
- if (isItemHidden(item) || items.contains(item)) // ### slow, optimize later
+ if (isItemHidden(item) || seen.contains(item))
continue;
+ seen.insert(item);
items.append(item);
}
return items;