Example #1
0
    void smoothScrollTo(const QModelIndex& index)
    {
        if (!index.isValid()) {
            return;
        }

        const QRect rect = q->visualRect(index);

        int oldValue = scrollBar()->value();
        int newValue = scrollToValue(rect);
        if (mTimeLine->state() == QTimeLine::Running) {
            mTimeLine->stop();
        }
        mTimeLine->setFrameRange(oldValue, newValue);
        mTimeLine->start();
    }
Example #2
0
 void startTimeLine()
 {
     if (mOpacityTimeLine->state() != QTimeLine::Running) {
         mOpacityTimeLine->start();
     }
 }
Example #3
0
 void startTimeLine()
 {
     if (mTimeLine->state() != QTimeLine::Running) {
         mTimeLine->start();
     }
 }