Convert features.groupbox to QT_[REQUIRE_]CONFIG
Change-Id: I034286043a880ab777ec3f2311572bdc38e7fafc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
This commit is contained in:
parent
414026ad9c
commit
39851c6905
@ -43,7 +43,9 @@
|
||||
|
||||
#include "qaction.h"
|
||||
#include "qapplication.h"
|
||||
#if QT_CONFIG(groupbox)
|
||||
#include "qgroupbox.h"
|
||||
#endif
|
||||
#if QT_CONFIG(label)
|
||||
#include "qlabel.h"
|
||||
#endif
|
||||
@ -95,7 +97,7 @@ static QString buddyString(const QWidget *widget)
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
QGroupBox *groupbox = qobject_cast<QGroupBox*>(parent);
|
||||
if (groupbox)
|
||||
return groupbox->title();
|
||||
@ -331,7 +333,7 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel
|
||||
}
|
||||
}
|
||||
#endif
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
QGroupBox *groupbox = qobject_cast<QGroupBox*>(parent);
|
||||
if (groupbox && !groupbox->title().isEmpty()) {
|
||||
QAccessibleInterface *iface = QAccessible::queryAccessibleInterface(groupbox);
|
||||
|
@ -124,7 +124,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
|
||||
#endif
|
||||
} else if (classname == QLatin1String("QLabel") || classname == QLatin1String("QLCDNumber")) {
|
||||
iface = new QAccessibleDisplay(widget);
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
} else if (classname == QLatin1String("QGroupBox")) {
|
||||
iface = new QAccessibleGroupBox(widget);
|
||||
#endif
|
||||
|
@ -62,7 +62,9 @@
|
||||
#if QT_CONFIG(label)
|
||||
#include <qlabel.h>
|
||||
#endif
|
||||
#if QT_CONFIG(groupbox)
|
||||
#include <qgroupbox.h>
|
||||
#endif
|
||||
#if QT_CONFIG(lcdnumber)
|
||||
#include <qlcdnumber.h>
|
||||
#endif
|
||||
@ -566,7 +568,7 @@ QPoint QAccessibleDisplay::imagePosition() const
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
QAccessibleGroupBox::QAccessibleGroupBox(QWidget *w)
|
||||
: QAccessibleWidget(w)
|
||||
{
|
||||
|
@ -126,7 +126,7 @@ public:
|
||||
QPoint imagePosition() const Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
class QAccessibleGroupBox : public QAccessibleWidget
|
||||
{
|
||||
public:
|
||||
|
@ -61,7 +61,9 @@
|
||||
#else
|
||||
#include <qlayout.h>
|
||||
#endif
|
||||
#if QT_CONFIG(groupbox)
|
||||
#include <qgroupbox.h>
|
||||
#endif
|
||||
#include <qmath.h>
|
||||
#include <qmenu.h>
|
||||
#include <qpainter.h>
|
||||
@ -441,7 +443,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
|
||||
case PE_FrameLineEdit:
|
||||
proxy()->drawPrimitive(PE_Frame, opt, p, widget);
|
||||
break;
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
case PE_FrameGroupBox:
|
||||
if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
|
||||
if (frame->features & QStyleOptionFrame::Flat) {
|
||||
@ -457,7 +459,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_GROUPBOX
|
||||
#endif // QT_CONFIG(groupbox)
|
||||
#if QT_CONFIG(dockwidget)
|
||||
case PE_FrameDockWidget:
|
||||
if (const QStyleOptionFrame *frame = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
|
||||
@ -3684,7 +3686,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
|
||||
}
|
||||
break;
|
||||
#endif // QT_CONFIG(dial)
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
case CC_GroupBox:
|
||||
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
|
||||
// Draw frame
|
||||
@ -3745,7 +3747,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_GROUPBOX
|
||||
#endif // QT_CONFIG(groupbox)
|
||||
#ifndef QT_NO_MDIAREA
|
||||
case CC_MdiControls:
|
||||
{
|
||||
@ -3916,7 +3918,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
|
||||
}
|
||||
break;
|
||||
#endif // QT_CONFIG(combobox)
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
case CC_GroupBox:
|
||||
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
|
||||
QRect r;
|
||||
@ -3931,7 +3933,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
|
||||
}
|
||||
}
|
||||
break;
|
||||
#endif // QT_NO_GROUPBOX
|
||||
#endif // QT_CONFIG(groupbox)
|
||||
case CC_MdiControls:
|
||||
{
|
||||
QRect r;
|
||||
@ -4263,7 +4265,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
||||
ret = visualRect(tb->direction, tb->rect, ret);
|
||||
}
|
||||
break;
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
case CC_GroupBox: {
|
||||
if (const QStyleOptionGroupBox *groupBox = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
|
||||
switch (sc) {
|
||||
@ -4339,7 +4341,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
|
||||
}
|
||||
break;
|
||||
}
|
||||
#endif // QT_NO_GROUPBOX
|
||||
#endif // QT_CONFIG(groupbox)
|
||||
#ifndef QT_NO_MDIAREA
|
||||
case CC_MdiControls:
|
||||
{
|
||||
@ -4883,12 +4885,12 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
|
||||
if (const QStyleOptionFrame *f = qstyleoption_cast<const QStyleOptionFrame *>(opt))
|
||||
sz += QSize(2*f->lineWidth, 2*f->lineWidth);
|
||||
break;
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
case CT_GroupBox:
|
||||
if (const QGroupBox *grb = static_cast<const QGroupBox *>(widget))
|
||||
sz += QSize(!grb->isFlat() ? 16 : 0, 0);
|
||||
break;
|
||||
#endif // QT_NO_GROUPBOX
|
||||
#endif // QT_CONFIG(groupbox)
|
||||
case CT_MdiControls:
|
||||
if (const QStyleOptionComplex *styleOpt = qstyleoption_cast<const QStyleOptionComplex *>(opt)) {
|
||||
const int buttonSize = proxy()->pixelMetric(PM_TitleBarButtonSize, styleOpt, widget);
|
||||
@ -4968,7 +4970,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
|
||||
ret = QDialogButtonBox::AcceptRole;
|
||||
break;
|
||||
#endif
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
case SH_GroupBox_TextLabelVerticalAlignment:
|
||||
ret = Qt::AlignVCenter;
|
||||
break;
|
||||
@ -4976,7 +4978,7 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
|
||||
case SH_GroupBox_TextLabelColor:
|
||||
ret = opt ? int(opt->palette.color(QPalette::Text).rgba()) : 0;
|
||||
break;
|
||||
#endif // QT_NO_GROUPBOX
|
||||
#endif // QT_CONFIG(groupbox)
|
||||
|
||||
case SH_ListViewExpand_SelectMouseType:
|
||||
case SH_TabBar_SelectMouseType:
|
||||
|
@ -57,7 +57,9 @@
|
||||
#include <qapplication.h>
|
||||
#include <qmainwindow.h>
|
||||
#include <qfont.h>
|
||||
#if QT_CONFIG(groupbox)
|
||||
#include <qgroupbox.h>
|
||||
#endif
|
||||
#include <qpixmapcache.h>
|
||||
#if QT_CONFIG(scrollbar)
|
||||
#include <qscrollbar.h>
|
||||
|
@ -3290,7 +3290,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
|
||||
HIThemeGroupBoxDrawInfo gdi;
|
||||
gdi.version = qt_mac_hitheme_version;
|
||||
gdi.state = tds;
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
#if QT_CONFIG(groupbox)
|
||||
if (w && qobject_cast<QGroupBox *>(w->parentWidget()))
|
||||
gdi.kind = kHIThemeGroupBoxKindSecondary;
|
||||
else
|
||||
|
@ -68,7 +68,9 @@
|
||||
#include <qevent.h>
|
||||
#include <qfocusframe.h>
|
||||
#include <qformlayout.h>
|
||||
#if QT_CONFIG(groupbox)
|
||||
#include <qgroupbox.h>
|
||||
#endif
|
||||
#include <qhash.h>
|
||||
#include <qheaderview.h>
|
||||
#include <qlayout.h>
|
||||
|
@ -38,7 +38,7 @@
|
||||
****************************************************************************/
|
||||
|
||||
#include "qgroupbox.h"
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
|
||||
#include "qapplication.h"
|
||||
#include "qbitmap.h"
|
||||
#include "qdrawutil.h"
|
||||
@ -751,9 +751,6 @@ void QGroupBox::mouseReleaseEvent(QMouseEvent *event)
|
||||
update(style()->subControlRect(QStyle::CC_GroupBox, &box, QStyle::SC_GroupBoxCheckBox, this));
|
||||
}
|
||||
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#include "moc_qgroupbox.cpp"
|
||||
|
||||
#endif //QT_NO_GROUPBOX
|
||||
|
@ -43,11 +43,10 @@
|
||||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtWidgets/qframe.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(groupbox);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
#ifndef QT_NO_GROUPBOX
|
||||
|
||||
class QGroupBoxPrivate;
|
||||
class QStyleOptionGroupBox;
|
||||
class Q_WIDGETS_EXPORT QGroupBox : public QWidget
|
||||
@ -104,8 +103,6 @@ private:
|
||||
Q_PRIVATE_SLOT(d_func(), void _q_setChildrenEnabled(bool b))
|
||||
};
|
||||
|
||||
#endif // QT_NO_GROUPBOX
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // QGROUPBOX_H
|
||||
|
@ -7,7 +7,6 @@ HEADERS += \
|
||||
widgets/qabstractspinbox_p.h \
|
||||
widgets/qframe.h \
|
||||
widgets/qframe_p.h \
|
||||
widgets/qgroupbox.h \
|
||||
widgets/qkeysequenceedit.h \
|
||||
widgets/qkeysequenceedit_p.h \
|
||||
widgets/qlineedit.h \
|
||||
@ -53,7 +52,6 @@ SOURCES += \
|
||||
widgets/qabstractspinbox.cpp \
|
||||
widgets/qeffects.cpp \
|
||||
widgets/qframe.cpp \
|
||||
widgets/qgroupbox.cpp \
|
||||
widgets/qkeysequenceedit.cpp \
|
||||
widgets/qlineedit_p.cpp \
|
||||
widgets/qlineedit.cpp \
|
||||
@ -160,6 +158,11 @@ qtConfig(fontcombobox) {
|
||||
SOURCES += widgets/qfontcombobox.cpp
|
||||
}
|
||||
|
||||
qtConfig(groupbox) {
|
||||
HEADERS += widgets/qgroupbox.h
|
||||
SOURCES += widgets/qgroupbox.cpp
|
||||
}
|
||||
|
||||
qtConfig(label) {
|
||||
HEADERS += \
|
||||
widgets/qlabel.h \
|
||||
|
Loading…
Reference in New Issue
Block a user