Ignore:
Timestamp:
Mar 8, 2010, 12:52:58 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.2 sources.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/itemviews/qtreeview.cpp

    r561 r651  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    179179
    180180/*!
    181     Constructs a table view with a \a parent to represent a model's
     181    Constructs a tree view with a \a parent to represent a model's
    182182    data. Use setModel() to set the model.
    183183
     
    12401240                viewport()->update(oldRect);
    12411241                viewport()->update(newRect);
    1242             }
    1243         }
    1244         if (selectionBehavior() == QAbstractItemView::SelectRows) {
    1245             QModelIndex newHoverIndex = indexAt(he->pos());
    1246             if (d->hover != newHoverIndex) {
    1247                 QRect oldHoverRect = visualRect(d->hover);
    1248                 QRect newHoverRect = visualRect(newHoverIndex);
    1249                 viewport()->update(QRect(0, newHoverRect.y(), viewport()->width(), newHoverRect.height()));
    1250                 viewport()->update(QRect(0, oldHoverRect.y(), viewport()->width(), oldHoverRect.height()));
    12511242            }
    12521243        }
     
    26452636    SelectionMode mode = d->selectionMode;
    26462637    d->executePostedLayout(); //make sure we lay out the items
    2647     if (mode != SingleSelection && !d->viewItems.isEmpty())
    2648         d->select(d->viewItems.first().index, d->viewItems.last().index,
     2638    if (mode != SingleSelection && !d->viewItems.isEmpty()) {
     2639        const QModelIndex &idx = d->viewItems.last().index;
     2640        QModelIndex lastItemIndex = idx.sibling(idx.row(), d->model->columnCount(idx.parent()) - 1);
     2641        d->select(d->viewItems.first().index, lastItemIndex,
    26492642                  QItemSelectionModel::ClearAndSelect
    26502643                  |QItemSelectionModel::Rows);
     2644    }
    26512645}
    26522646
     
    30653059    Q_Q(const QTreeView);
    30663060    QPixmap pixmap(rect.size());
     3061    if (rect.size().isEmpty())
     3062        return pixmap;
    30673063    pixmap.fill(Qt::transparent); //the base might not be opaque, and we don't want uninitialized pixels.
    30683064    QPainter painter(&pixmap);
Note: See TracChangeset for help on using the changeset viewer.