diff options
author | Liang Qi <liang.qi@qt.io> | 2018-10-25 07:21:05 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-10-25 07:21:53 +0200 |
commit | e28e91ae99b8c3859899e04cc9370534c7c7b86d (patch) | |
tree | cca81b1e745be4f25aab78e8e917c2324594e539 /src/widgets/itemviews/qtreeview.cpp | |
parent | 5ea233ca6782eb27adf596515cb66ef3dadc1d5e (diff) | |
parent | ebfad73b4e44fe6db8059200da105b4b87888718 (diff) |
Merge remote-tracking branch 'origin/5.12' into dev
Conflicts:
src/corelib/animation/qpropertyanimation.cpp
src/gui/image/qicon.cpp
tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp
Change-Id: I3698172b7b44ebb487cb38f50fd2c4a9f8a35b21
Diffstat (limited to 'src/widgets/itemviews/qtreeview.cpp')
-rw-r--r-- | src/widgets/itemviews/qtreeview.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index b65cf5af2b..60da0eb6c3 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -1319,12 +1319,12 @@ void QTreeView::paintEvent(QPaintEvent *event) Q_D(QTreeView); d->executePostedLayout(); QPainter painter(viewport()); -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) if (d->isAnimating()) { drawTree(&painter, event->region() - d->animatedOperation.rect()); d->drawAnimatedOperation(&painter); } else -#endif //QT_NO_ANIMATION +#endif // animation { drawTree(&painter, event->region()); #if QT_CONFIG(draganddrop) @@ -3036,10 +3036,10 @@ void QTreeViewPrivate::initialize() header->setStretchLastSection(true); header->setDefaultAlignment(Qt::AlignLeft|Qt::AlignVCenter); q->setHeader(header); -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) animationsEnabled = q->style()->styleHint(QStyle::SH_Widget_Animation_Duration, 0, q) > 0; QObject::connect(&animatedOperation, SIGNAL(finished()), q, SLOT(_q_endAnimatedOperation())); -#endif //QT_NO_ANIMATION +#endif // animation } void QTreeViewPrivate::expand(int item, bool emitSignal) @@ -3052,10 +3052,10 @@ void QTreeViewPrivate::expand(int item, bool emitSignal) if (index.flags() & Qt::ItemNeverHasChildren) return; -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) if (emitSignal && animationsEnabled) prepareAnimatedOperation(item, QVariantAnimation::Forward); -#endif //QT_NO_ANIMATION +#endif // animation //if already animating, stateBeforeAnimation is set to the correct value if (state != QAbstractItemView::AnimatingState) stateBeforeAnimation = state; @@ -3069,10 +3069,10 @@ void QTreeViewPrivate::expand(int item, bool emitSignal) model->fetchMore(index); if (emitSignal) { emit q->expanded(index); -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) if (animationsEnabled) beginAnimatedOperation(); -#endif //QT_NO_ANIMATION +#endif // animation } } @@ -3127,10 +3127,10 @@ void QTreeViewPrivate::collapse(int item, bool emitSignal) if (it == expandedIndexes.end() || viewItems.at(item).expanded == false) return; // nothing to do -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) if (emitSignal && animationsEnabled) prepareAnimatedOperation(item, QVariantAnimation::Backward); -#endif //QT_NO_ANIMATION +#endif // animation //if already animating, stateBeforeAnimation is set to the correct value if (state != QAbstractItemView::AnimatingState) @@ -3148,14 +3148,14 @@ void QTreeViewPrivate::collapse(int item, bool emitSignal) if (emitSignal) { emit q->collapsed(modelIndex); -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) if (animationsEnabled) beginAnimatedOperation(); -#endif //QT_NO_ANIMATION +#endif // animation } } -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) void QTreeViewPrivate::prepareAnimatedOperation(int item, QVariantAnimation::Direction direction) { animatedOperation.item = item; @@ -3260,7 +3260,7 @@ void QTreeViewPrivate::_q_endAnimatedOperation() q->updateGeometries(); viewport->update(); } -#endif //QT_NO_ANIMATION +#endif // animation void QTreeViewPrivate::_q_modelAboutToBeReset() { |