summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qtreeview.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-10-17 10:35:28 +0200
committerLiang Qi <liang.qi@qt.io>2018-10-17 10:35:28 +0200
commitccf26f6a88e116abdf8e53acdc02dbd98a4a8dc4 (patch)
tree40aaca99471edc709d38e6f82153576bad86747f /src/widgets/itemviews/qtreeview.cpp
parent8ff1ae89bfa32c586e3b44b71dfc49d294a3e043 (diff)
parent3eebadc1734463afa469dcd08eab8c5d2557dec6 (diff)
Merge remote-tracking branch 'origin/5.11' into 5.12
Conflicts: src/plugins/platformthemes/platformthemes.pro src/printsupport/kernel/qplatformprintdevice.cpp Change-Id: Iac01729ad954bb1c7af5867d982eb243b2139ee6
Diffstat (limited to 'src/widgets/itemviews/qtreeview.cpp')
-rw-r--r--src/widgets/itemviews/qtreeview.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp
index 779bdf36cf..f3647f656a 100644
--- a/src/widgets/itemviews/qtreeview.cpp
+++ b/src/widgets/itemviews/qtreeview.cpp
@@ -1326,12 +1326,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)
@@ -3049,10 +3049,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)
@@ -3065,10 +3065,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;
@@ -3082,10 +3082,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
}
}
@@ -3140,10 +3140,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)
@@ -3161,14 +3161,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;
@@ -3273,7 +3273,7 @@ void QTreeViewPrivate::_q_endAnimatedOperation()
q->updateGeometries();
viewport->update();
}
-#endif //QT_NO_ANIMATION
+#endif // animation
void QTreeViewPrivate::_q_modelAboutToBeReset()
{