diff options
author | Liang Qi <liang.qi@qt.io> | 2018-09-26 15:39:35 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-10-12 14:26:15 +0000 |
commit | c593492d1678a2ec08f1bfffcb572459b3bc6c00 (patch) | |
tree | a9427b13e0f3aa252d68decc862de5acb4dc3b17 /src/widgets/itemviews/qcolumnview.cpp | |
parent | 0509383cf2852f2aebd1efd75413835747c8f341 (diff) |
Modernize the "animation" feature
Change-Id: Ibc164b3df3cf87db569ef4813de458a9067b7f7d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/widgets/itemviews/qcolumnview.cpp')
-rw-r--r-- | src/widgets/itemviews/qcolumnview.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/widgets/itemviews/qcolumnview.cpp b/src/widgets/itemviews/qcolumnview.cpp index 5100d2a427..1fe17721ba 100644 --- a/src/widgets/itemviews/qcolumnview.cpp +++ b/src/widgets/itemviews/qcolumnview.cpp @@ -103,12 +103,12 @@ void QColumnViewPrivate::initialize() { Q_Q(QColumnView); q->setTextElideMode(Qt::ElideMiddle); -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) QObject::connect(¤tAnimation, SIGNAL(finished()), q, SLOT(_q_changeCurrentColumn())); currentAnimation.setTargetObject(hbar); currentAnimation.setPropertyName("value"); currentAnimation.setEasingCurve(QEasingCurve::InOutQuad); -#endif //QT_NO_ANIMATION +#endif // animation delete itemDelegate; q->setItemDelegate(new QColumnViewDelegate(q)); } @@ -258,12 +258,12 @@ void QColumnView::scrollTo(const QModelIndex &index, ScrollHint hint) if (!index.isValid() || d->columns.isEmpty()) return; -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) if (d->currentAnimation.state() == QPropertyAnimation::Running) return; d->currentAnimation.stop(); -#endif //QT_NO_ANIMATION +#endif // animation // Fill up what is needed to get to index d->closeColumns(index, true); @@ -326,13 +326,13 @@ void QColumnView::scrollTo(const QModelIndex &index, ScrollHint hint) } } -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) if (const int animationDuration = style()->styleHint(QStyle::SH_Widget_Animation_Duration, 0, this)) { d->currentAnimation.setDuration(animationDuration); d->currentAnimation.setEndValue(newScrollbarValue); d->currentAnimation.start(); } else -#endif //QT_NO_ANIMATION +#endif // animation { horizontalScrollBar()->setValue(newScrollbarValue); } @@ -402,10 +402,10 @@ void QColumnView::resizeEvent(QResizeEvent *event) void QColumnViewPrivate::updateScrollbars() { Q_Q(QColumnView); -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) if (currentAnimation.state() == QPropertyAnimation::Running) return; -#endif //QT_NO_ANIMATION +#endif // animation // find the total horizontal length of the laid out columns int horizontalLength = 0; |