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/styles | |
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/styles')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qcommonstyle.h | 2 | ||||
-rw-r--r-- | src/widgets/styles/qcommonstyle_p.h | 9 | ||||
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 12 | ||||
-rw-r--r-- | src/widgets/styles/qstyleanimation.cpp | 4 | ||||
-rw-r--r-- | src/widgets/styles/qstyleanimation_p.h | 6 | ||||
-rw-r--r-- | src/widgets/styles/qstylesheetstyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsstyle.cpp | 2 | ||||
-rw-r--r-- | src/widgets/styles/styles.pri | 7 |
9 files changed, 26 insertions, 22 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index b9943533ee..0821c6af59 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -108,7 +108,9 @@ #include <qsettings.h> #include <qvariant.h> #include <qpixmapcache.h> +#if QT_CONFIG(animation) #include <private/qstyleanimation_p.h> +#endif #include <limits.h> @@ -1196,7 +1198,7 @@ void QCommonStylePrivate::tabLayout(const QStyleOptionTab *opt, const QWidget *w } #endif // QT_CONFIG(tabbar) -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) /*! \internal */ QList<const QObject*> QCommonStylePrivate::animationTargets() const { diff --git a/src/widgets/styles/qcommonstyle.h b/src/widgets/styles/qcommonstyle.h index f39915295e..78c5171717 100644 --- a/src/widgets/styles/qcommonstyle.h +++ b/src/widgets/styles/qcommonstyle.h @@ -97,7 +97,7 @@ protected: private: Q_DECLARE_PRIVATE(QCommonStyle) Q_DISABLE_COPY(QCommonStyle) -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) Q_PRIVATE_SLOT(d_func(), void _q_removeAnimation()) #endif }; diff --git a/src/widgets/styles/qcommonstyle_p.h b/src/widgets/styles/qcommonstyle_p.h index 93db75ac2d..b347c8563a 100644 --- a/src/widgets/styles/qcommonstyle_p.h +++ b/src/widgets/styles/qcommonstyle_p.h @@ -43,8 +43,9 @@ #include <QtWidgets/private/qtwidgetsglobal_p.h> #include "qcommonstyle.h" #include "qstyle_p.h" +#if QT_CONFIG(animation) #include "qstyleanimation_p.h" - +#endif #include "qstyleoption.h" QT_BEGIN_NAMESPACE @@ -76,7 +77,7 @@ public: ~QCommonStylePrivate() { -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) qDeleteAll(animations); #endif #if QT_CONFIG(itemviews) @@ -115,7 +116,7 @@ public: #endif int animationFps; -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) void _q_removeAnimation(); QList<const QObject*> animationTargets() const; @@ -125,7 +126,7 @@ public: private: mutable QHash<const QObject*, QStyleAnimation*> animations; -#endif // QT_NO_ANIMATION +#endif // animation }; QT_END_NAMESPACE diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 7474cd23d6..5231f04df9 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -1429,14 +1429,14 @@ void QFusionStyle::drawControl(ControlElement element, const QStyleOption *optio painter->drawRoundedRect(progressBar.adjusted(1, 1, -1, -1), 1, 1); if (!indeterminate) { -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) (const_cast<QFusionStylePrivate*>(d))->stopAnimation(option->styleObject); #endif } else { highlightedGradientStartColor.setAlpha(120); painter->setPen(QPen(highlightedGradientStartColor, 9.0)); painter->setClipRect(progressBar.adjusted(1, 1, -1, -1)); -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) if (QProgressStyleAnimation *animation = qobject_cast<QProgressStyleAnimation*>(d->animation(option->styleObject))) step = animation->animationStep() % 22; else @@ -2463,7 +2463,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption styleObject->setProperty("_q_stylestate", static_cast<QStyle::State::Int>(scrollBar->state)); styleObject->setProperty("_q_stylecontrols", static_cast<uint>(scrollBar->activeSubControls)); -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) // if the scrollbar is transient or its attributes, geometry or // state has changed, the opacity is reset back to 100% opaque opacity = 1.0; @@ -2481,10 +2481,10 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption } else if (anim && anim->mode() == QScrollbarStyleAnimation::Deactivating) { d->stopAnimation(styleObject); } -#endif // !QT_NO_ANIMATION +#endif // animation } -#ifndef QT_NO_ANIMATION +#if QT_CONFIG(animation) QScrollbarStyleAnimation *anim = qobject_cast<QScrollbarStyleAnimation *>(d->animation(styleObject)); if (anim && anim->mode() == QScrollbarStyleAnimation::Deactivating) { // once a scrollbar was active (hovered/pressed), it retains @@ -2513,7 +2513,7 @@ void QFusionStyle::drawComplexControl(ComplexControl control, const QStyleOption } } painter->setOpacity(opacity); -#endif // !QT_NO_ANIMATION +#endif // animation } bool transient = proxy()->styleHint(SH_ScrollBar_Transient, option, widget); diff --git a/src/widgets/styles/qstyleanimation.cpp b/src/widgets/styles/qstyleanimation.cpp index 0b8e32be19..b9202eae69 100644 --- a/src/widgets/styles/qstyleanimation.cpp +++ b/src/widgets/styles/qstyleanimation.cpp @@ -39,8 +39,6 @@ #include "qstyleanimation_p.h" -#ifndef QT_NO_ANIMATION - #include <qcoreapplication.h> #include <qwidget.h> #include <qevent.h> @@ -367,5 +365,3 @@ void QScrollbarStyleAnimation::updateCurrentTime(int time) QT_END_NAMESPACE #include "moc_qstyleanimation_p.cpp" - -#endif //QT_NO_ANIMATION diff --git a/src/widgets/styles/qstyleanimation_p.h b/src/widgets/styles/qstyleanimation_p.h index a2ad4a91da..d28fc6ebab 100644 --- a/src/widgets/styles/qstyleanimation_p.h +++ b/src/widgets/styles/qstyleanimation_p.h @@ -45,9 +45,9 @@ #include "qdatetime.h" #include "qimage.h" -QT_BEGIN_NAMESPACE +QT_REQUIRE_CONFIG(animation); -#ifndef QT_NO_ANIMATION +QT_BEGIN_NAMESPACE // // W A R N I N G @@ -201,8 +201,6 @@ private: bool _active; }; -#endif // QT_NO_ANIMATION - QT_END_NAMESPACE #endif // QSTYLEANIMATION_P_H diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index f2af8aee32..6cfb65a800 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -85,7 +85,9 @@ #include <qheaderview.h> #endif #include <private/qwindowsstyle_p_p.h> +#if QT_CONFIG(animation) #include <private/qstyleanimation_p.h> +#endif #if QT_CONFIG(tabbar) #include <qtabbar.h> #endif diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp index 611de6991f..12ca5201c1 100644 --- a/src/widgets/styles/qwindowsstyle.cpp +++ b/src/widgets/styles/qwindowsstyle.cpp @@ -86,7 +86,9 @@ #include <private/qhighdpiscaling_p.h> #include <private/qstylehelper_p.h> +#if QT_CONFIG(animation) #include <private/qstyleanimation_p.h> +#endif #include <algorithm> diff --git a/src/widgets/styles/styles.pri b/src/widgets/styles/styles.pri index 0c0f8b7bc7..821c40af81 100644 --- a/src/widgets/styles/styles.pri +++ b/src/widgets/styles/styles.pri @@ -3,7 +3,6 @@ HEADERS += \ styles/qdrawutil.h \ styles/qstyle.h \ - styles/qstyleanimation_p.h \ styles/qstylefactory.h \ styles/qstyleoption.h \ styles/qstyleplugin.h \ @@ -21,7 +20,6 @@ HEADERS += \ SOURCES += \ styles/qdrawutil.cpp \ styles/qstyle.cpp \ - styles/qstyleanimation.cpp \ styles/qstylefactory.cpp \ styles/qstyleoption.cpp \ styles/qstyleplugin.cpp \ @@ -37,6 +35,11 @@ RESOURCES += styles/qstyle.qrc include($$OUT_PWD/qtwidgets-config.pri) +qtConfig(animation) { + HEADERS += styles/qstyleanimation_p.h + SOURCES += styles/qstyleanimation.cpp +} + qtConfig(style-windows) { HEADERS += styles/qwindowsstyle_p.h styles/qwindowsstyle_p_p.h SOURCES += styles/qwindowsstyle.cpp |