Changeset 769 for trunk/src/gui/itemviews/qtableview.cpp
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/src/gui/itemviews/qtableview.cpp
r651 r769 115 115 } else if (old_height > span->height()) { 116 116 //remove the span from all the subspans lists that intersect the columns not covered anymore 117 Index::iterator it_y = index.lowerBound(-span->bottom()); 118 if (it_y == index.end()) 119 it_y = index.find(-span->top()); // This is the only span remaining and we are deleting it. 117 Index::iterator it_y = index.lowerBound(-qMax(span->bottom(), span->top())); //qMax usefull if height is 0 120 118 Q_ASSERT(it_y != index.end()); //it_y must exist since the span is in the list 121 119 while (-it_y.key() <= span->top() + old_height -1) { 122 120 if (-it_y.key() > span->bottom()) { 123 (*it_y).remove(-span->left()); 121 int removed = (*it_y).remove(-span->left()); 122 Q_ASSERT(removed == 1); Q_UNUSED(removed); 124 123 if (it_y->isEmpty()) { 125 it_y = index.erase(it_y) - 1;124 it_y = index.erase(it_y); 126 125 } 127 126 } … … 1909 1908 } 1910 1909 } else { // nothing moved 1910 const int gridAdjust = showGrid() ? 1 : 0; 1911 1911 for (int i = 0; i < selection.count(); ++i) { 1912 1912 QItemSelectionRange range = selection.at(i); … … 1917 1917 const int rtop = rowViewportPosition(range.top()); 1918 1918 const int rbottom = rowViewportPosition(range.bottom()) + rowHeight(range.bottom()); 1919 const int rleft = columnViewportPosition(range.left()); 1920 const int rright = columnViewportPosition(range.right()) + columnWidth(range.right()); 1921 selectionRegion += QRect(QPoint(rleft, rtop), QPoint(rright, rbottom)); 1919 int rleft; 1920 int rright; 1921 if (isLeftToRight()) { 1922 rleft = columnViewportPosition(range.left()); 1923 rright = columnViewportPosition(range.right()) + columnWidth(range.right()); 1924 } else { 1925 rleft = columnViewportPosition(range.right()); 1926 rright = columnViewportPosition(range.left()) + columnWidth(range.left()); 1927 } 1928 selectionRegion += QRect(QPoint(rleft, rtop), QPoint(rright - 1 - gridAdjust, rbottom - 1 - gridAdjust)); 1922 1929 if (d->hasSpans()) { 1923 1930 foreach (QSpanCollection::Span *s, … … 2547 2554 if (!d->isIndexValid(index) 2548 2555 || (d->model->parent(index) != d->root) 2549 || is IndexHidden(index))2556 || isRowHidden(index.row()) || isColumnHidden(index.column())) 2550 2557 return; 2551 2558
Note:
See TracChangeset
for help on using the changeset viewer.