Convert features.scrollarea to QT_[REQUIRE_]CONFIG

Change-Id: Ifc7b0a6b025c282234b4aeaf23daecff8a558236
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
Stephan Binner 2017-08-27 19:10:29 +02:00
parent 135da45318
commit dab49434d8
14 changed files with 37 additions and 39 deletions

View File

@ -60,7 +60,9 @@
#include <qwhatsthis.h>
#endif
#include <QAbstractScrollArea>
#if QT_CONFIG(scrollarea)
#include <QScrollArea>
#endif
#if QT_CONFIG(scrollbar)
#include <QScrollBar>
#endif
@ -388,7 +390,7 @@ QStringList QAccessibleComboBox::keyBindingsForAction(const QString &/*actionNam
#endif // QT_CONFIG(combobox)
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
// ======================= QAccessibleAbstractScrollArea =======================
QAccessibleAbstractScrollArea::QAccessibleAbstractScrollArea(QWidget *widget)
: QAccessibleWidget(widget, QAccessible::Client)
@ -497,7 +499,7 @@ QAccessibleScrollArea::QAccessibleScrollArea(QWidget *widget)
{
Q_ASSERT(qobject_cast<QScrollArea *>(widget));
}
#endif // QT_NO_SCROLLAREA
#endif // QT_CONFIG(scrollarea)
QT_END_NAMESPACE

View File

@ -70,7 +70,7 @@ class QTitleBar;
class QAbstractScrollArea;
class QScrollArea;
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
class QAccessibleAbstractScrollArea : public QAccessibleWidget
{
public:
@ -105,7 +105,7 @@ class QAccessibleScrollArea : public QAccessibleAbstractScrollArea
public:
explicit QAccessibleScrollArea(QWidget *widget);
};
#endif // QT_NO_SCROLLAREA
#endif // QT_CONFIG(scrollarea)
#if QT_CONFIG(tabbar)
class QAccessibleTabBar : public QAccessibleWidget

View File

@ -207,7 +207,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QTextBrowser")) {
iface = new QAccessibleTextBrowser(widget);
#endif
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
} else if (classname == QLatin1String("QAbstractScrollArea")) {
iface = new QAccessibleAbstractScrollArea(widget);
} else if (classname == QLatin1String("QScrollArea")) {

View File

@ -2436,7 +2436,7 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int
{
Q_Q(const QWidget);
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
bool resetBrushOrigin = false;
QPointF oldBrushOrigin;
//If we are painting the viewport of a scrollarea, we must apply an offset to the brush in case we are drawing a texture
@ -2449,7 +2449,7 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int
painter->setBrushOrigin(-priv->contentsOffset());
}
#endif // QT_NO_SCROLLAREA
#endif // QT_CONFIG(scrollarea)
const QBrush autoFillBrush = q->palette().brush(q->backgroundRole());
@ -2476,10 +2476,10 @@ void QWidgetPrivate::paintBackground(QPainter *painter, const QRegion &rgn, int
q->style()->drawPrimitive(QStyle::PE_Widget, &opt, painter, q);
}
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
if (resetBrushOrigin)
painter->setBrushOrigin(oldBrushOrigin);
#endif // QT_NO_SCROLLAREA
#endif // QT_CONFIG(scrollarea)
}
/*

View File

@ -101,7 +101,7 @@ public:
#ifndef QT_NO_MDIAREA
|| qobject_cast<QMdiSubWindow *>(p) != 0
#endif
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
|| qobject_cast<QAbstractScrollArea *>(p) != 0
#endif
) {

View File

@ -2365,7 +2365,7 @@ static QWidget *embeddedWidget(QWidget *w)
return sb->findChild<QLineEdit *>();
#endif
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w))
return sa->viewport();
#endif
@ -2396,7 +2396,7 @@ static QWidget *containerWidget(const QWidget *w)
}
#endif // QT_NO_LINEEDIT
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w->parentWidget())) {
if (sa->viewport() == w)
return w->parentWidget();
@ -2800,7 +2800,7 @@ void QStyleSheetStyle::polish(QWidget *w)
}
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)) {
QRenderRule rule = renderRule(sa, PseudoElement_None, PseudoClass_Enabled);
if ((rule.hasBorder() && rule.border()->hasBorderImage())
@ -2902,7 +2902,7 @@ void QStyleSheetStyle::unpolish(QWidget *w)
w->setProperty("_q_stylesheet_maxh", QVariant());
w->setAttribute(Qt::WA_StyleSheet, false);
QObject::disconnect(w, 0, this, 0);
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
if (QAbstractScrollArea *sa = qobject_cast<QAbstractScrollArea *>(w)) {
QObject::disconnect(sa->horizontalScrollBar(), SIGNAL(valueChanged(int)),
sa, SLOT(update()));
@ -4374,7 +4374,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
}
break;
}
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w)) {
const QAbstractScrollAreaPrivate *sap = sa->d_func();
rule.drawBackground(p, opt->rect, sap->contentsOffset());

View File

@ -39,7 +39,7 @@
#include "qabstractscrollarea.h"
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
#include "qscrollbar.h"
#include "qapplication.h"
@ -1662,4 +1662,4 @@ QT_END_NAMESPACE
#include "moc_qabstractscrollarea.cpp"
#include "moc_qabstractscrollarea_p.cpp"
#endif // QT_NO_SCROLLAREA
#endif // QT_CONFIG(scrollarea)

View File

@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
class QMargins;
class QScrollBar;
@ -146,7 +146,7 @@ private:
friend class QWidgetPrivate;
};
#endif // QT_NO_SCROLLAREA
#endif // QT_CONFIG(scrollarea)
QT_END_NAMESPACE

View File

@ -57,7 +57,7 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
class QScrollBar;
class QAbstractScrollAreaScrollBarContainer;
@ -149,7 +149,7 @@ private:
Qt::Orientation orientation;
};
#endif // QT_NO_SCROLLAREA
#endif // QT_CONFIG(scrollarea)
QT_END_NAMESPACE

View File

@ -40,8 +40,6 @@
#include "qscrollarea.h"
#include "private/qscrollarea_p.h"
#ifndef QT_NO_SCROLLAREA
#include "qscrollbar.h"
#include "qlayout.h"
#include "qstyle.h"
@ -539,5 +537,3 @@ Qt::Alignment QScrollArea::alignment() const
QT_END_NAMESPACE
#include "moc_qscrollarea.cpp"
#endif // QT_NO_SCROLLAREA

View File

@ -43,11 +43,10 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qabstractscrollarea.h>
QT_REQUIRE_CONFIG(scrollarea);
QT_BEGIN_NAMESPACE
#ifndef QT_NO_SCROLLAREA
class QScrollAreaPrivate;
class Q_WIDGETS_EXPORT QScrollArea : public QAbstractScrollArea
@ -91,8 +90,6 @@ private:
Q_DISABLE_COPY(QScrollArea)
};
#endif // QT_NO_SCROLLAREA
QT_END_NAMESPACE
#endif // QSCROLLAREA_H

View File

@ -53,11 +53,11 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#ifndef QT_NO_SCROLLAREA
#include "private/qabstractscrollarea_p.h"
#include <QtWidgets/qscrollbar.h>
QT_REQUIRE_CONFIG(scrollarea);
QT_BEGIN_NAMESPACE
class QScrollAreaPrivate: public QAbstractScrollAreaPrivate
@ -74,8 +74,6 @@ public:
Qt::Alignment alignment;
};
#endif
QT_END_NAMESPACE
#endif

View File

@ -320,13 +320,13 @@ void QSizeGrip::mousePressEvent(QMouseEvent * e)
// Check if tlw is inside QAbstractScrollArea/QScrollArea.
// If that's the case tlw->parentWidget() will return the viewport
// and tlw->parentWidget()->parentWidget() will return the scroll area.
#ifndef QT_NO_SCROLLAREA
#if QT_CONFIG(scrollarea)
QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea *>(tlwParent->parentWidget());
if (scrollArea) {
hasHorizontalSizeConstraint = scrollArea->horizontalScrollBarPolicy() == Qt::ScrollBarAlwaysOff;
hasVerticalSizeConstraint = scrollArea->verticalScrollBarPolicy() == Qt::ScrollBarAlwaysOff;
}
#endif // QT_NO_SCROLLAREA
#endif // QT_CONFIG(scrollarea)
availableGeometry = tlwParent->contentsRect();
}

View File

@ -17,7 +17,6 @@ HEADERS += \
widgets/qmdisubwindow_p.h \
widgets/qmenu.h \
widgets/qmenu_p.h \
widgets/qscrollarea_p.h \
widgets/qsizegrip.h \
widgets/qslider.h \
widgets/qspinbox.h \
@ -31,7 +30,6 @@ HEADERS += \
widgets/qabstractscrollarea_p.h \
widgets/qwidgetresizehandler_p.h \
widgets/qfocusframe.h \
widgets/qscrollarea.h \
widgets/qwidgetanimator_p.h \
widgets/qwidgetlinecontrol_p.h \
widgets/qtoolbararealayout_p.h \
@ -60,7 +58,6 @@ SOURCES += \
widgets/qabstractscrollarea.cpp \
widgets/qwidgetresizehandler.cpp \
widgets/qfocusframe.cpp \
widgets/qscrollarea.cpp \
widgets/qwidgetanimator.cpp \
widgets/qwidgetlinecontrol.cpp \
widgets/qtoolbararealayout.cpp \
@ -216,6 +213,14 @@ qtConfig(rubberband) {
SOURCES += widgets/qrubberband.cpp
}
qtConfig(scrollarea) {
HEADERS += \
widgets/qscrollarea.h \
widgets/qscrollarea_p.h
SOURCES += widgets/qscrollarea.cpp
}
qtConfig(scrollbar) {
HEADERS += \
widgets/qscrollbar.h \