Ignore:
Timestamp:
May 5, 2011, 5:36:53 AM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/widgets/qabstractslider.cpp

    r769 r846  
    11/****************************************************************************
    22**
    3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
    44** All rights reserved.
    55** Contact: Nokia Corporation (qt-info@nokia.com)
     
    220220      , isAutoRepeating(false)
    221221      , repeatMultiplier(1)
    222 #endif
    223 {
     222{
     223    firstRepeat.invalidate();
     224#else
     225{
     226#endif
     227
    224228}
    225229
     
    713717
    714718        offset_accumulated += stepsToScrollF;
     719#ifndef Q_WS_MAC
     720        // Don't scroll more than one page in any case:
    715721        stepsToScroll = qBound(-pageStep, int(offset_accumulated), pageStep);
     722#else
     723        // Native UI-elements on Mac can scroll hundreds of lines at a time as
     724        // a result of acceleration. So keep the same behaviour in Qt, and
     725        // don't restrict stepsToScroll to certain maximum (pageStep):
     726        stepsToScroll = int(offset_accumulated);
     727#endif
    716728        offset_accumulated -= int(offset_accumulated);
    717729        if (stepsToScroll == 0)
     
    757769#ifdef QT_KEYPAD_NAVIGATION
    758770    if (ev->isAutoRepeat()) {
    759         if (d->firstRepeat.isNull())
    760             d->firstRepeat = QTime::currentTime();
     771        if (!d->firstRepeat.isValid())
     772            d->firstRepeat.start();
    761773        else if (1 == d->repeatMultiplier) {
    762774            // This is the interval in milli seconds which one key repetition
    763775            // takes.
    764             const int repeatMSecs = d->firstRepeat.msecsTo(QTime::currentTime());
     776            const int repeatMSecs = d->firstRepeat.elapsed();
    765777
    766778            /**
     
    780792
    781793    }
    782     else if (!d->firstRepeat.isNull()) {
    783         d->firstRepeat = QTime();
     794    else if (d->firstRepeat.isValid()) {
     795        d->firstRepeat.invalidate();
    784796        d->repeatMultiplier = 1;
    785797    }
Note: See TracChangeset for help on using the changeset viewer.