Convert features.effects to QT_[REQUIRE_]CONFIG

Change-Id: I8421b5e81dc21e8f9f6bdd9f714fb3f535618a3c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-08-27 19:11:58 +02:00
parent 8a93f50695
commit 6380729c48
7 changed files with 27 additions and 20 deletions

View File

@ -80,7 +80,8 @@
"effects": {
"label": "Effects",
"purpose": "Provides special widget effects (e.g. fading and scrolling).",
"section": "Kernel"
"section": "Kernel",
"output": [ "privateFeature" ]
},
"filesystemmodel": {
"label": "QFileSystemModel",

View File

@ -40,6 +40,8 @@
# include <private/qcore_mac_p.h>
#endif
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qevent.h>
@ -48,7 +50,9 @@
#include <qstyleoption.h>
#include <qstylepainter.h>
#include <qtimer.h>
#if QT_CONFIG(effects)
#include <private/qeffects_p.h>
#endif
#include <qtextdocument.h>
#include <qdebug.h>
#include <private/qstylesheetstyle_p.h>
@ -285,7 +289,7 @@ void QTipLabel::timerEvent(QTimerEvent *e)
|| e->timerId() == expireTimer.timerId()){
hideTimer.stop();
expireTimer.stop();
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && !defined(QT_NO_EFFECTS)
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(effects)
if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip)){
// Fade out tip on mac (makes it invisible).
// The tip will not be deleted until a new tip is shown.
@ -505,7 +509,7 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons
QTipLabel::instance->setObjectName(QLatin1String("qtooltip_label"));
#if !defined(QT_NO_EFFECTS) && !0 /* Used to be included in Qt4 for Q_WS_MAC */
#if QT_CONFIG(effects) && !0 /* Used to be included in Qt4 for Q_WS_MAC */
if (QApplication::isEffectEnabled(Qt::UI_FadeTooltip))
qFadeEffect(QTipLabel::instance);
else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip))

View File

@ -70,12 +70,12 @@
#include <private/qabstractscrollarea_p.h>
#include <private/qlineedit_p.h>
#include <qdebug.h>
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && !defined(QT_NO_EFFECTS) && QT_CONFIG(style_mac)
#if 0 /* Used to be included in Qt4 for Q_WS_MAC */ && QT_CONFIG(effetcts) && QT_CONFIG(style_mac)
#include <private/qcore_mac_p.h>
#include <private/qmacstyle_mac_p.h>
#include <private/qt_cocoa_helpers_mac_p.h>
#endif
#ifndef QT_NO_EFFECTS
#if QT_CONFIG(effects)
# include <private/qeffects_p.h>
#endif
#ifndef QT_NO_ACCESSIBILITY
@ -2731,7 +2731,7 @@ void QComboBox::showPopup()
const bool updatesEnabled = container->updatesEnabled();
#endif
#if !defined(QT_NO_EFFECTS)
#if QT_CONFIG(effects)
bool scrollDown = (listRect.topLeft() == below);
if (QApplication::isEffectEnabled(Qt::UI_AnimateCombo)
&& !style->styleHint(QStyle::SH_ComboBox_Popup, &opt, this) && !window()->testAttribute(Qt::WA_DontShowOnScreen))
@ -2803,7 +2803,7 @@ void QComboBox::hidePopup()
{
Q_D(QComboBox);
if (d->container && d->container->isVisible()) {
#if !defined(QT_NO_EFFECTS)
#if QT_CONFIG(effects)
QSignalBlocker modelBlocker(d->model);
QSignalBlocker viewBlocker(d->container->itemView());
QSignalBlocker containerBlocker(d->container);
@ -2847,7 +2847,7 @@ void QComboBox::hidePopup()
modelBlocker.unblock();
if (!didFade)
#endif // QT_NO_EFFECTS
#endif // QT_CONFIG(effects)
// Fade should implicitly hide as well ;-)
d->container->hide();
}

View File

@ -38,7 +38,6 @@
****************************************************************************/
#include "qapplication.h"
#ifndef QT_NO_EFFECTS
#include "qdesktopwidget.h"
#include "qeffects_p.h"
#include "qevent.h"
@ -605,5 +604,3 @@ QT_END_NAMESPACE
*/
#include "qeffects.moc"
#endif //QT_NO_EFFECTS

View File

@ -53,8 +53,9 @@
//
#include "QtCore/qnamespace.h"
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#ifndef QT_NO_EFFECTS
QT_REQUIRE_CONFIG(effects);
QT_BEGIN_NAMESPACE
@ -77,6 +78,4 @@ extern void Q_WIDGETS_EXPORT qFadeEffect(QWidget*, int time = -1);
QT_END_NAMESPACE
#endif // QT_NO_EFFECTS
#endif // QEFFECTS_P_H

View File

@ -41,6 +41,8 @@
#ifndef QT_NO_MENU
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qdebug.h"
#include "qstyle.h"
#include "qevent.h"
@ -56,7 +58,7 @@
#ifndef QT_NO_ACCESSIBILITY
# include "qaccessible.h"
#endif
#ifndef QT_NO_EFFECTS
#if QT_CONFIG(effects)
# include <private/qeffects_p.h>
#endif
#if QT_CONFIG(whatsthis)
@ -517,7 +519,7 @@ void QMenuPrivate::hideMenu(QMenu *menu)
{
if (!menu)
return;
#if !defined(QT_NO_EFFECTS)
#if QT_CONFIG(effects)
QSignalBlocker blocker(menu);
aboutToHide = true;
// Flash item which is about to trigger (if any).
@ -539,7 +541,7 @@ void QMenuPrivate::hideMenu(QMenu *menu)
aboutToHide = false;
blocker.unblock();
#endif // QT_NO_EFFECTS
#endif // QT_CONFIG(effects)
if (activeMenu == menu)
activeMenu = 0;
menu->d_func()->causedPopup.action = 0;
@ -670,7 +672,7 @@ void QMenuPrivate::setCurrentAction(QAction *action, int popup, SelectionReason
}
if (hideActiveMenu && previousAction != currentAction) {
if (popup == -1) {
#ifndef QT_NO_EFFECTS
#if QT_CONFIG(effects)
// kill any running effect
qFadeEffect(0);
qScrollEffect(0);
@ -2475,7 +2477,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
}
}
setGeometry(QRect(pos, size));
#ifndef QT_NO_EFFECTS
#if QT_CONFIG(effects)
int hGuess = isRightToLeft() ? QEffects::LeftScroll : QEffects::RightScroll;
int vGuess = QEffects::DownScroll;
if (isRightToLeft()) {

View File

@ -38,7 +38,6 @@ HEADERS += \
SOURCES += \
widgets/qbuttongroup.cpp \
widgets/qabstractspinbox.cpp \
widgets/qeffects.cpp \
widgets/qframe.cpp \
widgets/qlineedit_p.cpp \
widgets/qlineedit.cpp \
@ -133,6 +132,11 @@ qtConfig(dockwidget) {
widgets/qdockarealayout.cpp
}
qtConfig(effects) {
HEADERS += widgets/qeffects_p.h
SOURCES += widgets/qeffects.cpp
}
qtConfig(fontcombobox) {
HEADERS += widgets/qfontcombobox.h
SOURCES += widgets/qfontcombobox.cpp