diff options
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 78 |
1 files changed, 17 insertions, 61 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index d671496..f53705b 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -7,29 +7,29 @@ ** This file is part of the QtGui module of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** ** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception +** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. ** +** Other Usage +** Alternatively, this file may be used in accordance with the terms and +** conditions contained in a signed written agreement between you and Nokia. ** ** ** @@ -62,9 +62,6 @@ #include <qaccessible.h> #endif #include <private/qsoftkeymanager_p.h> -#ifndef QT_NO_GESTURE -# include <qscroller.h> -#endif QT_BEGIN_NAMESPACE @@ -194,40 +191,6 @@ void QAbstractItemViewPrivate::checkMouseMove(const QPersistentModelIndex &index } } -#ifndef QT_NO_GESTURES - -// stores and restores the selection and current item when flicking -void QAbstractItemViewPrivate::_q_scrollerStateChanged() -{ - Q_Q(QAbstractItemView); - - if (QScroller *scroller = QScroller::scroller(viewport)) { - switch (scroller->state()) { - case QScroller::Pressed: - // store the current selection in case we start scrolling - if (q->selectionModel()) { - oldSelection = q->selectionModel()->selection(); - oldCurrent = q->selectionModel()->currentIndex(); - } - break; - - case QScroller::Dragging: - // restore the old selection if we really start scrolling - if (q->selectionModel()) { - q->selectionModel()->select(oldSelection, QItemSelectionModel::ClearAndSelect); - q->selectionModel()->setCurrentIndex(oldCurrent, QItemSelectionModel::NoUpdate); - } - // fall through - - default: - oldSelection = QItemSelection(); - oldCurrent = QModelIndex(); - break; - } - } -} - -#endif // QT_NO_GESTURES /*! \class QAbstractItemView @@ -1662,13 +1625,6 @@ bool QAbstractItemView::viewportEvent(QEvent *event) case QEvent::WindowDeactivate: d->viewport->update(); break; - case QEvent::ScrollPrepare: - executeDelayedItemsLayout(); -#ifndef QT_NO_GESTURES - connect(QScroller::scroller(d->viewport), SIGNAL(stateChanged(QScroller::State)), this, SLOT(_q_scrollerStateChanged()), Qt::UniqueConnection); -#endif - break; - default: break; } |