src/gui/itemviews/qabstractitemview.cpp
branchRCL_3
changeset 4 3b1da2848fc7
parent 3 41300fa6a67c
child 7 3f74d0d4af4c
equal deleted inserted replaced
3:41300fa6a67c 4:3b1da2848fc7
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     7 ** This file is part of the QtGui module of the Qt Toolkit.
     8 **
     8 **
   144 {
   144 {
   145     Q_Q(QAbstractItemView);
   145     Q_Q(QAbstractItemView);
   146     if (hover == index)
   146     if (hover == index)
   147         return;
   147         return;
   148 
   148 
   149     q->update(hover); //update the old one
   149     if (selectionBehavior != QAbstractItemView::SelectRows) {
       
   150         q->update(hover); //update the old one
       
   151         q->update(index); //update the new one
       
   152     } else {
       
   153         QRect oldHoverRect = q->visualRect(hover);
       
   154         QRect newHoverRect = q->visualRect(index);
       
   155         viewport->update(QRect(0, newHoverRect.y(), viewport->width(), newHoverRect.height()));
       
   156         viewport->update(QRect(0, oldHoverRect.y(), viewport->width(), oldHoverRect.height()));
       
   157     }
   150     hover = index;
   158     hover = index;
   151     q->update(hover); //update the new one
       
   152 }
   159 }
   153 
   160 
   154 void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index)
   161 void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index)
   155 {
   162 {
   156     //we take a persistent model index because the model might change by emitting signals
   163     //we take a persistent model index because the model might change by emitting signals