summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorStephan Binner <stephan.binner@basyskom.com>2017-03-02 13:39:22 +0100
committerStephan Binner <stephan.binner@basyskom.com>2017-03-03 20:34:58 +0000
commitdc2512f3088d6f836ef06d35cbf1a5f7acb4ce7b (patch)
tree57d49188948653679bc98704e36629523008445f /src/widgets
parent46bf3d71e58457afcc8177a68243ac71308534db (diff)
Add feature.label and feature.formlayout
Change-Id: Ic8dc0aee7f3fc0d8218ba709352b1378078c6070 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp6
-rw-r--r--src/widgets/accessible/simplewidgets.cpp19
-rw-r--r--src/widgets/configure.json30
-rw-r--r--src/widgets/itemviews/qheaderview.cpp19
-rw-r--r--src/widgets/itemviews/qheaderview_p.h6
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp4
-rw-r--r--src/widgets/kernel/kernel.pri7
-rw-r--r--src/widgets/kernel/qformlayout.h2
-rw-r--r--src/widgets/kernel/qlayout.cpp6
-rw-r--r--src/widgets/kernel/qtooltip.cpp5
-rw-r--r--src/widgets/styles/qcommonstyle.cpp6
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp4
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp12
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp3
-rw-r--r--src/widgets/widgets/qdatetimeedit_p.h1
-rw-r--r--src/widgets/widgets/qlabel.h2
-rw-r--r--src/widgets/widgets/widgets.pri12
17 files changed, 122 insertions, 22 deletions
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index 840a990799..94cf58ae3b 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -44,7 +44,9 @@
#include "qaction.h"
#include "qapplication.h"
#include "qgroupbox.h"
+#if QT_CONFIG(label)
#include "qlabel.h"
+#endif
#include "qtooltip.h"
#include "qwhatsthis.h"
#include "qwidget.h"
@@ -81,7 +83,7 @@ static QString buddyString(const QWidget *widget)
QWidget *parent = widget->parentWidget();
if (!parent)
return QString();
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut) && QT_CONFIG(label)
for (QObject *o : parent->children()) {
QLabel *label = qobject_cast<QLabel*>(o);
if (label && label->buddy() == widget)
@@ -309,7 +311,7 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel
if (match & QAccessible::Label) {
const QAccessible::Relation rel = QAccessible::Label;
if (QWidget *parent = widget()->parentWidget()) {
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut) && QT_CONFIG(label)
// first check for all siblings that are labels to us
// ideally we would go through all objects and check, but that
// will be too expensive
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index 184b934c34..99b22a735e 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -49,7 +49,9 @@
#endif
#include <qtoolbutton.h>
#include <qmenu.h>
+#if QT_CONFIG(label)
#include <qlabel.h>
+#endif
#include <qgroupbox.h>
#include <qlcdnumber.h>
#include <qlineedit.h>
@@ -395,6 +397,7 @@ QAccessibleDisplay::QAccessibleDisplay(QWidget *w, QAccessible::Role role)
QAccessible::Role QAccessibleDisplay::role() const
{
+#if QT_CONFIG(label)
QLabel *l = qobject_cast<QLabel*>(object());
if (l) {
if (l->pixmap())
@@ -416,6 +419,7 @@ QAccessible::Role QAccessibleDisplay::role() const
return QAccessible::StatusBar;
#endif
}
+#endif
return QAccessibleWidget::role();
}
@@ -426,7 +430,9 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
case QAccessible::Name:
str = widget()->accessibleName();
if (str.isEmpty()) {
- if (qobject_cast<QLabel*>(object())) {
+ if (false) {
+#if QT_CONFIG(label)
+ } else if (qobject_cast<QLabel*>(object())) {
QLabel *label = qobject_cast<QLabel*>(object());
str = label->text();
#ifndef QT_NO_TEXTHTMLPARSER
@@ -441,6 +447,7 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const
if (label->buddy())
str = qt_accStripAmp(str);
#endif
+#endif // QT_CONFIG(label)
#ifndef QT_NO_LCDNUMBER
} else if (qobject_cast<QLCDNumber*>(object())) {
QLCDNumber *l = qobject_cast<QLCDNumber*>(object());
@@ -475,7 +482,7 @@ QVector<QPair<QAccessibleInterface*, QAccessible::Relation> >
QAccessibleDisplay::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const
{
QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels = QAccessibleWidget::relations(match);
-#ifndef QT_NO_SHORTCUT
+#if QT_CONFIG(shortcut) && QT_CONFIG(label)
if (match & QAccessible::Labelled) {
if (QLabel *label = qobject_cast<QLabel*>(object())) {
const QAccessible::Relation rel = QAccessible::Labelled;
@@ -507,26 +514,34 @@ QString QAccessibleDisplay::imageDescription() const
/*! \internal */
QSize QAccessibleDisplay::imageSize() const
{
+#if QT_CONFIG(label)
QLabel *label = qobject_cast<QLabel *>(widget());
if (!label)
+#endif
return QSize();
+#if QT_CONFIG(label)
const QPixmap *pixmap = label->pixmap();
if (!pixmap)
return QSize();
return pixmap->size();
+#endif
}
/*! \internal */
QPoint QAccessibleDisplay::imagePosition() const
{
+#if QT_CONFIG(label)
QLabel *label = qobject_cast<QLabel *>(widget());
if (!label)
+#endif
return QPoint();
+#if QT_CONFIG(label)
const QPixmap *pixmap = label->pixmap();
if (!pixmap)
return QPoint();
return QPoint(label->mapToGlobal(label->pos()));
+#endif
}
#ifndef QT_NO_GROUPBOX
diff --git a/src/widgets/configure.json b/src/widgets/configure.json
index 399850a932..2ae8872c88 100644
--- a/src/widgets/configure.json
+++ b/src/widgets/configure.json
@@ -156,6 +156,19 @@
"condition": "features.rubberband",
"output": [ "publicFeature", "feature" ]
},
+ "label": {
+ "label": "QLabel",
+ "purpose": "Provides a text or image display.",
+ "section": "Widgets",
+ "output": [ "publicFeature" ]
+ },
+ "formlayout": {
+ "label": "QFormLayout",
+ "purpose": "Manages forms of input widgets and their associated labels.",
+ "section": "Widgets",
+ "condition": "features.label",
+ "output": [ "publicFeature" ]
+ },
"lcdnumber": {
"label": "QLCDNumber",
"purpose": "Provides LCD-like digits.",
@@ -374,6 +387,7 @@
"label": "QToolTip",
"purpose": "Supports presentation of tooltips.",
"section": "Widgets",
+ "condition": "features.label",
"output": [ "publicFeature", "feature" ]
},
"statustip": {
@@ -399,7 +413,7 @@
"label": "QCalendarWidget",
"purpose": "Provides a monthly based calendar widget allowing the user to select a date.",
"section": "Widgets",
- "condition": "features.tableview && features.menu && features.textdate && features.spinbox && features.toolbutton",
+ "condition": "features.tableview && features.menu && features.textdate && features.spinbox && features.toolbutton && features.label",
"output": [ "publicFeature", "feature" ]
},
"keysequenceedit": {
@@ -413,13 +427,14 @@
"label": "QMessageBox",
"purpose": "Provides message boxes displaying informative messages and simple questions.",
"section": "Dialogs",
+ "condition" : "features.label",
"output": [ "publicFeature", "feature" ]
},
"colordialog": {
"label": "QColorDialog",
"purpose": "Provides a dialog widget for specifying colors.",
"section": "Dialogs",
- "condition": "features.spinbox",
+ "condition": "features.spinbox && features.label",
"output": [ "publicFeature", "feature" ]
},
"filedialog": {
@@ -430,6 +445,7 @@
"features.buttongroup",
"features.combobox",
"features.dirmodel",
+ "features.label",
"features.proxymodel",
"features.splitter",
"features.stackedwidget",
@@ -442,35 +458,35 @@
"label": "QFontDialog",
"purpose": "Provides a dialog widget for selecting fonts.",
"section": "Dialogs",
- "condition": "features.stringlistmodel && features.combobox && features.validator && features.groupbox",
+ "condition": "features.stringlistmodel && features.combobox && features.validator && features.groupbox && features.label",
"output": [ "publicFeature", "feature" ]
},
"progressdialog": {
"label": "QProgressDialog",
"purpose": "Provides feedback on the progress of a slow operation.",
"section": "Dialogs",
- "condition": "features.progressbar",
+ "condition": "features.progressbar && features.label",
"output": [ "publicFeature", "feature" ]
},
"inputdialog": {
"label": "QInputDialog",
"purpose": "Provides a simple convenience dialog to get a single value from the user.",
"section": "Dialogs",
- "condition": "features.combobox && features.spinbox && features.stackedwidget && features.textedit",
+ "condition": "features.combobox && features.spinbox && features.stackedwidget && features.textedit && features.label",
"output": [ "publicFeature", "feature" ]
},
"errormessage": {
"label": "QErrorMessage",
"purpose": "Provides an error message display dialog.",
"section": "Dialogs",
- "condition": "features.textedit",
+ "condition": "features.textedit && features.label",
"output": [ "publicFeature", "feature" ]
},
"wizard": {
"label": "QWizard",
"purpose": "Provides a framework for multi-page click-through dialogs.",
"section": "Dialogs",
- "condition": "features.properties",
+ "condition": "features.properties && features.label",
"output": [ "publicFeature", "feature" ]
},
"dirmodel": {
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
index 1310a060ea..d2f9618c29 100644
--- a/src/widgets/itemviews/qheaderview.cpp
+++ b/src/widgets/itemviews/qheaderview.cpp
@@ -2479,7 +2479,10 @@ void QHeaderView::mouseMoveEvent(QMouseEvent *e)
if (d->shouldAutoScroll(e->pos()))
d->startAutoScroll();
if (qAbs(pos - d->firstPos) >= QApplication::startDragDistance()
- || !d->sectionIndicator->isHidden()) {
+#if QT_CONFIG(label)
+ || !d->sectionIndicator->isHidden()
+#endif
+ ) {
int visual = visualIndexAt(pos);
if (visual == -1)
return;
@@ -2548,7 +2551,11 @@ void QHeaderView::mouseReleaseEvent(QMouseEvent *e)
int pos = d->orientation == Qt::Horizontal ? e->x() : e->y();
switch (d->state) {
case QHeaderViewPrivate::MoveSection:
- if (!d->sectionIndicator->isHidden()) { // moving
+ if (true
+#if QT_CONFIG(label)
+ && !d->sectionIndicator->isHidden()
+#endif
+ ) { // moving
int from = visualIndex(d->section);
Q_ASSERT(from != -1);
int to = visualIndex(d->target);
@@ -3138,9 +3145,11 @@ int QHeaderViewPrivate::sectionHandleAt(int position)
void QHeaderViewPrivate::setupSectionIndicator(int section, int position)
{
Q_Q(QHeaderView);
+#if QT_CONFIG(label)
if (!sectionIndicator) {
sectionIndicator = new QLabel(viewport);
}
+#endif
int w, h;
int p = q->sectionViewportPosition(section);
@@ -3151,7 +3160,9 @@ void QHeaderViewPrivate::setupSectionIndicator(int section, int position)
w = viewport->width();
h = q->sectionSize(section);
}
+#if QT_CONFIG(label)
sectionIndicator->resize(w, h);
+#endif
QPixmap pm(w, h);
pm.fill(QColor(0, 0, 0, 45));
@@ -3162,12 +3173,15 @@ void QHeaderViewPrivate::setupSectionIndicator(int section, int position)
q->paintSection(&painter, rect, section);
painter.end();
+#if QT_CONFIG(label)
sectionIndicator->setPixmap(pm);
+#endif
sectionIndicatorOffset = position - qMax(p, 0);
}
void QHeaderViewPrivate::updateSectionIndicator(int section, int position)
{
+#if QT_CONFIG(label)
if (!sectionIndicator)
return;
@@ -3182,6 +3196,7 @@ void QHeaderViewPrivate::updateSectionIndicator(int section, int position)
sectionIndicator->move(0, position - sectionIndicatorOffset);
sectionIndicator->show();
+#endif
}
/*!
diff --git a/src/widgets/itemviews/qheaderview_p.h b/src/widgets/itemviews/qheaderview_p.h
index 6affe7af95..d6b119512c 100644
--- a/src/widgets/itemviews/qheaderview_p.h
+++ b/src/widgets/itemviews/qheaderview_p.h
@@ -58,7 +58,9 @@
#include "QtCore/qbitarray.h"
#include "QtWidgets/qapplication.h"
+#if QT_CONFIG(label)
#include "QtWidgets/qlabel.h"
+#endif
QT_BEGIN_NAMESPACE
@@ -99,7 +101,9 @@ public:
lastSectionSize(0),
lastSectionLogicalIdx(-1), // Only trust when we stretch last section
sectionIndicatorOffset(0),
+#if QT_CONFIG(label)
sectionIndicator(0),
+#endif
globalResizeMode(QHeaderView::Interactive),
sectionStartposRecalc(true),
resizeContentsPrecision(1000)
@@ -296,7 +300,9 @@ public:
int lastSectionLogicalIdx; // Only trust if we stretch LastSection
int sectionIndicatorOffset;
Qt::Alignment defaultAlignment;
+#if QT_CONFIG(label)
QLabel *sectionIndicator;
+#endif
QHeaderView::ResizeMode globalResizeMode;
QList<QPersistentModelIndex> persistentHiddenSections;
mutable bool sectionStartposRecalc;
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index 5356ce3ad0..c044d37575 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -45,7 +45,9 @@
#include <qcombobox.h>
#include <qdatetimeedit.h>
+#if QT_CONFIG(label)
#include <qlabel.h>
+#endif
#include <qlineedit.h>
#include <qspinbox.h>
#include <limits.h>
@@ -261,8 +263,10 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
ed->setFrame(false);
return ed; }
#endif
+#if QT_CONFIG(label)
case QVariant::Pixmap:
return new QLabel(parent);
+#endif
#ifndef QT_NO_SPINBOX
case QVariant::Double: {
QDoubleSpinBox *sb = new QDoubleSpinBox(parent);
diff --git a/src/widgets/kernel/kernel.pri b/src/widgets/kernel/kernel.pri
index ad2180bbfd..c91be918b6 100644
--- a/src/widgets/kernel/kernel.pri
+++ b/src/widgets/kernel/kernel.pri
@@ -15,7 +15,6 @@ HEADERS += \
kernel/qwidgetbackingstore_p.h \
kernel/qboxlayout.h \
kernel/qdesktopwidget.h \
- kernel/qformlayout.h \
kernel/qgridlayout.h \
kernel/qlayout.h \
kernel/qlayout_p.h \
@@ -45,7 +44,6 @@ SOURCES += \
kernel/qapplication.cpp \
kernel/qwidgetbackingstore.cpp \
kernel/qboxlayout.cpp \
- kernel/qformlayout.cpp \
kernel/qgridlayout.cpp \
kernel/qlayout.cpp \
kernel/qlayoutengine.cpp \
@@ -84,3 +82,8 @@ qtConfig(opengl) {
HEADERS += kernel/qopenglwidget.h
SOURCES += kernel/qopenglwidget.cpp
}
+
+qtConfig(formlayout) {
+ HEADERS += kernel/qformlayout.h
+ SOURCES += kernel/qformlayout.cpp
+}
diff --git a/src/widgets/kernel/qformlayout.h b/src/widgets/kernel/qformlayout.h
index b4185374fd..5ec27433d3 100644
--- a/src/widgets/kernel/qformlayout.h
+++ b/src/widgets/kernel/qformlayout.h
@@ -43,6 +43,8 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/QLayout>
+QT_REQUIRE_CONFIG(formlayout);
+
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp
index 1a341d155b..b90be2b4f1 100644
--- a/src/widgets/kernel/qlayout.cpp
+++ b/src/widgets/kernel/qlayout.cpp
@@ -49,7 +49,9 @@
#include "qvariant.h"
#include "qwidget_p.h"
#include "qlayout_p.h"
+#if QT_CONFIG(formlayout)
#include "qformlayout.h"
+#endif
QT_BEGIN_NAMESPACE
@@ -320,8 +322,10 @@ int QLayout::spacing() const
return boxlayout->spacing();
} else if (const QGridLayout* gridlayout = qobject_cast<const QGridLayout*>(this)) {
return gridlayout->spacing();
+#if QT_CONFIG(formlayout)
} else if (const QFormLayout* formlayout = qobject_cast<const QFormLayout*>(this)) {
return formlayout->spacing();
+#endif
} else {
Q_D(const QLayout);
if (d->insideSpacing >=0) {
@@ -347,8 +351,10 @@ void QLayout::setSpacing(int spacing)
boxlayout->setSpacing(spacing);
} else if (QGridLayout* gridlayout = qobject_cast<QGridLayout*>(this)) {
gridlayout->setSpacing(spacing);
+#if QT_CONFIG(formlayout)
} else if (QFormLayout* formlayout = qobject_cast<QFormLayout*>(this)) {
formlayout->setSpacing(spacing);
+#endif
} else {
Q_D(QLayout);
d->insideSpacing = spacing;
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index a92dc2cbf7..48afeb1dcc 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -43,18 +43,19 @@
#include <qapplication.h>
#include <qdesktopwidget.h>
#include <qevent.h>
-#include <qlabel.h>
#include <qpointer.h>
#include <qstyle.h>
#include <qstyleoption.h>
#include <qstylepainter.h>
#include <qtimer.h>
-#include <qtooltip.h>
#include <private/qeffects_p.h>
#include <qtextdocument.h>
#include <qdebug.h>
#include <private/qstylesheetstyle_p.h>
+
#ifndef QT_NO_TOOLTIP
+#include <qlabel.h>
+#include <qtooltip.h>
#if 0 // Used to be included in Qt4 for Q_WS_MAC
# include <private/qcore_mac_p.h>
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 24070f18a6..b54f49c8fc 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -49,7 +49,11 @@
#include <qdockwidget.h>
#include <qdrawutil.h>
#include <qdialogbuttonbox.h>
+#if QT_CONFIG(formlayout)
#include <qformlayout.h>
+#else
+#include <qlayout.h>
+#endif
#include <qgroupbox.h>
#include <qmath.h>
#include <qmenu.h>
@@ -5162,12 +5166,14 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget
ret = QWizard::ClassicStyle;
break;
#endif
+#if QT_CONFIG(formlayout)
case SH_FormLayoutWrapPolicy:
ret = QFormLayout::DontWrapRows;
break;
case SH_FormLayoutFieldGrowthPolicy:
ret = QFormLayout::AllNonFixedFieldsGrow;
break;
+#endif
case SH_FormLayoutFormAlignment:
ret = Qt::AlignLeft | Qt::AlignTop;
break;
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 35e7060b72..3a43f146da 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -75,7 +75,9 @@
#include <qdialog.h>
#include <private/qwidget_p.h>
#include <QAbstractSpinBox>
+#if QT_CONFIG(label)
#include <QLabel>
+#endif
#include "qdrawutil.h"
#include <limits.h>
@@ -1414,11 +1416,13 @@ void QRenderRule::configurePalette(QPalette *p, QPalette::ColorGroup cg, const Q
static inline QObject *parentObject(const QObject *obj)
{
+#if QT_CONFIG(tooltip)
if (qobject_cast<const QLabel *>(obj) && qstrcmp(obj->metaObject()->className(), "QTipLabel") == 0) {
QObject *p = qvariant_cast<QObject *>(obj->property("_q_stylesheet_parent"));
if (p)
return p;
}
+#endif
return obj->parent();
}
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index 83c1764f38..4ea776d0b1 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -46,7 +46,10 @@
#include "qlist.h"
#include "qevent.h"
#include "qpoint.h"
+#if QT_CONFIG(label)
#include "qlabel.h"
+#include "private/qlabel_p.h"
+#endif
#include "qpushbutton.h"
#include "qpainterpath.h"
#include "qpainter.h"
@@ -55,7 +58,6 @@
#include "qapplication.h"
#include "qdesktopwidget.h"
#include "qbitmap.h"
-#include "private/qlabel_p.h"
QT_BEGIN_NAMESPACE
@@ -481,6 +483,7 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
setAttribute(Qt::WA_DeleteOnClose);
QObject::connect(ti, SIGNAL(destroyed()), this, SLOT(close()));
+#if QT_CONFIG(label)
QLabel *titleLabel = new QLabel;
titleLabel->installEventFilter(this);
titleLabel->setText(title);
@@ -488,6 +491,7 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
f.setBold(true);
titleLabel->setFont(f);
titleLabel->setTextFormat(Qt::PlainText); // to maintain compat with windows
+#endif
const int iconSize = 18;
const int closeButtonSize = 15;
@@ -499,6 +503,7 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
closeButton->setFixedSize(closeButtonSize, closeButtonSize);
QObject::connect(closeButton, SIGNAL(clicked()), this, SLOT(close()));
+#if QT_CONFIG(label)
QLabel *msgLabel = new QLabel;
msgLabel->installEventFilter(this);
msgLabel->setText(message);
@@ -521,8 +526,10 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
// to emulate the weird standard windows behavior.
msgLabel->setFixedSize(limit, msgLabel->heightForWidth(limit));
}
+#endif
QGridLayout *layout = new QGridLayout;
+#if QT_CONFIG(label)
if (!icon.isNull()) {
QLabel *iconLabel = new QLabel;
iconLabel->setPixmap(icon.pixmap(iconSize, iconSize));
@@ -533,9 +540,12 @@ QBalloonTip::QBalloonTip(const QIcon &icon, const QString &title,
} else {
layout->addWidget(titleLabel, 0, 0, 1, 2);
}
+#endif
layout->addWidget(closeButton, 0, 2);
+#if QT_CONFIG(label)
layout->addWidget(msgLabel, 1, 0, 1, 3);
+#endif
layout->setSizeConstraint(QLayout::SetFixedSize);
layout->setMargin(3);
setLayout(layout);
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index ac6c14dc63..cbd5d9eb80 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -37,7 +37,10 @@
**
****************************************************************************/
+#include "qtwidgetsglobal.h"
+#if QT_CONFIG(label)
#include "qlabel.h"
+#endif
#include "qpainter.h"
#include "qpixmap.h"
#include "qbitmap.h"
diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h
index 730aa0f0b2..5302d6d9a7 100644
--- a/src/widgets/widgets/qdatetimeedit_p.h
+++ b/src/widgets/widgets/qdatetimeedit_p.h
@@ -57,7 +57,6 @@
#include "QtWidgets/qspinbox.h"
#include "QtWidgets/qtoolbutton.h"
#include "QtWidgets/qmenu.h"
-#include "QtWidgets/qlabel.h"
#include "QtWidgets/qdatetimeedit.h"
#include "private/qabstractspinbox_p.h"
#include "private/qdatetimeparser_p.h"
diff --git a/src/widgets/widgets/qlabel.h b/src/widgets/widgets/qlabel.h
index 1f76937a63..3978e34d14 100644
--- a/src/widgets/widgets/qlabel.h
+++ b/src/widgets/widgets/qlabel.h
@@ -43,6 +43,8 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qframe.h>
+QT_REQUIRE_CONFIG(label);
+
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri
index 1821a7f766..7628a86459 100644
--- a/src/widgets/widgets/widgets.pri
+++ b/src/widgets/widgets/widgets.pri
@@ -26,8 +26,6 @@ HEADERS += \
widgets/qgroupbox.h \
widgets/qkeysequenceedit.h \
widgets/qkeysequenceedit_p.h \
- widgets/qlabel.h \
- widgets/qlabel_p.h \
widgets/qlcdnumber.h \
widgets/qlineedit.h \
widgets/qlineedit_p.h \
@@ -100,7 +98,6 @@ SOURCES += \
widgets/qframe.cpp \
widgets/qgroupbox.cpp \
widgets/qkeysequenceedit.cpp \
- widgets/qlabel.cpp \
widgets/qlcdnumber.cpp \
widgets/qlineedit_p.cpp \
widgets/qlineedit.cpp \
@@ -149,6 +146,15 @@ qtConfig(commandlinkbutton) {
widgets/qcommandlinkbutton.cpp
}
+qtConfig(label) {
+ HEADERS += \
+ widgets/qlabel.h \
+ widgets/qlabel_p.h
+
+ SOURCES += \
+ widgets/qlabel.cpp
+}
+
qtConfig(radiobutton) {
HEADERS += \
widgets/qradiobutton.h