diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2011-02-25 14:52:08 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2011-02-25 14:52:08 (GMT) |
commit | c0f415bdea15c7382800829bd5f5683aa7cd99ec (patch) | |
tree | 852c0af9773d4fb40651fe0b140941dd1c5d4fce /src/gui/itemviews/qtreeview.cpp | |
parent | ad365cf942e339271706554ac86319d99538bad9 (diff) | |
parent | 184398f4ada4b34fc9834c2341597a3b8c18e842 (diff) | |
download | Qt-c0f415bdea15c7382800829bd5f5683aa7cd99ec.zip Qt-c0f415bdea15c7382800829bd5f5683aa7cd99ec.tar.gz Qt-c0f415bdea15c7382800829bd5f5683aa7cd99ec.tar.bz2 |
Merge branch 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration into master-integration
* 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (60 commits)
Fix QTBUG-17627: build break in mobility bearer applications
Add the missing image for doc of QNetworkSession.
Remove Qt dependancy to SYMBIAN_GRAPHICS_WSERV_QT_EFFECTS
Fix QPlainTextEdit corruption/crash with scrolling
DelayRemove of list delegate on section boundary duplicated section
add gsm to connectable bearer for networkmanager.
ListView and GridView indexAt should use qreal coordinates.
Prevent infinite loop in raster engine on zero dash pattern length.
Cocoa: Sheets looses focus when moving parent window
Removing tabs from 7388fcb83592a90aace054314e0c3e7e7a94fdae changeset
Fix QNetworkConfigurationManager crash due to null private pointer.
Fix animations with alwaysRunToEnd that are frequently stopped/started.
Fix auto test failure on mac.
Update QtGui def files
Another stab at fixing compilation on old Symbian platforms
Prevent an animation from being registered to run twice.
Add missing test file.
Add selected P1 tasks to changes file.
Added support for QMAKE_CLEAN in symbian-sbsv2
Only add NetworkServices capability automatically if no caps are set.
...
Diffstat (limited to 'src/gui/itemviews/qtreeview.cpp')
-rw-r--r-- | src/gui/itemviews/qtreeview.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/gui/itemviews/qtreeview.cpp b/src/gui/itemviews/qtreeview.cpp index d03babb..21c9d3b 100644 --- a/src/gui/itemviews/qtreeview.cpp +++ b/src/gui/itemviews/qtreeview.cpp @@ -2744,6 +2744,7 @@ int QTreeView::indexRowSizeHint(const QModelIndex &index) const int start = -1; int end = -1; + int indexRow = index.row(); int count = d->header->count(); bool emptyHeader = (count == 0); QModelIndex parent = index.parent(); @@ -2780,7 +2781,7 @@ int QTreeView::indexRowSizeHint(const QModelIndex &index) const int logicalColumn = emptyHeader ? column : d->header->logicalIndex(column); if (d->header->isSectionHidden(logicalColumn)) continue; - QModelIndex idx = d->model->index(index.row(), logicalColumn, parent); + QModelIndex idx = d->model->index(indexRow, logicalColumn, parent); if (idx.isValid()) { QWidget *editor = d->editorForIndex(idx).widget.data(); if (editor && d->persistent.contains(editor)) { @@ -3215,14 +3216,14 @@ int QTreeViewPrivate::itemHeight(int item) const if (viewItems.isEmpty()) return 0; const QModelIndex &index = viewItems.at(item).index; + if (!index.isValid()) + return 0; int height = viewItems.at(item).height; - if (height <= 0 && index.isValid()) { + if (height <= 0) { height = q_func()->indexRowSizeHint(index); viewItems[item].height = height; } - if (!index.isValid() || height < 0) - return 0; - return height; + return qMax(height, 0); } |