summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-09-20 11:37:26 +0200
committerLiang Qi <liang.qi@qt.io>2017-09-20 11:58:32 +0200
commit01bc69f99f189b03d0b9cad77cc300798937cad1 (patch)
tree730f3b691cfc1830ec617b3c2ad8df16180de724 /src
parentc23c4a921d0e9e2d18a62af82d38ca27eac7bcb3 (diff)
parent6d699d08200b1fe3a616dfbc275d46c98b77fcbd (diff)
Merge remote-tracking branch 'origin/5.9' into 5.10
Conflicts: src/plugins/styles/mac/qmacstyle_mac.mm src/widgets/util/qcompleter.cpp src/widgets/widgets/qmainwindowlayout.cpp src/widgets/widgets/qmdisubwindow.cpp Change-Id: If0e96981af07ce36ac68f2e69211bc2120f93973
Diffstat (limited to 'src')
-rw-r--r--src/corelib/io/qfilesystemengine_unix.cpp1
-rw-r--r--src/corelib/kernel/qvariant.cpp92
-rw-r--r--src/corelib/tools/qsharedpointer_impl.h9
-rw-r--r--src/gui/image/qimage.cpp23
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp11
-rw-r--r--src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h1
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm10
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm10
-rw-r--r--src/plugins/platforms/windows/openglblacklists/default.json17
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm36
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac_p_p.h8
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle.cpp16
-rw-r--r--src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h4
-rw-r--r--src/plugins/styles/windowsvista/qwindowsxpstyle.cpp28
-rw-r--r--src/sql/kernel/qsqldatabase.cpp8
-rw-r--r--src/testlib/qtestcase.cpp2
-rw-r--r--src/widgets/accessible/complexwidgets.cpp2
-rw-r--r--src/widgets/accessible/qaccessiblemenu.cpp6
-rw-r--r--src/widgets/accessible/qaccessiblemenu_p.h4
-rw-r--r--src/widgets/accessible/qaccessiblewidget.cpp4
-rw-r--r--src/widgets/accessible/qaccessiblewidgetfactory.cpp14
-rw-r--r--src/widgets/accessible/qaccessiblewidgets.cpp25
-rw-r--r--src/widgets/accessible/qaccessiblewidgets_p.h12
-rw-r--r--src/widgets/accessible/rangecontrols.cpp15
-rw-r--r--src/widgets/accessible/rangecontrols_p.h8
-rw-r--r--src/widgets/accessible/simplewidgets.cpp23
-rw-r--r--src/widgets/accessible/simplewidgets_p.h4
-rw-r--r--src/widgets/dialogs/qcolordialog.cpp4
-rw-r--r--src/widgets/dialogs/qdialog.cpp20
-rw-r--r--src/widgets/dialogs/qdialog_p.h4
-rw-r--r--src/widgets/dialogs/qfiledialog.cpp6
-rw-r--r--src/widgets/dialogs/qmessagebox.cpp26
-rw-r--r--src/widgets/dialogs/qmessagebox.h4
-rw-r--r--src/widgets/dialogs/qsidebar.cpp6
-rw-r--r--src/widgets/dialogs/qsidebar_p.h2
-rw-r--r--src/widgets/dialogs/qwizard.cpp8
-rw-r--r--src/widgets/graphicsview/qgraphicsproxywidget.cpp4
-rw-r--r--src/widgets/itemviews/qabstractitemdelegate.cpp13
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp8
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp22
-rw-r--r--src/widgets/itemviews/qitemeditorfactory_p.h6
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp6
-rw-r--r--src/widgets/kernel/qaction.cpp6
-rw-r--r--src/widgets/kernel/qaction.h2
-rw-r--r--src/widgets/kernel/qaction_p.h2
-rw-r--r--src/widgets/kernel/qlayout.cpp2
-rw-r--r--src/widgets/kernel/qshortcut.cpp4
-rw-r--r--src/widgets/kernel/qwidget.cpp4
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp4
-rw-r--r--src/widgets/styles/qcommonstyle.cpp64
-rw-r--r--src/widgets/styles/qfusionstyle.cpp6
-rw-r--r--src/widgets/styles/qpixmapstyle.cpp4
-rw-r--r--src/widgets/styles/qstylehelper.cpp4
-rw-r--r--src/widgets/styles/qstyleoption.cpp12
-rw-r--r--src/widgets/styles/qstyleoption.h13
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp58
-rw-r--r--src/widgets/styles/qwindowsstyle.cpp34
-rw-r--r--src/widgets/util/qcompleter.cpp2
-rw-r--r--src/widgets/util/qsystemtrayicon.cpp6
-rw-r--r--src/widgets/util/qsystemtrayicon.h2
-rw-r--r--src/widgets/util/qsystemtrayicon_p.h3
-rw-r--r--src/widgets/util/qsystemtrayicon_x11.cpp2
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp6
-rw-r--r--src/widgets/widgets/qabstractspinbox.h7
-rw-r--r--src/widgets/widgets/qabstractspinbox_p.h6
-rw-r--r--src/widgets/widgets/qcombobox.cpp4
-rw-r--r--src/widgets/widgets/qcombobox.h1
-rw-r--r--src/widgets/widgets/qdockwidget.cpp12
-rw-r--r--src/widgets/widgets/qlabel_p.h2
-rw-r--r--src/widgets/widgets/qlineedit.cpp7
-rw-r--r--src/widgets/widgets/qlineedit.h7
-rw-r--r--src/widgets/widgets/qlineedit_p.cpp5
-rw-r--r--src/widgets/widgets/qlineedit_p.h5
-rw-r--r--src/widgets/widgets/qmainwindow.cpp10
-rw-r--r--src/widgets/widgets/qmainwindow.h9
-rw-r--r--src/widgets/widgets/qmainwindowlayout.cpp3
-rw-r--r--src/widgets/widgets/qmainwindowlayout_p.h6
-rw-r--r--src/widgets/widgets/qmdiarea.cpp10
-rw-r--r--src/widgets/widgets/qmdiarea.h6
-rw-r--r--src/widgets/widgets/qmdiarea_p.h4
-rw-r--r--src/widgets/widgets/qmdisubwindow.cpp61
-rw-r--r--src/widgets/widgets/qmdisubwindow.h11
-rw-r--r--src/widgets/widgets/qmdisubwindow_p.h16
-rw-r--r--src/widgets/widgets/qmenu.cpp23
-rw-r--r--src/widgets/widgets/qmenu.h7
-rw-r--r--src/widgets/widgets/qmenu_mac.mm4
-rw-r--r--src/widgets/widgets/qmenu_p.h7
-rw-r--r--src/widgets/widgets/qmenubar.cpp4
-rw-r--r--src/widgets/widgets/qplaintextedit.cpp6
-rw-r--r--src/widgets/widgets/qplaintextedit.h6
-rw-r--r--src/widgets/widgets/qplaintextedit_p.h8
-rw-r--r--src/widgets/widgets/qpushbutton.cpp14
-rw-r--r--src/widgets/widgets/qpushbutton.h6
-rw-r--r--src/widgets/widgets/qpushbutton_p.h2
-rw-r--r--src/widgets/widgets/qscrollbar.cpp6
-rw-r--r--src/widgets/widgets/qsizegrip.cpp4
-rw-r--r--src/widgets/widgets/qsizegrip.h5
-rw-r--r--src/widgets/widgets/qslider.cpp3
-rw-r--r--src/widgets/widgets/qslider.h7
-rw-r--r--src/widgets/widgets/qspinbox.cpp4
-rw-r--r--src/widgets/widgets/qspinbox.h7
-rw-r--r--src/widgets/widgets/qstatusbar.cpp24
-rw-r--r--src/widgets/widgets/qtextedit.cpp11
-rw-r--r--src/widgets/widgets/qtextedit.h6
-rw-r--r--src/widgets/widgets/qtextedit_p.h8
-rw-r--r--src/widgets/widgets/qtoolbutton.cpp31
-rw-r--r--src/widgets/widgets/qtoolbutton.h8
-rw-r--r--src/widgets/widgets/qwidgetanimator.cpp8
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol.cpp6
-rw-r--r--src/widgets/widgets/qwidgetlinecontrol_p.h6
-rw-r--r--src/widgets/widgets/qwidgetresizehandler.cpp2
-rw-r--r--src/widgets/widgets/qwidgettextcontrol.cpp16
-rw-r--r--src/widgets/widgets/qwidgettextcontrol_p.h6
-rw-r--r--src/widgets/widgets/qwidgettextcontrol_p_p.h2
-rw-r--r--src/widgets/widgets/widgets.pri118
115 files changed, 768 insertions, 571 deletions
diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
index 2828c85048..9fb3855472 100644
--- a/src/corelib/io/qfilesystemengine_unix.cpp
+++ b/src/corelib/io/qfilesystemengine_unix.cpp
@@ -47,6 +47,7 @@
#include <QtCore/private/qcore_unix_p.h>
#include <QtCore/qvarlengtharray.h>
+#include <pwd.h>
#include <stdlib.h> // for realpath()
#include <sys/types.h>
#include <sys/stat.h>
diff --git a/src/corelib/kernel/qvariant.cpp b/src/corelib/kernel/qvariant.cpp
index b79716ff4c..29429b5e55 100644
--- a/src/corelib/kernel/qvariant.cpp
+++ b/src/corelib/kernel/qvariant.cpp
@@ -3173,6 +3173,9 @@ static bool canConvertMetaObject(int fromId, int toId, QObject *fromObject)
*/
bool QVariant::canConvert(int targetTypeId) const
{
+ if (d.type == targetTypeId)
+ return true;
+
if ((targetTypeId == QMetaType::QModelIndex && d.type == QMetaType::QPersistentModelIndex)
|| (targetTypeId == QMetaType::QPersistentModelIndex && d.type == QMetaType::QModelIndex))
return true;
@@ -3639,29 +3642,36 @@ static int numericCompare(const QVariant::Private *d1, const QVariant::Private *
*/
bool QVariant::cmp(const QVariant &v) const
{
+ auto cmp_helper = [] (const QVariant::Private &d1, const QVariant::Private &d2)
+ {
+ Q_ASSERT(d1.type == d2.type);
+ if (d1.type >= QMetaType::User) {
+ int result;
+ if (QMetaType::equals(QT_PREPEND_NAMESPACE(constData(d1)), QT_PREPEND_NAMESPACE(constData(d2)), d1.type, &result))
+ return result == 0;
+ }
+ return handlerManager[d1.type]->compare(&d1, &d2);
+ };
+
// try numerics first, with C++ type promotion rules (no conversion)
if (qIsNumericType(d.type) && qIsNumericType(v.d.type))
return numericCompare(&d, &v.d) == 0;
+ if (d.type == v.d.type)
+ return cmp_helper(d, v.d);
+
QVariant v1 = *this;
QVariant v2 = v;
- if (d.type != v2.d.type) {
- if (v2.canConvert(v1.d.type)) {
- if (!v2.convert(v1.d.type))
- return false;
- } else {
- // try the opposite conversion, it might work
- qSwap(v1, v2);
- if (!v2.convert(v1.d.type))
- return false;
- }
- }
- if (v1.d.type >= QMetaType::User) {
- int result;
- if (QMetaType::equals(QT_PREPEND_NAMESPACE(constData(v1.d)), QT_PREPEND_NAMESPACE(constData(v2.d)), v1.d.type, &result))
- return result == 0;
+ if (v2.canConvert(v1.d.type)) {
+ if (!v2.convert(v1.d.type))
+ return false;
+ } else {
+ // try the opposite conversion, it might work
+ qSwap(v1, v2);
+ if (!v2.convert(v1.d.type))
+ return false;
}
- return handlerManager[v1.d.type]->compare(&v1.d, &v2.d);
+ return cmp_helper(v1.d, v2.d);
}
/*!
@@ -3677,51 +3687,53 @@ int QVariant::compare(const QVariant &v) const
if (cmp(v))
return 0;
- QVariant v1 = *this;
- QVariant v2 = v;
+ const QVariant *v1 = this;
+ const QVariant *v2 = &v;
+ QVariant converted1;
+ QVariant converted2;
- if (v1.d.type != v2.d.type) {
+ if (d.type != v.d.type) {
// if both types differ, try to convert
- if (v2.canConvert(v1.d.type)) {
- QVariant temp = v2;
- if (temp.convert(v1.d.type))
- v2 = temp;
+ if (v2->canConvert(v1->d.type)) {
+ converted2 = *v2;
+ if (converted2.convert(v1->d.type))
+ v2 = &converted2;
}
- if (v1.d.type != v2.d.type && v1.canConvert(v2.d.type)) {
- QVariant temp = v1;
- if (temp.convert(v2.d.type))
- v1 = temp;
+ if (v1->d.type != v2->d.type && v1->canConvert(v2->d.type)) {
+ converted1 = *v1;
+ if (converted1.convert(v2->d.type))
+ v1 = &converted1;
}
- if (v1.d.type != v2.d.type) {
+ if (v1->d.type != v2->d.type) {
// if conversion fails, default to toString
- int r = v1.toString().compare(v2.toString(), Qt::CaseInsensitive);
+ int r = v1->toString().compare(v2->toString(), Qt::CaseInsensitive);
if (r == 0) {
// cmp(v) returned false, so we should try to agree with it.
- return (v1.d.type < v2.d.type) ? -1 : 1;
+ return (v1->d.type < v2->d.type) ? -1 : 1;
}
return r;
}
// did we end up with two numerics? If so, restart
- if (qIsNumericType(v1.d.type) && qIsNumericType(v2.d.type))
- return v1.compare(v2);
+ if (qIsNumericType(v1->d.type) && qIsNumericType(v2->d.type))
+ return v1->compare(*v2);
}
- if (v1.d.type >= QMetaType::User) {
+ if (v1->d.type >= QMetaType::User) {
int result;
- if (QMetaType::compare(QT_PREPEND_NAMESPACE(constData(d)), QT_PREPEND_NAMESPACE(constData(v2.d)), d.type, &result))
+ if (QMetaType::compare(QT_PREPEND_NAMESPACE(constData(d)), QT_PREPEND_NAMESPACE(constData(v2->d)), d.type, &result))
return result;
}
- switch (v1.d.type) {
+ switch (v1->d.type) {
case QVariant::Date:
- return v1.toDate() < v2.toDate() ? -1 : 1;
+ return v1->toDate() < v2->toDate() ? -1 : 1;
case QVariant::Time:
- return v1.toTime() < v2.toTime() ? -1 : 1;
+ return v1->toTime() < v2->toTime() ? -1 : 1;
case QVariant::DateTime:
- return v1.toDateTime() < v2.toDateTime() ? -1 : 1;
+ return v1->toDateTime() < v2->toDateTime() ? -1 : 1;
case QVariant::StringList:
- return v1.toStringList() < v2.toStringList() ? -1 : 1;
+ return v1->toStringList() < v2->toStringList() ? -1 : 1;
}
- int r = v1.toString().compare(v2.toString(), Qt::CaseInsensitive);
+ int r = v1->toString().compare(v2->toString(), Qt::CaseInsensitive);
if (r == 0) {
// cmp(v) returned false, so we should try to agree with it.
return (d.type < v.d.type) ? -1 : 1;
diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h
index 15573c5588..ede54c155d 100644
--- a/src/corelib/tools/qsharedpointer_impl.h
+++ b/src/corelib/tools/qsharedpointer_impl.h
@@ -850,17 +850,20 @@ Q_INLINE_TEMPLATE typename QSharedPointer<X>::difference_type operator-(T *ptr1,
template <class T, class X>
Q_INLINE_TEMPLATE bool operator<(const QSharedPointer<T> &ptr1, const QSharedPointer<X> &ptr2)
{
- return ptr1.data() < ptr2.data();
+ using CT = typename std::common_type<T *, X *>::type;
+ return std::less<CT>()(ptr1.data(), ptr2.data());
}
template <class T, class X>
Q_INLINE_TEMPLATE bool operator<(const QSharedPointer<T> &ptr1, X *ptr2)
{
- return ptr1.data() < ptr2;
+ using CT = typename std::common_type<T *, X *>::type;
+ return std::less<CT>()(ptr1.data(), ptr2);
}
template <class T, class X>
Q_INLINE_TEMPLATE bool operator<(T *ptr1, const QSharedPointer<X> &ptr2)
{
- return ptr1 < ptr2.data();
+ using CT = typename std::common_type<T *, X *>::type;
+ return std::less<CT>()(ptr1, ptr2.data());
}
//
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index 4412e722f6..097033280a 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -2113,8 +2113,8 @@ static QImage convertWithPalette(const QImage &src, QImage::Format format,
Returns a copy of the image converted to the given \a format,
using the specified \a colorTable.
- Conversion from 32 bit to 8 bit indexed is a slow operation and
- will use a straightforward nearest color approach, with no
+ Conversion from RGB formats to indexed formats is a slow operation
+ and will use a straightforward nearest color approach, with no
dithering.
*/
QImage QImage::convertToFormat(Format format, const QVector<QRgb> &colorTable, Qt::ImageConversionFlags flags) const
@@ -2122,23 +2122,12 @@ QImage QImage::convertToFormat(Format format, const QVector<QRgb> &colorTable, Q
if (!d || d->format == format)
return *this;
- if (format <= QImage::Format_Indexed8 && depth() == 32) {
- return convertWithPalette(*this, format, colorTable);
- }
-
- const Image_Converter *converterPtr = &qimage_converter_map[d->format][format];
- Image_Converter converter = *converterPtr;
- if (!converter)
+ if (format == QImage::Format_Invalid)
return QImage();
+ if (format <= QImage::Format_Indexed8)
+ return convertWithPalette(convertToFormat(QImage::Format_ARGB32, flags), format, colorTable);
- QImage image(d->width, d->height, format);
- QIMAGE_SANITYCHECK_MEMORY(image);
-
- image.d->offset = offset();
- copyMetadata(image.d, d);
-
- converter(image.d, d, flags);
- return image;
+ return convertToFormat(format, flags);
}
/*!
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
index 6df454adb0..9675d828e7 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.cpp
@@ -136,6 +136,17 @@ bool QIBusPlatformInputContext::isValid() const
return d->valid && d->busConnected;
}
+bool QIBusPlatformInputContext::hasCapability(Capability capability) const
+{
+ switch (capability) {
+ case QPlatformInputContext::HiddenTextCapability:
+ return false; // QTBUG-40691, do not show IME on desktop for password entry fields.
+ default:
+ break;
+ }
+ return true;
+}
+
void QIBusPlatformInputContext::invokeAction(QInputMethod::Action a, int)
{
if (!d->busConnected)
diff --git a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
index 94fa5c3d60..7baa9ad1da 100644
--- a/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
+++ b/src/plugins/platforminputcontexts/ibus/qibusplatforminputcontext.h
@@ -95,6 +95,7 @@ public:
void update(Qt::InputMethodQueries) Q_DECL_OVERRIDE;
bool filterEvent(const QEvent *event) Q_DECL_OVERRIDE;
QLocale locale() const Q_DECL_OVERRIDE;
+ bool hasCapability(Capability capability) const Q_DECL_OVERRIDE;
public Q_SLOTS:
void commitText(const QDBusVariant &text);
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index 70fcb40774..3e466c9587 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -86,6 +86,7 @@ QCocoaMenuBar::~QCocoaMenuBar()
// the menu bar was updated
qDeleteAll(children());
updateMenuBarImmediately();
+ resetKnownMenuItemsToQt();
}
}
@@ -306,16 +307,9 @@ void QCocoaMenuBar::resetKnownMenuItemsToQt()
foreach (QCocoaMenuBar *mb, static_menubars) {
foreach (QCocoaMenu *m, mb->m_menus) {
foreach (QCocoaMenuItem *i, m->items()) {
- switch (i->effectiveRole()) {
- case QPlatformMenuItem::CutRole:
- case QPlatformMenuItem::CopyRole:
- case QPlatformMenuItem::PasteRole:
- case QPlatformMenuItem::SelectAllRole:
+ if (i->effectiveRole() >= QPlatformMenuItem::ApplicationSpecificRole) {
[i->nsItem() setTarget:m->nsMenu().delegate];
[i->nsItem() setAction:@selector(itemFired:)];
- break;
- default:
- break;
}
}
}
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 011bbd9d08..18d51007e5 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -1348,10 +1348,16 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
QChar ch = QChar::ReplacementCharacter;
int keyCode = Qt::Key_unknown;
- if ([characters length] != 0) {
+
+ // If a dead key occurs as a result of pressing a key combination then
+ // characters will have 0 length, but charactersIgnoringModifiers will
+ // have a valid character in it. This enables key combinations such as
+ // ALT+E to be used as a shortcut with an English keyboard even though
+ // pressing ALT+E will give a dead key while doing normal text input.
+ if ([characters length] != 0 || [charactersIgnoringModifiers length] != 0) {
if (((modifiers & Qt::MetaModifier) || (modifiers & Qt::AltModifier)) && ([charactersIgnoringModifiers length] != 0))
ch = QChar([charactersIgnoringModifiers characterAtIndex:0]);
- else
+ else if ([characters length] != 0)
ch = QChar([characters characterAtIndex:0]);
keyCode = [self convertKeyCode:ch];
}
diff --git a/src/plugins/platforms/windows/openglblacklists/default.json b/src/plugins/platforms/windows/openglblacklists/default.json
index 69f4a54d05..d1e9f85247 100644
--- a/src/plugins/platforms/windows/openglblacklists/default.json
+++ b/src/plugins/platforms/windows/openglblacklists/default.json
@@ -126,6 +126,21 @@
"features": [
"disable_desktopgl"
]
- }
+ },
+ {
+ "id": 11,
+ "description": "Intel driver version 8.15.10.1749 causes GPU process hangs (QTBUG-56360)",
+ "vendor_id": "0x8086",
+ "os": {
+ "type": "win"
+ },
+ "driver_version": {
+ "op": "=",
+ "value": "8.15.10.1749"
+ },
+ "features": [
+ "disable_desktopgl", "disable_d3d11", "disable_d3d9"
+ ]
+ }
]
}
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index 5449807cde..05585ba07c 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -74,9 +74,15 @@
#include <qgroupbox.h>
#include <qhash.h>
#include <qheaderview.h>
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
+#endif
+#if QT_CONFIG(mainwindow)
#include <qmainwindow.h>
+#endif
+#if QT_CONFIG(mdiarea)
#include <qmdisubwindow.h>
+#endif
#if QT_CONFIG(menubar)
#include <qmenubar.h>
#endif
@@ -97,7 +103,9 @@
#if QT_CONFIG(scrollbar)
#include <qscrollbar.h>
#endif
+#if QT_CONFIG(sizegrip)
#include <qsizegrip.h>
+#endif
#include <qstyleoption.h>
#include <qtoolbar.h>
#if QT_CONFIG(toolbutton)
@@ -834,7 +842,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
else if (qobject_cast<const QProgressBar *>(widg))
ct = QStyle::CT_ProgressBar;
#endif
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
else if (qobject_cast<const QLineEdit *>(widg))
ct = QStyle::CT_LineEdit;
#endif
@@ -844,7 +852,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
else if (qobject_cast<const QMenuBar *>(widg))
ct = QStyle::CT_MenuBar;
#endif
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
else if (qobject_cast<const QSizeGrip *>(widg))
ct = QStyle::CT_SizeGrip;
#endif
@@ -932,7 +940,7 @@ static QSize qt_aqua_get_known_size(QStyle::ContentsType ct, const QWidget *widg
gbi.size = sz == QStyleHelper::SizeSmall ? kHIThemeGrowBoxSizeSmall : kHIThemeGrowBoxSizeNormal;
if (HIThemeGetGrowBoxBounds(&p, &gbi, &r) == noErr) {
int width = 0;
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
if (widg && qobject_cast<QMdiSubWindow *>(widg->parentWidget()))
width = r.size.width;
#endif
@@ -1120,7 +1128,7 @@ static QStyleHelper::WidgetSizePolicy qt_aqua_guess_size(const QWidget *widg, QS
return QStyleHelper::SizeLarge;
}
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
if (qEnvironmentVariableIsSet("QWIDGET_ALL_SMALL")) {
//if (small.width() != -1 || small.height() != -1)
return QStyleHelper::SizeSmall;
@@ -2277,7 +2285,7 @@ void QMacStyle::unpolish(QApplication *)
void QMacStyle::polish(QWidget* w)
{
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (qobject_cast<QMenu*>(w)
#if QT_CONFIG(combobox)
|| qobject_cast<QComboBoxPrivateContainer *>(w)
@@ -2336,7 +2344,7 @@ void QMacStyle::polish(QWidget* w)
void QMacStyle::unpolish(QWidget* w)
{
if (
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
qobject_cast<QMenu*>(w) &&
#endif
!w->testAttribute(Qt::WA_SetPalette)) {
@@ -2444,7 +2452,7 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW
ret = 15; // I hate having magic numbers in here...
break;
case PM_DefaultFrameWidth:
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
if (widget && (widget->isWindow() || !widget->parentWidget()
|| (qobject_cast<const QMainWindow*>(widget->parentWidget())
&& static_cast<QMainWindow *>(widget->parentWidget())->centralWidget() == widget))
@@ -3057,7 +3065,7 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w
opt->rect.width(), opt->rect.height() - 8);
HIThemeMenuDrawInfo mdi;
mdi.version = 0;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (w && qobject_cast<QMenu *>(w->parentWidget()))
mdi.menuType = kThemeMenuTypeHierarchical;
else
@@ -3508,7 +3516,7 @@ void QMacStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPai
// Draw the focus frame for widgets other than QLineEdit (e.g. for line edits in Webkit).
// Focus frame is drawn outside the rectangle passed in the option-rect.
if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
if ((opt->state & State_HasFocus) && !qobject_cast<const QLineEdit*>(w)) {
int vmargin = pixelMetric(QStyle::PM_FocusFrameVMargin);
int hmargin = pixelMetric(QStyle::PM_FocusFrameHMargin);
@@ -4586,7 +4594,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
// the title bar. The following code fills the toolBar area with transparent pixels
// to make that gradient visible.
if (w) {
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(w->window())) {
if (toolBar && toolBar->toolBarArea == Qt::TopToolBarArea && mainWindow->unifiedTitleAndToolBarOnMac()) {
@@ -5468,7 +5476,7 @@ void QMacStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComplex
[slider.cell stopTracking:pressPoint at:pressPoint inView:slider mouseIsUp:NO];
}
break;
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
if (sb->frame && (sb->subControls & SC_SpinBoxFrame)) {
@@ -6192,7 +6200,7 @@ QRect QMacStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex *op
}
}
break;
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CC_SpinBox:
if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
QStyleHelper::WidgetSizePolicy aquaSize = d->effectiveAquaSizeConstrain(spin, widget);
@@ -6303,7 +6311,7 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
bool useAquaGuideline = true;
switch (ct) {
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CT_SpinBox:
if (const QStyleOptionSpinBox *vopt = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
// Add button + frame widths
@@ -6667,7 +6675,7 @@ bool QMacStyle::event(QEvent *e)
QWidget *top = f->parentWidget();
while (top && !top->isWindow() && !(top->windowType() == Qt::SubWindow))
top = top->parentWidget();
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
if (qobject_cast<QMainWindow *>(top)) {
QWidget *central = static_cast<QMainWindow *>(top)->centralWidget();
for (const QWidget *par = f; par; par = par->parentWidget()) {
diff --git a/src/plugins/styles/mac/qmacstyle_mac_p_p.h b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
index 69de4c960d..399edd82d4 100644
--- a/src/plugins/styles/mac/qmacstyle_mac_p_p.h
+++ b/src/plugins/styles/mac/qmacstyle_mac_p_p.h
@@ -74,11 +74,15 @@
#include <qhash.h>
#include <qheaderview.h>
#include <qlayout.h>
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
+#endif
#if QT_CONFIG(listview)
#include <qlistview.h>
#endif
+#if QT_CONFIG(mainwindow)
#include <qmainwindow.h>
+#endif
#include <qmap.h>
#if QT_CONFIG(menubar)
#include <qmenubar.h>
@@ -97,8 +101,12 @@
#if QT_CONFIG(rubberband)
#include <qrubberband.h>
#endif
+#if QT_CONFIG(sizegrip)
#include <qsizegrip.h>
+#endif
+#if QT_CONFIG(spinbox)
#include <qspinbox.h>
+#endif
#if QT_CONFIG(splitter)
#include <qsplitter.h>
#endif
diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
index 016a2f3ccc..9e6880098f 100644
--- a/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle.cpp
@@ -1173,7 +1173,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
}
}
break;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
case CE_MenuItem:
if (const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(option)) {
// windows always has a check column, regardless whether we have an icon or not
@@ -1331,7 +1331,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
}
}
break;
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
case CE_HeaderSection:
if (const QStyleOptionHeader *header = qstyleoption_cast<const QStyleOptionHeader *>(option)) {
partId = HP_HEADERITEM;
@@ -1772,7 +1772,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
}
}
break;
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(option))
{
@@ -1830,7 +1830,7 @@ void QWindowsVistaStyle::drawComplexControl(ComplexControl control, const QStyle
}
}
break;
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
default:
QWindowsXPStyle::drawComplexControl(control, option, painter, widget);
break;
@@ -2290,11 +2290,11 @@ void QWindowsVistaStyle::polish(QApplication *app)
void QWindowsVistaStyle::polish(QWidget *widget)
{
QWindowsXPStyle::polish(widget);
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
if (qobject_cast<QLineEdit*>(widget))
widget->setAttribute(Qt::WA_Hover);
else
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
if (qobject_cast<QGroupBox*>(widget))
widget->setAttribute(Qt::WA_Hover);
else if (qobject_cast<QCommandLinkButton*>(widget)) {
@@ -2351,11 +2351,11 @@ void QWindowsVistaStyle::unpolish(QWidget *widget)
d->stopAnimation(widget);
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
if (qobject_cast<QLineEdit*>(widget))
widget->setAttribute(Qt::WA_Hover, false);
else
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
if (qobject_cast<QGroupBox*>(widget))
widget->setAttribute(Qt::WA_Hover, false);
else if (qobject_cast<QMessageBox *> (widget)) {
diff --git a/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h b/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
index a6744ff915..b649426811 100644
--- a/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
+++ b/src/plugins/styles/windowsvista/qwindowsvistastyle_p_p.h
@@ -65,12 +65,16 @@
#include <qpushbutton.h>
#endif
#include <qradiobutton.h>
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
+#endif
#include <qgroupbox.h>
#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
#endif
+#if QT_CONFIG(spinbox)
#include <qspinbox.h>
+#endif
#include <qtoolbar.h>
#if QT_CONFIG(combobox)
#include <qcombobox.h>
diff --git a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
index 347b0f28f9..0a47ccf68a 100644
--- a/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
+++ b/src/plugins/styles/windowsvista/qwindowsxpstyle.cpp
@@ -68,7 +68,9 @@
#include <qscrollbar.h>
#endif
#include <qheaderview.h>
+#if QT_CONFIG(spinbox)
#include <qspinbox.h>
+#endif
#if QT_CONFIG(listview)
#include <qlistview.h>
#endif
@@ -381,10 +383,10 @@ bool QWindowsXPStylePrivate::isLineEditBaseColorSet(const QStyleOption *option,
// Since spin box includes a line edit we need to resolve the palette mask also from
// the parent, as while the color is always correct on the palette supplied by panel,
// the mask can still be empty. If either mask specifies custom base color, use that.
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
if (const QAbstractSpinBox *spinbox = qobject_cast<QAbstractSpinBox*>(widget->parentWidget()))
resolveMask |= spinbox->palette().resolve();
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
}
return (resolveMask & (1 << QPalette::Base)) != 0;
}
@@ -1169,10 +1171,10 @@ void QWindowsXPStyle::polish(QWidget *widget)
|| qobject_cast<QScrollBar*>(widget)
|| qobject_cast<QSlider*>(widget)
|| qobject_cast<QHeaderView*>(widget)
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
|| qobject_cast<QAbstractSpinBox*>(widget)
|| qobject_cast<QSpinBox*>(widget)
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
) {
widget->setAttribute(Qt::WA_Hover);
}
@@ -1244,10 +1246,10 @@ void QWindowsXPStyle::unpolish(QWidget *widget)
|| qobject_cast<QScrollBar*>(widget)
|| qobject_cast<QSlider*>(widget)
|| qobject_cast<QHeaderView*>(widget)
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
|| qobject_cast<QAbstractSpinBox*>(widget)
|| qobject_cast<QSpinBox*>(widget)
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
) {
widget->setAttribute(Qt::WA_Hover, false);
}
@@ -2513,7 +2515,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
flags |= State_MouseOver;
switch (cc) {
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(option))
{
@@ -2565,7 +2567,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
}
break;
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
#if QT_CONFIG(combobox)
case CC_ComboBox:
if (const QStyleOptionComboBox *cmb = qstyleoption_cast<const QStyleOptionComboBox *>(option))
@@ -2728,7 +2730,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
break;
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
case CC_Slider:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(option))
{
@@ -3180,7 +3182,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
break;
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
case CC_MdiControls:
{
QRect buttonRect;
@@ -3236,7 +3238,7 @@ void QWindowsXPStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCo
}
}
break;
-#endif //QT_NO_MDIAREA
+#endif // QT_CONFIG(mdiarea)
#if QT_CONFIG(dial)
case CC_Dial:
if (const QStyleOptionSlider *dial = qstyleoption_cast<const QStyleOptionSlider *>(option))
@@ -3576,7 +3578,7 @@ QRect QWindowsXPStyle::subControlRect(ComplexControl cc, const QStyleOptionCompl
}
}
break;
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
case CC_MdiControls:
{
int numSubControls = 0;
@@ -3613,7 +3615,7 @@ QRect QWindowsXPStyle::subControlRect(ComplexControl cc, const QStyleOptionCompl
rect = QRect(offset, 0, buttonWidth, option->rect.height());
break;
}
-#endif // QT_NO_MDIAREA
+#endif // QT_CONFIG(mdiarea)
default:
rect = visualRect(option->direction, option->rect,
diff --git a/src/sql/kernel/qsqldatabase.cpp b/src/sql/kernel/qsqldatabase.cpp
index bca981a865..14374c7ca9 100644
--- a/src/sql/kernel/qsqldatabase.cpp
+++ b/src/sql/kernel/qsqldatabase.cpp
@@ -365,6 +365,14 @@ void QSqlDatabasePrivate::disable()
cloneDatabase() to create an independent database connection based
on an existing one.
+ \warning It is highly recommended that you do not keep a copy of the
+ QSqlDatabase around as a member of a class, as this will prevent the
+ instance from being correctly cleaned up on shutdown. If you need to
+ access an existing QSqlDatabase, it should be accessed with database().
+ If you chose to have a QSqlDatabase member variable, this needs to be
+ deleted before the QCoreApplication instance is deleted, otherwise it
+ may lead to undefined behavior.
+
If you create multiple database connections, specify a unique
connection name for each one, when you call addDatabase(). Use
database() with a connection name to get that connection. Use
diff --git a/src/testlib/qtestcase.cpp b/src/testlib/qtestcase.cpp
index fd68bbe461..3b5acb6b95 100644
--- a/src/testlib/qtestcase.cpp
+++ b/src/testlib/qtestcase.cpp
@@ -582,7 +582,6 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
" -import dir : Specify an import directory.\n"
" -plugins dir : Specify a directory where to search for plugins.\n"
" -input dir/file : Specify the root directory for test cases or a single test case file.\n"
- " -qtquick1 : Run with QtQuick 1 rather than QtQuick 2.\n"
" -translation file : Specify the translation file.\n"
);
}
@@ -779,7 +778,6 @@ Q_TESTLIB_EXPORT void qtest_qParseArgs(int argc, char *argv[], bool qml)
" -import : Specify an import directory.\n"
" -plugins : Specify a directory where to search for plugins.\n"
" -input : Specify the root directory for test cases.\n"
- " -qtquick1 : Run with QtQuick 1 rather than QtQuick 2.\n"
);
}
diff --git a/src/widgets/accessible/complexwidgets.cpp b/src/widgets/accessible/complexwidgets.cpp
index 7c19c5d20c..0f88554415 100644
--- a/src/widgets/accessible/complexwidgets.cpp
+++ b/src/widgets/accessible/complexwidgets.cpp
@@ -52,7 +52,9 @@
#if QT_CONFIG(combobox)
#include <qcombobox.h>
#endif
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
+#endif
#include <qstyle.h>
#include <qstyleoption.h>
#include <qtooltip.h>
diff --git a/src/widgets/accessible/qaccessiblemenu.cpp b/src/widgets/accessible/qaccessiblemenu.cpp
index 715bf1c53f..d20c5bfc71 100644
--- a/src/widgets/accessible/qaccessiblemenu.cpp
+++ b/src/widgets/accessible/qaccessiblemenu.cpp
@@ -39,7 +39,9 @@
#include "qaccessiblemenu_p.h"
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#if QT_CONFIG(menubar)
#include <qmenubar.h>
#endif
@@ -50,7 +52,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QString qt_accStripAmp(const QString &text);
QString qt_accHotKey(const QString &text);
@@ -389,7 +391,7 @@ QWidget *QAccessibleMenuItem::owner() const
return m_owner;
}
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
QT_END_NAMESPACE
diff --git a/src/widgets/accessible/qaccessiblemenu_p.h b/src/widgets/accessible/qaccessiblemenu_p.h
index 35dcd9bad1..8b37e23333 100644
--- a/src/widgets/accessible/qaccessiblemenu_p.h
+++ b/src/widgets/accessible/qaccessiblemenu_p.h
@@ -59,7 +59,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
class QMenu;
class QMenuBar;
class QAction;
@@ -136,7 +136,7 @@ private:
QPointer<QWidget> m_owner; // can hold either QMenu or the QMenuBar that contains the action
};
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
QT_END_NAMESPACE
#endif // QT_NO_ACCESSIBILITY
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp
index e3dd7383b2..c96d213e7b 100644
--- a/src/widgets/accessible/qaccessiblewidget.cpp
+++ b/src/widgets/accessible/qaccessiblewidget.cpp
@@ -60,7 +60,9 @@
#include <QRubberBand>
#endif
#include <QFocusFrame>
+#if QT_CONFIG(menu)
#include <QMenu>
+#endif
#include <QtWidgets/private/qwidget_p.h>
QT_BEGIN_NAMESPACE
@@ -72,7 +74,7 @@ static QList<QWidget*> childWidgets(const QWidget *widget)
QWidget *w = qobject_cast<QWidget *>(o);
if (w && !w->isWindow()
&& !qobject_cast<QFocusFrame*>(w)
-#if !defined(QT_NO_MENU)
+#if QT_CONFIG(menu)
&& !qobject_cast<QMenu*>(w)
#endif
&& w->objectName() != QLatin1String("qt_rubberband")
diff --git a/src/widgets/accessible/qaccessiblewidgetfactory.cpp b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
index 0865281202..0bac45de27 100644
--- a/src/widgets/accessible/qaccessiblewidgetfactory.cpp
+++ b/src/widgets/accessible/qaccessiblewidgetfactory.cpp
@@ -76,7 +76,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
return iface;
if (false) {
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
} else if (classname == QLatin1String("QLineEdit")) {
if (widget->objectName() == QLatin1String("qt_spinbox_lineedit"))
iface = 0;
@@ -87,7 +87,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QComboBox")) {
iface = new QAccessibleComboBox(widget);
#endif
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
} else if (classname == QLatin1String("QAbstractSpinBox")) {
iface = new QAccessibleAbstractSpinBox(widget);
} else if (classname == QLatin1String("QSpinBox")) {
@@ -99,7 +99,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QScrollBar")) {
iface = new QAccessibleScrollBar(widget);
#endif
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
} else if (classname == QLatin1String("QAbstractSlider")) {
iface = new QAccessibleAbstractSlider(widget);
} else if (classname == QLatin1String("QSlider")) {
@@ -120,7 +120,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
iface = new QAccessibleWidget(widget, QAccessible::Dialog);
} else if (classname == QLatin1String("QMessageBox")) {
iface = new QAccessibleWidget(widget, QAccessible::AlertMessage);
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
} else if (classname == QLatin1String("QMainWindow")) {
iface = new QAccessibleMainWindow(widget);
#endif
@@ -142,7 +142,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QMenuBar")) {
iface = new QAccessibleMenuBar(widget);
#endif
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
} else if (classname == QLatin1String("QMenu")) {
iface = new QAccessibleMenu(widget);
#endif
@@ -167,7 +167,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QSplitterHandle")) {
iface = new QAccessibleWidget(widget, QAccessible::Grip);
#endif
-#if !defined(QT_NO_TEXTEDIT) && !defined(QT_NO_CURSOR)
+#if QT_CONFIG(textedit) && !defined(QT_NO_CURSOR)
} else if (classname == QLatin1String("QTextEdit")) {
iface = new QAccessibleTextEdit(widget);
} else if (classname == QLatin1String("QPlainTextEdit")) {
@@ -185,7 +185,7 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
} else if (classname == QLatin1String("QToolBox")) {
iface = new QAccessibleToolBox(widget);
#endif
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
} else if (classname == QLatin1String("QMdiArea")) {
iface = new QAccessibleMdiArea(widget);
} else if (classname == QLatin1String("QMdiSubWindow")) {
diff --git a/src/widgets/accessible/qaccessiblewidgets.cpp b/src/widgets/accessible/qaccessiblewidgets.cpp
index 0ac7d736f8..f869ab1129 100644
--- a/src/widgets/accessible/qaccessiblewidgets.cpp
+++ b/src/widgets/accessible/qaccessiblewidgets.cpp
@@ -41,11 +41,13 @@
#include "qabstracttextdocumentlayout.h"
#include "qapplication.h"
#include "qclipboard.h"
-#include "qtextedit.h"
-#include "private/qtextedit_p.h"
#include "qtextdocument.h"
#include "qtextobject.h"
+#if QT_CONFIG(textedit)
#include "qplaintextedit.h"
+#include "qtextedit.h"
+#include "private/qtextedit_p.h"
+#endif
#include "qtextboundaryfinder.h"
#if QT_CONFIG(scrollbar)
#include "qscrollbar.h"
@@ -58,8 +60,10 @@
#if QT_CONFIG(toolbox)
#include <QToolBox>
#endif
+#if QT_CONFIG(mdiarea)
#include <QMdiArea>
#include <QMdiSubWindow>
+#endif
#if QT_CONFIG(dialogbuttonbox)
#include <QDialogButtonBox>
#endif
@@ -80,8 +84,13 @@
#include <QDockWidget>
#include <private/qdockwidget_p.h>
#endif
+#if QT_CONFIG(mainwindow)
#include <QMainWindow>
+#endif
#include <QFocusFrame>
+#if QT_CONFIG(menu)
+#include <QMenu>
+#endif
#ifndef QT_NO_ACCESSIBILITY
@@ -113,7 +122,7 @@ QList<QWidget*> childWidgets(const QWidget *widget)
return widgets;
}
-#if !defined(QT_NO_TEXTEDIT) && !defined(QT_NO_CURSOR)
+#if QT_CONFIG(textedit) && !defined(QT_NO_CURSOR)
QAccessiblePlainTextEdit::QAccessiblePlainTextEdit(QWidget* o)
:QAccessibleTextWidget(o)
@@ -310,7 +319,7 @@ void QAccessibleTextEdit::scrollToSubstring(int startIndex, int endIndex)
qWarning("AccessibleTextEdit::scrollToSubstring failed!");
}
-#endif // QT_NO_TEXTEDIT && QT_NO_CURSOR
+#endif // QT_CONFIG(textedit) && QT_NO_CURSOR
#if QT_CONFIG(stackedwidget)
// ======================= QAccessibleStackedWidget ======================
@@ -375,7 +384,7 @@ QToolBox * QAccessibleToolBox::toolBox() const
#endif // QT_CONFIG(toolbox)
// ======================= QAccessibleMdiArea ======================
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
QAccessibleMdiArea::QAccessibleMdiArea(QWidget *widget)
: QAccessibleWidget(widget, QAccessible::LayeredPane)
{
@@ -495,7 +504,7 @@ QMdiSubWindow *QAccessibleMdiSubWindow::mdiSubWindow() const
{
return static_cast<QMdiSubWindow *>(object());
}
-#endif // QT_NO_MDIAREA
+#endif // QT_CONFIG(mdiarea)
#if QT_CONFIG(dialogbuttonbox)
// ======================= QAccessibleDialogButtonBox ======================
@@ -1090,7 +1099,7 @@ void QAccessibleTextWidget::replaceText(int startOffset, int endOffset, const QS
#endif // QT_NO_CURSOR
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
QAccessibleMainWindow::QAccessibleMainWindow(QWidget *widget)
: QAccessibleWidget(widget, QAccessible::Window) { }
@@ -1139,7 +1148,7 @@ QMainWindow *QAccessibleMainWindow::mainWindow() const
return qobject_cast<QMainWindow *>(object());
}
-#endif //QT_NO_MAINWINDOW
+#endif // QT_CONFIG(mainwindow)
QT_END_NAMESPACE
diff --git a/src/widgets/accessible/qaccessiblewidgets_p.h b/src/widgets/accessible/qaccessiblewidgets_p.h
index 050930243d..75e1eff694 100644
--- a/src/widgets/accessible/qaccessiblewidgets_p.h
+++ b/src/widgets/accessible/qaccessiblewidgets_p.h
@@ -132,7 +132,7 @@ protected:
virtual QWidget *viewport() const = 0;
};
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
class QAccessiblePlainTextEdit : public QAccessibleTextWidget
{
public:
@@ -184,7 +184,7 @@ protected:
QTextDocument *textDocument() const Q_DECL_OVERRIDE;
QWidget *viewport() const Q_DECL_OVERRIDE;
};
-#endif // QT_NO_TEXTEDIT
+#endif // QT_CONFIG(textedit)
#endif //QT_NO_CURSOR
class QAccessibleStackedWidget : public QAccessibleWidget
@@ -216,7 +216,7 @@ protected:
QToolBox *toolBox() const;
};
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
class QAccessibleMdiArea : public QAccessibleWidget
{
public:
@@ -246,7 +246,7 @@ public:
protected:
QMdiSubWindow *mdiSubWindow() const;
};
-#endif // QT_NO_MDIAREA
+#endif // QT_CONFIG(mdiarea)
#if QT_CONFIG(dialogbuttonbox)
class QAccessibleDialogButtonBox : public QAccessibleWidget
@@ -304,7 +304,7 @@ protected:
#endif // QT_CONFIG(dockwidget)
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
class QAccessibleMainWindow : public QAccessibleWidget
{
public:
@@ -317,7 +317,7 @@ public:
QMainWindow *mainWindow() const;
};
-#endif //QT_NO_MAINWINDOW
+#endif // QT_CONFIG(mainwindow)
#endif // QT_NO_ACCESSIBILITY
diff --git a/src/widgets/accessible/rangecontrols.cpp b/src/widgets/accessible/rangecontrols.cpp
index c890c50938..190f0aa02f 100644
--- a/src/widgets/accessible/rangecontrols.cpp
+++ b/src/widgets/accessible/rangecontrols.cpp
@@ -39,11 +39,15 @@
#include "rangecontrols_p.h"
+#if QT_CONFIG(slider)
#include <qslider.h>
+#endif
#if QT_CONFIG(dial)
#include <qdial.h>
#endif
+#if QT_CONFIG(spinbox)
#include <qspinbox.h>
+#endif
#if QT_CONFIG(scrollbar)
#include <qscrollbar.h>
#endif
@@ -51,8 +55,9 @@
#include <qstyleoption.h>
#include <qdebug.h>
#include <qglobal.h>
-#include <QDoubleSpinBox>
+#if QT_CONFIG(lineedit)
#include <QtWidgets/qlineedit.h>
+#endif
#include <qmath.h>
#include <private/qmath_p.h>
@@ -62,7 +67,7 @@ QT_BEGIN_NAMESPACE
#ifndef QT_NO_ACCESSIBILITY
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
QAccessibleAbstractSpinBox::QAccessibleAbstractSpinBox(QWidget *w)
: QAccessibleWidget(w, QAccessible::SpinBox), lineEdit(Q_NULLPTR)
{
@@ -285,7 +290,7 @@ QString QAccessibleDoubleSpinBox::text(QAccessible::Text textType) const
return QAccessibleWidget::text(textType);
}
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
#if QT_CONFIG(scrollbar)
/*!
@@ -322,7 +327,7 @@ QString QAccessibleScrollBar::text(QAccessible::Text t) const
#endif // QT_CONFIG(scrollbar)
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
/*!
\class QAccessibleSlider
\brief The QAccessibleSlider class implements the QAccessibleInterface for sliders.
@@ -399,7 +404,7 @@ QAbstractSlider *QAccessibleAbstractSlider::abstractSlider() const
return static_cast<QAbstractSlider *>(object());
}
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
#if QT_CONFIG(dial)
// ======================================= QAccessibleDial ======================================
diff --git a/src/widgets/accessible/rangecontrols_p.h b/src/widgets/accessible/rangecontrols_p.h
index 49f57fa1c6..8af86681a0 100644
--- a/src/widgets/accessible/rangecontrols_p.h
+++ b/src/widgets/accessible/rangecontrols_p.h
@@ -67,7 +67,7 @@ class QDoubleSpinBox;
class QDial;
class QAccessibleLineEdit;
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
class QAccessibleAbstractSpinBox:
public QAccessibleWidget,
public QAccessibleValueInterface,
@@ -141,7 +141,7 @@ public:
protected:
QDoubleSpinBox *doubleSpinBox() const;
};
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
#if QT_CONFIG(slider)
class QAccessibleAbstractSlider: public QAccessibleWidget, public QAccessibleValueInterface
@@ -174,7 +174,7 @@ protected:
};
#endif // QT_CONFIG(scrollbar)
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
class QAccessibleSlider : public QAccessibleAbstractSlider
{
public:
@@ -184,7 +184,7 @@ public:
protected:
QSlider *slider() const;
};
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
#if QT_CONFIG(dial)
class QAccessibleDial : public QAccessibleAbstractSlider
diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp
index b6fe003452..73de51ff45 100644
--- a/src/widgets/accessible/simplewidgets.cpp
+++ b/src/widgets/accessible/simplewidgets.cpp
@@ -60,7 +60,9 @@
#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
#endif
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#if QT_CONFIG(label)
#include <qlabel.h>
#endif
@@ -70,14 +72,17 @@
#if QT_CONFIG(lcdnumber)
#include <qlcdnumber.h>
#endif
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
#include <private/qlineedit_p.h>
+#endif
#include <qstyle.h>
#include <qstyleoption.h>
#include <qtextdocument.h>
#include <qwindow.h>
#include <private/qwindowcontainer_p.h>
#include <QtCore/qvarlengtharray.h>
+#include <QtGui/qvalidator.h>
#ifdef Q_OS_MAC
#include <qfocusframe.h>
@@ -175,7 +180,7 @@ QAccessible::State QAccessibleButton::state() const
if (pb) {
if (pb->isDefault())
state.defaultButton = true;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (pb->menu())
state.hasPopup = true;
#endif
@@ -214,7 +219,7 @@ QAccessible::Role QAccessibleButton::role() const
{
QAbstractButton *ab = button();
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (QPushButton *pb = qobject_cast<QPushButton*>(ab)) {
if (pb->menu())
return QAccessible::ButtonMenu;
@@ -257,7 +262,7 @@ void QAccessibleButton::doAction(const QString &actionName)
return;
if (actionName == pressAction() ||
actionName == showMenuAction()) {
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QPushButton *pb = qobject_cast<QPushButton*>(object());
if (pb && pb->menu())
pb->showMenu();
@@ -311,7 +316,7 @@ QToolButton *QAccessibleToolButton::toolButton() const
*/
bool QAccessibleToolButton::isSplitButton() const
{
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
return toolButton()->menu() && toolButton()->popupMode() == QToolButton::MenuButtonPopup;
#else
return false;
@@ -323,7 +328,7 @@ QAccessible::State QAccessibleToolButton::state() const
QAccessible::State st = QAccessibleButton::state();
if (toolButton()->autoRaise())
st.hotTracked = true;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (toolButton()->menu())
st.hasPopup = true;
#endif
@@ -337,7 +342,7 @@ int QAccessibleToolButton::childCount() const
QAccessible::Role QAccessibleToolButton::role() const
{
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QAbstractButton *ab = button();
QToolButton *tb = qobject_cast<QToolButton*>(ab);
if (!tb->menu())
@@ -351,7 +356,7 @@ QAccessible::Role QAccessibleToolButton::role() const
QAccessibleInterface *QAccessibleToolButton::child(int index) const
{
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (index == 0 && toolButton()->menu())
{
return QAccessible::queryAccessibleInterface(toolButton()->menu());
@@ -658,7 +663,7 @@ QStringList QAccessibleGroupBox::keyBindingsForAction(const QString &) const
#endif
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
/*!
\class QAccessibleLineEdit
\brief The QAccessibleLineEdit class implements the QAccessibleInterface for widgets with editable text
@@ -895,7 +900,7 @@ void QAccessibleLineEdit::replaceText(int startOffset, int endOffset, const QStr
lineEdit()->setText(lineEdit()->text().replace(startOffset, endOffset - startOffset, text));
}
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
#if QT_CONFIG(progressbar)
QAccessibleProgressBar::QAccessibleProgressBar(QWidget *o)
diff --git a/src/widgets/accessible/simplewidgets_p.h b/src/widgets/accessible/simplewidgets_p.h
index c25aa31425..902b403d5b 100644
--- a/src/widgets/accessible/simplewidgets_p.h
+++ b/src/widgets/accessible/simplewidgets_p.h
@@ -148,7 +148,7 @@ private:
};
#endif
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
class QAccessibleLineEdit : public QAccessibleWidget, public QAccessibleTextInterface, public QAccessibleEditableTextInterface
{
public:
@@ -188,7 +188,7 @@ protected:
QLineEdit *lineEdit() const;
friend class QAccessibleAbstractSpinBox;
};
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
#if QT_CONFIG(progressbar)
class QAccessibleProgressBar : public QAccessibleDisplay, public QAccessibleValueInterface
diff --git a/src/widgets/dialogs/qcolordialog.cpp b/src/widgets/dialogs/qcolordialog.cpp
index 9465575b3b..f3b198fdc2 100644
--- a/src/widgets/dialogs/qcolordialog.cpp
+++ b/src/widgets/dialogs/qcolordialog.cpp
@@ -49,7 +49,9 @@
#include "qlabel.h"
#include "qlayout.h"
#include "qlineedit.h"
+#if QT_CONFIG(menu)
#include "qmenu.h"
+#endif
#include "qpainter.h"
#include "qpixmap.h"
#include "qpushbutton.h"
@@ -428,7 +430,7 @@ void QWellArray::setSelected(int row, int col)
if (row >= 0)
emit selected(row, col);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (isVisible() && qobject_cast<QMenu*>(parentWidget()))
parentWidget()->close();
#endif
diff --git a/src/widgets/dialogs/qdialog.cpp b/src/widgets/dialogs/qdialog.cpp
index 9e62f79a8e..f5db4481ee 100644
--- a/src/widgets/dialogs/qdialog.cpp
+++ b/src/widgets/dialogs/qdialog.cpp
@@ -53,11 +53,15 @@
#include <private/qdesktopwidget_p.h>
#include "qapplication.h"
#include "qlayout.h"
+#if QT_CONFIG(sizegrip)
#include "qsizegrip.h"
+#endif
#if QT_CONFIG(whatsthis)
#include "qwhatsthis.h"
#endif
+#if QT_CONFIG(menu)
#include "qmenu.h"
+#endif
#include "qcursor.h"
#if QT_CONFIG(messagebox)
#include "qmessagebox.h"
@@ -621,7 +625,7 @@ bool QDialog::eventFilter(QObject *o, QEvent *e)
/*! \reimp */
void QDialog::contextMenuEvent(QContextMenuEvent *e)
{
-#if !QT_CONFIG(whatsthis) || defined(QT_NO_MENU)
+#if !QT_CONFIG(whatsthis) || !QT_CONFIG(menu)
Q_UNUSED(e);
#else
QWidget *w = childAt(e->pos());
@@ -1006,7 +1010,7 @@ void QDialog::showExtension(bool showIt)
setFixedSize(w, height() + s.height());
}
d->extension->show();
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
const bool sizeGripEnabled = isSizeGripEnabled();
setSizeGripEnabled(false);
d->sizeGripEnabled = sizeGripEnabled;
@@ -1019,7 +1023,7 @@ void QDialog::showExtension(bool showIt)
resize(d->size);
if (layout())
layout()->setEnabled(true);
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
setSizeGripEnabled(d->sizeGripEnabled);
#endif
}
@@ -1080,7 +1084,7 @@ void QDialog::setModal(bool modal)
bool QDialog::isSizeGripEnabled() const
{
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
Q_D(const QDialog);
return !!d->resizer;
#else
@@ -1091,11 +1095,11 @@ bool QDialog::isSizeGripEnabled() const
void QDialog::setSizeGripEnabled(bool enabled)
{
-#ifdef QT_NO_SIZEGRIP
+#if !QT_CONFIG(sizegrip)
Q_UNUSED(enabled);
#else
Q_D(QDialog);
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
d->sizeGripEnabled = enabled;
if (enabled && d->doShowExtension)
return;
@@ -1116,7 +1120,7 @@ void QDialog::setSizeGripEnabled(bool enabled)
d->resizer = 0;
}
}
-#endif //QT_NO_SIZEGRIP
+#endif // QT_CONFIG(sizegrip)
}
@@ -1124,7 +1128,7 @@ void QDialog::setSizeGripEnabled(bool enabled)
/*! \reimp */
void QDialog::resizeEvent(QResizeEvent *)
{
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
Q_D(QDialog);
if (d->resizer) {
if (isRightToLeft())
diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h
index 9ee89863f6..2ed414bd45 100644
--- a/src/widgets/dialogs/qdialog_p.h
+++ b/src/widgets/dialogs/qdialog_p.h
@@ -78,7 +78,7 @@ public:
mainDef(0),
#endif
orientation(Qt::Horizontal),extension(0), doShowExtension(false),
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
resizer(0),
sizeGripEnabled(false),
#endif
@@ -99,7 +99,7 @@ public:
QWidget *extension;
bool doShowExtension;
QSize size, min, max;
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
QSizeGrip *resizer;
bool sizeGripEnabled;
#endif
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp
index 8d0161d96b..8d37969be4 100644
--- a/src/widgets/dialogs/qfiledialog.cpp
+++ b/src/widgets/dialogs/qfiledialog.cpp
@@ -50,7 +50,9 @@
#include <qheaderview.h>
#include <qshortcut.h>
#include <qgridlayout.h>
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#if QT_CONFIG(messagebox)
#include <qmessagebox.h>
#endif
@@ -3353,7 +3355,7 @@ void QFileDialogPrivate::_q_showDetailsView()
*/
void QFileDialogPrivate::_q_showContextMenu(const QPoint &position)
{
-#ifdef QT_NO_MENU
+#if !QT_CONFIG(menu)
Q_UNUSED(position);
#else
Q_Q(QFileDialog);
@@ -3382,7 +3384,7 @@ void QFileDialogPrivate::_q_showContextMenu(const QPoint &position)
menu.addAction(newFolderAction);
}
menu.exec(view->viewport()->mapToGlobal(position));
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
}
/*!
diff --git a/src/widgets/dialogs/qmessagebox.cpp b/src/widgets/dialogs/qmessagebox.cpp
index 0693f4bea8..fdfffb45cf 100644
--- a/src/widgets/dialogs/qmessagebox.cpp
+++ b/src/widgets/dialogs/qmessagebox.cpp
@@ -54,8 +54,12 @@
#include <QtGui/qicon.h>
#include <QtGui/qtextdocument.h>
#include <QtWidgets/qapplication.h>
+#if QT_CONFIG(textedit)
#include <QtWidgets/qtextedit.h>
+#endif
+#if QT_CONFIG(menu)
#include <QtWidgets/qmenu.h>
+#endif
#include "qdialog_p.h"
#include <QtGui/qfont.h>
#include <QtGui/qfontmetrics.h>
@@ -84,7 +88,7 @@ enum Button { Old_Ok = 1, Old_Cancel = 2, Old_Yes = 3, Old_No = 4, Old_Abort = 5
NewButtonMask = 0xFFFFFC00 };
enum DetailButtonLabel { ShowLabel = 0, HideLabel = 1 };
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
class QMessageBoxDetailsText : public QWidget
{
Q_OBJECT
@@ -153,7 +157,7 @@ private:
bool copyAvailable;
TextEdit *textEdit;
};
-#endif // QT_NO_TEXTEDIT
+#endif // QT_CONFIG(textedit)
class DetailButton : public QPushButton
{
@@ -193,7 +197,7 @@ class QMessageBoxPrivate : public QDialogPrivate
public:
QMessageBoxPrivate() : escapeButton(0), defaultButton(0), checkbox(0), clickedButton(0), detailsButton(0),
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
detailsText(0),
#endif
compatMode(false), autoAddOkButton(true),
@@ -243,7 +247,7 @@ public:
QCheckBox *checkbox;
QAbstractButton *clickedButton;
DetailButton *detailsButton;
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
QMessageBoxDetailsText *detailsText;
#endif
bool compatMode;
@@ -464,7 +468,7 @@ int QMessageBoxPrivate::execReturnCode(QAbstractButton *button)
void QMessageBoxPrivate::_q_buttonClicked(QAbstractButton *button)
{
Q_Q(QMessageBox);
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
if (detailsButton && detailsText && button == detailsButton) {
detailsButton->setLabel(detailsText->isHidden() ? HideLabel : ShowLabel);
detailsText->setHidden(!detailsText->isHidden());
@@ -1418,7 +1422,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
#if !defined(QT_NO_CLIPBOARD) && !defined(QT_NO_SHORTCUT)
-#if !defined(QT_NO_TEXTEDIT)
+#if QT_CONFIG(textedit)
if (e == QKeySequence::Copy) {
if (d->detailsText && d->detailsText->isVisible() && d->detailsText->copy()) {
e->setAccepted(true);
@@ -1429,7 +1433,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
e->setAccepted(true);
return;
}
-#endif // !QT_NO_TEXTEDIT
+#endif // QT_CONFIG(textedit)
#if defined(Q_OS_WIN)
if (e == QKeySequence::Copy) {
@@ -1445,7 +1449,7 @@ void QMessageBox::keyPressEvent(QKeyEvent *e)
for (const auto *button : buttons)
textToCopy += button->text() + QLatin1String(" ");
textToCopy += QLatin1Char('\n') + separator;
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
if (d->detailsText)
textToCopy += d->detailsText->text() + QLatin1Char('\n') + separator;
#endif
@@ -1983,7 +1987,7 @@ int QMessageBoxPrivate::showOldMessageBox(QWidget *parent, QMessageBox::Icon ico
void QMessageBoxPrivate::retranslateStrings()
{
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
if (detailsButton)
detailsButton->setLabel(detailsText->isHidden() ? ShowLabel : HideLabel);
#endif
@@ -2438,7 +2442,7 @@ void QMessageBox::setButtonText(int button, const QString &text)
}
}
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
/*!
\property QMessageBox::detailedText
\brief the text to be displayed in the details area.
@@ -2486,7 +2490,7 @@ void QMessageBox::setDetailedText(const QString &text)
}
d->setupLayout();
}
-#endif // QT_NO_TEXTEDIT
+#endif // QT_CONFIG(textedit)
/*!
\property QMessageBox::informativeText
diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h
index 6d5179602b..fd7d7936b6 100644
--- a/src/widgets/dialogs/qmessagebox.h
+++ b/src/widgets/dialogs/qmessagebox.h
@@ -61,7 +61,7 @@ class Q_WIDGETS_EXPORT QMessageBox : public QDialog
Q_PROPERTY(QPixmap iconPixmap READ iconPixmap WRITE setIconPixmap)
Q_PROPERTY(Qt::TextFormat textFormat READ textFormat WRITE setTextFormat)
Q_PROPERTY(StandardButtons standardButtons READ standardButtons WRITE setStandardButtons)
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
Q_PROPERTY(QString detailedText READ detailedText WRITE setDetailedText)
#endif
Q_PROPERTY(QString informativeText READ informativeText WRITE setInformativeText)
@@ -270,7 +270,7 @@ public:
QString informativeText() const;
void setInformativeText(const QString &text);
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
QString detailedText() const;
void setDetailedText(const QString &text);
#endif
diff --git a/src/widgets/dialogs/qsidebar.cpp b/src/widgets/dialogs/qsidebar.cpp
index b8b042ddb5..f77b10ecbc 100644
--- a/src/widgets/dialogs/qsidebar.cpp
+++ b/src/widgets/dialogs/qsidebar.cpp
@@ -42,7 +42,9 @@
#include <qaction.h>
#include <qurl.h>
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#include <qmimedata.h>
#include <qevent.h>
#include <qdebug.h>
@@ -435,7 +437,7 @@ void QSidebar::selectUrl(const QUrl &url)
this, SLOT(clicked(QModelIndex)));
}
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
/*!
\internal
@@ -454,7 +456,7 @@ void QSidebar::showContextMenu(const QPoint &position)
if (actions.count() > 0)
QMenu::exec(actions, mapToGlobal(position));
}
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
/*!
\internal
diff --git a/src/widgets/dialogs/qsidebar_p.h b/src/widgets/dialogs/qsidebar_p.h
index 17d576e54d..1f27d477a8 100644
--- a/src/widgets/dialogs/qsidebar_p.h
+++ b/src/widgets/dialogs/qsidebar_p.h
@@ -148,7 +148,7 @@ protected:
private Q_SLOTS:
void clicked(const QModelIndex &index);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void showContextMenu(const QPoint &position);
#endif
void removeEntry();
diff --git a/src/widgets/dialogs/qwizard.cpp b/src/widgets/dialogs/qwizard.cpp
index 3d9b6a3d62..22499b3c22 100644
--- a/src/widgets/dialogs/qwizard.cpp
+++ b/src/widgets/dialogs/qwizard.cpp
@@ -40,7 +40,9 @@
#include "qwizard.h"
#include <QtWidgets/private/qtwidgetsglobal_p.h>
+#if QT_CONFIG(spinbox)
#include "qabstractspinbox.h"
+#endif
#include "qalgorithms.h"
#include "qapplication.h"
#include "qboxlayout.h"
@@ -50,7 +52,9 @@
#include "qevent.h"
#include "qframe.h"
#include "qlabel.h"
+#if QT_CONFIG(lineedit)
#include "qlineedit.h"
+#endif
#include "qpainter.h"
#include "qwindow.h"
#include "qpushbutton.h"
@@ -3680,13 +3684,13 @@ bool QWizardPage::isComplete() const
if (value == field.initialValue)
return false;
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
if (QLineEdit *lineEdit = qobject_cast<QLineEdit *>(field.object)) {
if (!lineEdit->hasAcceptableInput())
return false;
}
#endif
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
if (QAbstractSpinBox *spinBox = qobject_cast<QAbstractSpinBox *>(field.object)) {
if (!spinBox->hasAcceptableInput())
return false;
diff --git a/src/widgets/graphicsview/qgraphicsproxywidget.cpp b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
index ebd245c4e7..94ce102a68 100644
--- a/src/widgets/graphicsview/qgraphicsproxywidget.cpp
+++ b/src/widgets/graphicsview/qgraphicsproxywidget.cpp
@@ -53,8 +53,12 @@
#include <QtGui/qpainter.h>
#include <QtWidgets/qstyleoption.h>
#include <QtWidgets/qgraphicsview.h>
+#if QT_CONFIG(lineedit)
#include <QtWidgets/qlineedit.h>
+#endif
+#if QT_CONFIG(textedit)
#include <QtWidgets/qtextedit.h>
+#endif
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/itemviews/qabstractitemdelegate.cpp b/src/widgets/itemviews/qabstractitemdelegate.cpp
index fd4699409c..d532221092 100644
--- a/src/widgets/itemviews/qabstractitemdelegate.cpp
+++ b/src/widgets/itemviews/qabstractitemdelegate.cpp
@@ -49,10 +49,15 @@
#include <qevent.h>
#include <qstring.h>
#include <qdebug.h>
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
+#endif
+#if QT_CONFIG(textedit)
#include <qtextedit.h>
#include <qplaintextedit.h>
+#endif
#include <qapplication.h>
+#include <qvalidator.h>
#include <private/qtextengine_p.h>
#include <private/qabstractitemdelegate_p.h>
@@ -432,7 +437,7 @@ QAbstractItemDelegatePrivate::QAbstractItemDelegatePrivate()
static bool editorHandlesKeyEvent(QWidget *editor, const QKeyEvent *event)
{
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
// do not filter enter / return / tab / backtab for QTextEdit or QPlainTextEdit
if (qobject_cast<QTextEdit *>(editor) || qobject_cast<QPlainTextEdit *>(editor)) {
switch (event->key()) {
@@ -446,7 +451,7 @@ static bool editorHandlesKeyEvent(QWidget *editor, const QKeyEvent *event)
break;
}
}
-#endif // QT_NO_TEXTEDIT
+#endif // QT_CONFIG(textedit)
Q_UNUSED(editor);
Q_UNUSED(event);
@@ -535,7 +540,7 @@ bool QAbstractItemDelegatePrivate::editorEventFilter(QObject *object, QEvent *ev
bool QAbstractItemDelegatePrivate::tryFixup(QWidget *editor)
{
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
if (QLineEdit *e = qobject_cast<QLineEdit*>(editor)) {
if (!e->hasAcceptableInput()) {
#if QT_CONFIG(validator)
@@ -550,7 +555,7 @@ bool QAbstractItemDelegatePrivate::tryFixup(QWidget *editor)
}
#else
Q_UNUSED(editor)
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
return true;
}
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index ed87de4e18..fe27be8522 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -49,8 +49,12 @@
#include <qscrollbar.h>
#include <qtooltip.h>
#include <qdatetime.h>
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
+#endif
+#if QT_CONFIG(spinbox)
#include <qspinbox.h>
+#endif
#include <qheaderview.h>
#include <qstyleditemdelegate.h>
#include <private/qabstractitemview_p.h>
@@ -4228,11 +4232,11 @@ QWidget *QAbstractItemViewPrivate::editor(const QModelIndex &index,
QWidget *focusWidget = w;
while (QWidget *fp = focusWidget->focusProxy())
focusWidget = fp;
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
if (QLineEdit *le = qobject_cast<QLineEdit*>(focusWidget))
le->selectAll();
#endif
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
if (QSpinBox *sb = qobject_cast<QSpinBox*>(focusWidget))
sb->selectAll();
else if (QDoubleSpinBox *dsb = qobject_cast<QDoubleSpinBox*>(focusWidget))
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index 54b7c6666f..b580f0e840 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -50,8 +50,12 @@
#if QT_CONFIG(label)
#include <qlabel.h>
#endif
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
+#endif
+#if QT_CONFIG(spinbox)
#include <qspinbox.h>
+#endif
#include <qstyle.h>
#include <qstyleoption.h>
#include <limits.h>
@@ -80,7 +84,7 @@ public:
#endif // QT_CONFIG(combobox)
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
class QUIntSpinBox : public QSpinBox
{
@@ -107,7 +111,7 @@ Q_SIGNALS:
void uintValueChanged();
};
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
/*!
\class QItemEditorFactory
@@ -242,7 +246,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
cb->setFrame(false);
return cb; }
#endif
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case QVariant::UInt: {
QSpinBox *sb = new QUIntSpinBox(parent);
sb->setFrame(false);
@@ -274,7 +278,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
case QVariant::Pixmap:
return new QLabel(parent);
#endif
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case QVariant::Double: {
QDoubleSpinBox *sb = new QDoubleSpinBox(parent);
sb->setFrame(false);
@@ -282,7 +286,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
sb->setMaximum(DBL_MAX);
return sb; }
#endif
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
case QVariant::String:
default: {
// the default editor is a lineedit
@@ -306,7 +310,7 @@ QByteArray QDefaultItemEditorFactory::valuePropertyName(int userType) const
case QVariant::Bool:
return "currentIndex";
#endif
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case QVariant::UInt:
case QVariant::Int:
case QVariant::Double:
@@ -535,7 +539,7 @@ QItemEditorCreatorBase::~QItemEditorCreatorBase()
\reimp
*/
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
QExpandingLineEdit::QExpandingLineEdit(QWidget *parent)
: QLineEdit(parent), originalWidth(-1), widgetOwnsGeometry(false)
@@ -595,7 +599,7 @@ void QExpandingLineEdit::resizeToContents()
}
}
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
#if QT_CONFIG(combobox)
@@ -620,7 +624,7 @@ bool QBooleanComboBox::value() const
QT_END_NAMESPACE
-#if !defined(QT_NO_LINEEDIT) || QT_CONFIG(combobox)
+#if QT_CONFIG(lineedit) || QT_CONFIG(combobox)
#include "qitemeditorfactory.moc"
#endif
diff --git a/src/widgets/itemviews/qitemeditorfactory_p.h b/src/widgets/itemviews/qitemeditorfactory_p.h
index 409ecc684f..46a8da1d8f 100644
--- a/src/widgets/itemviews/qitemeditorfactory_p.h
+++ b/src/widgets/itemviews/qitemeditorfactory_p.h
@@ -53,9 +53,9 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#include <qlineedit.h>
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
+#include <qlineedit.h>
QT_REQUIRE_CONFIG(itemviews);
@@ -89,6 +89,6 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
#endif //QITEMEDITORFACTORY_P_H
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index bda3325adb..716df2c729 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -42,9 +42,13 @@
#include <qabstractitemmodel.h>
#include <qapplication.h>
#include <qbrush.h>
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
+#endif
+#if QT_CONFIG(textedit)
#include <qtextedit.h>
#include <qplaintextedit.h>
+#endif
#include <qpainter.h>
#include <qpalette.h>
#include <qpoint.h>
@@ -501,7 +505,7 @@ void QStyledItemDelegate::updateEditorGeometry(QWidget *editor,
// let the editor take up all available space
//if the editor is not a QLineEdit
//or it is in a QTableView
-#if QT_CONFIG(tableview) && !defined(QT_NO_LINEEDIT)
+#if QT_CONFIG(tableview) && QT_CONFIG(lineedit)
if (qobject_cast<QExpandingLineEdit*>(editor) && !qobject_cast<const QTableView*>(widget))
opt.showDecorationSelected = editor->style()->styleHint(QStyle::SH_ItemView_ShowDecorationSelected, 0, editor);
else
diff --git a/src/widgets/kernel/qaction.cpp b/src/widgets/kernel/qaction.cpp
index a7116b1462..2813340ea2 100644
--- a/src/widgets/kernel/qaction.cpp
+++ b/src/widgets/kernel/qaction.cpp
@@ -48,7 +48,9 @@
#include "qstylehints.h"
#include <private/qshortcutmap_p.h>
#include <private/qapplication_p.h>
+#if QT_CONFIG(menu)
#include <private/qmenu_p.h>
+#endif
#include <private/qdebug_p.h>
#define QAPP_CHECK(functionName) \
@@ -645,7 +647,7 @@ QIcon QAction::icon() const
return d->icon;
}
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
/*!
Returns the menu contained by this action. Actions that contain
menus can be used to create menu items with submenus, or inserted
@@ -672,7 +674,7 @@ void QAction::setMenu(QMenu *menu)
menu->d_func()->setOverrideMenuAction(this);
d->sendDataChanged();
}
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
/*!
If \a b is true then this action will be considered a separator.
diff --git a/src/widgets/kernel/qaction.h b/src/widgets/kernel/qaction.h
index ca127ef51a..e1d431100e 100644
--- a/src/widgets/kernel/qaction.h
+++ b/src/widgets/kernel/qaction.h
@@ -121,7 +121,7 @@ public:
void setPriority(Priority priority);
Priority priority() const;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QMenu *menu() const;
void setMenu(QMenu *menu);
#endif
diff --git a/src/widgets/kernel/qaction_p.h b/src/widgets/kernel/qaction_p.h
index 4c1537b63b..19ae47c7b9 100644
--- a/src/widgets/kernel/qaction_p.h
+++ b/src/widgets/kernel/qaction_p.h
@@ -53,7 +53,9 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "QtWidgets/qaction.h"
+#if QT_CONFIG(menu)
#include "QtWidgets/qmenu.h"
+#endif
#if QT_CONFIG(graphicsview)
#include "private/qgraphicswidget_p.h"
#endif
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp
index 56edd019bb..1e455b0d64 100644
--- a/src/widgets/kernel/qlayout.cpp
+++ b/src/widgets/kernel/qlayout.cpp
@@ -45,7 +45,9 @@
#include "qmenubar.h"
#endif
#include "qtoolbar.h"
+#if QT_CONFIG(sizegrip)
#include "qsizegrip.h"
+#endif
#include "qevent.h"
#include "qstyle.h"
#include "qvariant.h"
diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp
index 18376bb183..0585a59e89 100644
--- a/src/widgets/kernel/qshortcut.cpp
+++ b/src/widgets/kernel/qshortcut.cpp
@@ -45,7 +45,9 @@
#if QT_CONFIG(whatsthis)
#include <qwhatsthis.h>
#endif
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#if QT_CONFIG(menubar)
#include <qmenubar.h>
#endif
@@ -276,7 +278,7 @@ static bool correctActionContext(Qt::ShortcutContext context, QAction *a, QWidge
#endif
for (int i = 0; i < widgets.size(); ++i) {
QWidget *w = widgets.at(i);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (QMenu *menu = qobject_cast<QMenu *>(w)) {
#ifdef Q_OS_DARWIN
// On Mac, menu item shortcuts are processed before reaching any window.
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index b8ec5774b0..05bd6ea04b 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -45,7 +45,9 @@
#include "qdesktopwidget_p.h"
#include "qevent.h"
#include "qlayout.h"
+#if QT_CONFIG(menu)
#include "qmenu.h"
+#endif
#include "qmetaobject.h"
#include "qpixmap.h"
#include "qpointer.h"
@@ -8983,7 +8985,7 @@ bool QWidget::event(QEvent *event)
case Qt::CustomContextMenu:
emit customContextMenuRequested(static_cast<QContextMenuEvent *>(event)->pos());
break;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
case Qt::ActionsContextMenu:
if (d->actions.count()) {
QMenu::exec(d->actions, static_cast<QContextMenuEvent *>(event)->globalPos(),
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index e509f522d8..d2ad7a466e 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -44,7 +44,9 @@
#include <qpa/qplatformintegration.h>
#include <QDebug>
+#if QT_CONFIG(mdiarea)
#include <QMdiSubWindow>
+#endif
#include <QAbstractScrollArea>
QT_BEGIN_NAMESPACE
@@ -98,7 +100,7 @@ public:
QWidget *p = q->parentWidget();
while (p) {
if (false
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
|| qobject_cast<QMdiSubWindow *>(p) != 0
#endif
#if QT_CONFIG(scrollarea)
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp
index 1f3198907f..0ad508afd2 100644
--- a/src/widgets/styles/qcommonstyle.cpp
+++ b/src/widgets/styles/qcommonstyle.cpp
@@ -65,11 +65,15 @@
#include <qgroupbox.h>
#endif
#include <qmath.h>
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#include <qpainter.h>
#include <qpaintengine.h>
#include <qpainterpath.h>
+#if QT_CONFIG(slider)
#include <qslider.h>
+#endif
#include <qstyleoption.h>
#if QT_CONFIG(tabbar)
#include <qtabbar.h>
@@ -512,7 +516,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
break;
}
#endif // QT_NO_TOOLBAR
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case PE_IndicatorSpinPlus:
case PE_IndicatorSpinMinus: {
QRect r = opt->rect;
@@ -570,7 +574,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
}
p->restore();
break; }
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
case PE_PanelTipLabel: {
const QBrush brush(opt->palette.toolTipBase());
qDrawPlainRect(p, opt->rect, opt->palette.toolTipText().color(), 1, &brush);
@@ -611,7 +615,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
}
break;
#endif // QT_CONFIG(tabbar)
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
case PE_PanelLineEdit:
if (const QStyleOptionFrame *panel = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
p->fillRect(panel->rect.adjusted(panel->lineWidth, panel->lineWidth, -panel->lineWidth, -panel->lineWidth),
@@ -621,7 +625,7 @@ void QCommonStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, Q
proxy()->drawPrimitive(PE_FrameLineEdit, panel, p, widget);
}
break;
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
#if QT_CONFIG(columnview)
case PE_IndicatorColumnViewArrow: {
if (const QStyleOptionViewItem *viewOpt = qstyleoption_cast<const QStyleOptionViewItem *>(opt)) {
@@ -1371,7 +1375,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
}
}
break;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
case CE_MenuScroller: {
QStyleOption arrowOpt = *opt;
arrowOpt.state |= State_Enabled;
@@ -1391,7 +1395,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
p->drawLine(opt->rect.x() + 2, opt->rect.y() + opt->rect.height() / 2,
opt->rect.x() + opt->rect.width() - 4, opt->rect.y() + opt->rect.height() / 2);
break;
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
#if QT_CONFIG(menubar)
case CE_MenuBarItem:
if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
@@ -1940,7 +1944,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
}
break;
#endif // QT_CONFIG(tabbar)
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
case CE_SizeGrip: {
p->save();
int x, y, w, h;
@@ -2013,7 +2017,7 @@ void QCommonStyle::drawControl(ControlElement element, const QStyleOption *opt,
}
p->restore();
break; }
-#endif // QT_NO_SIZEGRIP
+#endif // QT_CONFIG(sizegrip)
#if QT_CONFIG(rubberband)
case CE_RubberBand: {
if (const QStyleOptionRubberBand *rbOpt = qstyleoption_cast<const QStyleOptionRubberBand *>(opt)) {
@@ -2472,7 +2476,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
r = visualRect(btn->direction, btn->rect, r);
}
break;
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
case SE_SliderFocusRect:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget);
@@ -2485,7 +2489,7 @@ QRect QCommonStyle::subElementRect(SubElement sr, const QStyleOption *opt,
r = visualRect(opt->direction, opt->rect, r);
}
break;
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
#if QT_CONFIG(progressbar)
case SE_ProgressBarGroove:
case SE_ProgressBarContents:
@@ -3140,7 +3144,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
QPainter *p, const QWidget *widget) const
{
switch (cc) {
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
case CC_Slider:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
if (slider->subControls == SC_SliderTickmarks) {
@@ -3196,7 +3200,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
}
break;
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
#if QT_CONFIG(scrollbar)
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
@@ -3285,7 +3289,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
break;
#endif // QT_CONFIG(scrollbar)
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
QStyleOptionSpinBox copy = *sb;
@@ -3349,7 +3353,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
}
break;
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
#if QT_CONFIG(toolbutton)
case CC_ToolButton:
if (const QStyleOptionToolButton *toolbutton
@@ -3745,7 +3749,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
break;
#endif // QT_CONFIG(groupbox)
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
case CC_MdiControls:
{
QStyleOptionButton btnOpt;
@@ -3808,7 +3812,7 @@ void QCommonStyle::drawComplexControl(ComplexControl cc, const QStyleOptionCompl
}
}
break;
-#endif // QT_NO_MDIAREA
+#endif // QT_CONFIG(mdiarea)
default:
qWarning("QCommonStyle::drawComplexControl: Control %d not handled", cc);
}
@@ -3822,7 +3826,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
{
SubControl sc = SC_None;
switch (cc) {
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
case CC_Slider:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
QRect r = proxy()->subControlRect(cc, slider, SC_SliderHandle, widget);
@@ -3835,7 +3839,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
}
}
break;
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
#if QT_CONFIG(scrollbar)
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
@@ -3868,7 +3872,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
}
break;
#endif // QT_CONFIG(toolbutton)
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CC_SpinBox:
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
QRect r;
@@ -3883,7 +3887,7 @@ QStyle::SubControl QCommonStyle::hitTestComplexControl(ComplexControl cc, const
}
}
break;
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
case CC_TitleBar:
if (const QStyleOptionTitleBar *tb = qstyleoption_cast<const QStyleOptionTitleBar *>(opt)) {
QRect r;
@@ -3959,7 +3963,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
{
QRect ret;
switch (cc) {
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
case CC_Slider:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
int tickOffset = proxy()->pixelMetric(PM_SliderTickmarkOffset, slider, widget);
@@ -3994,7 +3998,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
ret = visualRect(slider->direction, slider->rect, ret);
}
break;
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
#if QT_CONFIG(scrollbar)
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
@@ -4080,7 +4084,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
}
break;
#endif // QT_CONFIG(scrollbar)
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CC_SpinBox:
if (const QStyleOptionSpinBox *spinbox = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
QSize bs;
@@ -4339,7 +4343,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
break;
}
#endif // QT_CONFIG(groupbox)
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
case CC_MdiControls:
{
int numSubControls = 0;
@@ -4382,7 +4386,7 @@ QRect QCommonStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
ret = QRect(offset, 0, buttonWidth, opt->rect.height());
break;
}
-#endif // QT_NO_MDIAREA
+#endif // QT_CONFIG(mdiarea)
default:
qWarning("QCommonStyle::subControlRect: Case %d not handled", cc);
}
@@ -4497,7 +4501,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
ret = QGuiApplicationPrivate::platformTheme()->themeHint(QPlatformTheme::MaximumScrollBarDragDistance).toInt();
break;
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
case PM_SliderThickness:
ret = int(QStyleHelper::dpiScaled(16.));
break;
@@ -4530,7 +4534,7 @@ int QCommonStyle::pixelMetric(PixelMetric m, const QStyleOption *opt, const QWid
ret = 0;
}
break;
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
#if QT_CONFIG(dockwidget)
case PM_DockWidgetSeparatorExtent:
ret = int(QStyleHelper::dpiScaled(6.));
@@ -4812,7 +4816,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz.setHeight(qMax(sz.height(), h));
}
break;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
case CT_MenuItem:
if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
bool checkable = mi->menuHasCheckableItems;
@@ -4840,7 +4844,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QSize(w, h);
}
break;
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
#if QT_CONFIG(toolbutton)
case CT_ToolButton:
sz = QSize(sz.width() + 6, sz.height() + 5);
@@ -4917,7 +4921,7 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
#else
Q_UNUSED(d);
#endif // QT_CONFIG(itemviews)
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CT_SpinBox:
if (const QStyleOptionSpinBox *vopt = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
// Add button + frame widths
diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp
index f20ffb0f92..074aa3ecec 100644
--- a/src/widgets/styles/qfusionstyle.cpp
+++ b/src/widgets/styles/qfusionstyle.cpp
@@ -55,7 +55,9 @@
#include <qdir.h>
#include <qstyleoption.h>
#include <qapplication.h>
+#if QT_CONFIG(mainwindow)
#include <qmainwindow.h>
+#endif
#include <qfont.h>
#if QT_CONFIG(groupbox)
#include <qgroupbox.h>
@@ -64,11 +66,15 @@
#if QT_CONFIG(scrollbar)
#include <qscrollbar.h>
#endif
+#if QT_CONFIG(spinbox)
#include <qspinbox.h>
+#endif
#if QT_CONFIG(abstractslider)
#include <qabstractslider.h>
#endif
+#if QT_CONFIG(slider)
#include <qslider.h>
+#endif
#if QT_CONFIG(splitter)
#include <qsplitter.h>
#endif
diff --git a/src/widgets/styles/qpixmapstyle.cpp b/src/widgets/styles/qpixmapstyle.cpp
index 975ebfcdbf..976bd2630e 100644
--- a/src/widgets/styles/qpixmapstyle.cpp
+++ b/src/widgets/styles/qpixmapstyle.cpp
@@ -43,7 +43,9 @@
#include "qpixmapstyle_p_p.h"
#include <QDebug>
+#if QT_CONFIG(textedit)
#include <QTextEdit>
+#endif
#include <QStringBuilder>
#include <QPainter>
#include <QPixmapCache>
@@ -52,7 +54,9 @@
#if QT_CONFIG(progressbar)
#include <QProgressBar>
#endif
+#if QT_CONFIG(slider)
#include <QSlider>
+#endif
#include <QEvent>
#if QT_CONFIG(combobox)
#include <QComboBox>
diff --git a/src/widgets/styles/qstylehelper.cpp b/src/widgets/styles/qstylehelper.cpp
index 94376a63e3..e560e713fb 100644
--- a/src/widgets/styles/qstylehelper.cpp
+++ b/src/widgets/styles/qstylehelper.cpp
@@ -69,13 +69,13 @@ QString uniqueName(const QString &key, const QStyleOption *option, const QSize &
% HexString<uint>(size.width())
% HexString<uint>(size.height());
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
if (const QStyleOptionSpinBox *spinBox = qstyleoption_cast<const QStyleOptionSpinBox *>(option)) {
tmp = tmp % HexString<uint>(spinBox->buttonSymbols)
% HexString<uint>(spinBox->stepEnabled)
% QLatin1Char(spinBox->frame ? '1' : '0'); ;
}
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
// QTBUG-56743, try to create a palette cache key reflecting the value,
// as leaks may occur in conjunction with QStyleSheetStyle/QRenderRule modifying
diff --git a/src/widgets/styles/qstyleoption.cpp b/src/widgets/styles/qstyleoption.cpp
index a346ee18c4..28bdadcdd1 100644
--- a/src/widgets/styles/qstyleoption.cpp
+++ b/src/widgets/styles/qstyleoption.cpp
@@ -1949,7 +1949,7 @@ QStyleOptionComplex::QStyleOptionComplex(int version, int type)
\sa QStyle::SubControl
*/
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
/*!
\class QStyleOptionSlider
\brief The QStyleOptionSlider class is used to describe the
@@ -2146,9 +2146,9 @@ QStyleOptionSlider::QStyleOptionSlider(int version)
\sa QAbstractSlider::pageStep
*/
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
/*!
\class QStyleOptionSpinBox
\brief The QStyleOptionSpinBox class is used to describe the
@@ -2252,7 +2252,7 @@ QStyleOptionSpinBox::QStyleOptionSpinBox(int version)
The default value is false, i.e. the spin box has no frame.
*/
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
/*!
\class QStyleOptionDockWidget
@@ -3554,7 +3554,7 @@ QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version)
#endif // QT_CONFIG(tabbar)
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
/*!
\class QStyleOptionSizeGrip
\brief The QStyleOptionSizeGrip class is used to describe the
@@ -3634,7 +3634,7 @@ QStyleOptionSizeGrip::QStyleOptionSizeGrip(int version)
\sa StyleOptionType
*/
-#endif // QT_NO_SIZEGRIP
+#endif // QT_CONFIG(sizegrip)
/*!
\class QStyleOptionGraphicsItem
diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h
index af97479ef0..f703c56917 100644
--- a/src/widgets/styles/qstyleoption.h
+++ b/src/widgets/styles/qstyleoption.h
@@ -41,11 +41,16 @@
#define QSTYLEOPTION_H
#include <QtWidgets/qtwidgetsglobal.h>
+#include <QtCore/qlocale.h>
#include <QtCore/qvariant.h>
+#if QT_CONFIG(spinbox)
#include <QtWidgets/qabstractspinbox.h>
+#endif
#include <QtGui/qicon.h>
#include <QtGui/qmatrix.h>
+#if QT_CONFIG(slider)
#include <QtWidgets/qslider.h>
+#endif
#include <QtWidgets/qstyle.h>
#if QT_CONFIG(tabbar)
#include <QtWidgets/qtabbar.h>
@@ -505,7 +510,7 @@ public:
QStyleOptionComplex(const QStyleOptionComplex &other) : QStyleOption(Version, Type) { *this = other; }
};
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
class Q_WIDGETS_EXPORT QStyleOptionSlider : public QStyleOptionComplex
{
public:
@@ -531,9 +536,9 @@ public:
protected:
QStyleOptionSlider(int version);
};
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
class Q_WIDGETS_EXPORT QStyleOptionSpinBox : public QStyleOptionComplex
{
public:
@@ -550,7 +555,7 @@ public:
protected:
QStyleOptionSpinBox(int version);
};
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
class Q_WIDGETS_EXPORT QStyleOptionToolButton : public QStyleOptionComplex
{
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 44ab9079b0..a721357ddc 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -45,13 +45,17 @@
#include "private/qcssutil_p.h"
#include <qdebug.h>
#include <qapplication.h>
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#if QT_CONFIG(menubar)
#include <qmenubar.h>
#endif
#include <qpainter.h>
#include <qstyleoption.h>
+#if QT_CONFIG(lineedit)
#include <qlineedit.h>
+#endif
#include <private/qwindowsstyle_p.h>
#if QT_CONFIG(combobox)
#include <qcombobox.h>
@@ -85,16 +89,22 @@
#include <qtabbar.h>
#endif
#include <QMetaProperty>
+#if QT_CONFIG(mainwindow)
#include <qmainwindow.h>
+#endif
#if QT_CONFIG(dockwidget)
#include <qdockwidget.h>
#endif
+#if QT_CONFIG(mdiarea)
#include <qmdisubwindow.h>
+#endif
#if QT_CONFIG(dialog)
#include <qdialog.h>
#endif
#include <private/qwidget_p.h>
+#if QT_CONFIG(spinbox)
#include <QAbstractSpinBox>
+#endif
#if QT_CONFIG(label)
#include <QLabel>
#endif
@@ -1649,7 +1659,7 @@ int QStyleSheetStyle::nativeFrameWidth(const QWidget *w)
{
QStyle *base = baseStyle();
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
if (qobject_cast<const QAbstractSpinBox *>(w))
return base->pixelMetric(QStyle::PM_SpinBoxFrameWidth, 0, w);
#endif
@@ -1659,7 +1669,7 @@ int QStyleSheetStyle::nativeFrameWidth(const QWidget *w)
return base->pixelMetric(QStyle::PM_ComboBoxFrameWidth, 0, w);
#endif
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (qobject_cast<const QMenu *>(w))
return base->pixelMetric(QStyle::PM_MenuPanelWidth, 0, w);
#endif
@@ -1807,7 +1817,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
case PseudoElement_SpinBoxDownButton:
case PseudoElement_SpinBoxUpArrow:
case PseudoElement_SpinBoxDownArrow:
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
bool on = false;
bool up = pseudoElement == PseudoElement_SpinBoxUpButton
@@ -1818,7 +1828,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
on = true;
state |= (on ? QStyle::State_On : QStyle::State_Off);
}
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
break;
case PseudoElement_GroupBoxTitle:
state |= (complex->state & (QStyle::State_MouseOver | QStyle::State_Sunken));
@@ -1853,11 +1863,11 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
extraClass |= PseudoClass_ReadOnly;
else
extraClass |= PseudoClass_Editable;
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
} else if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
if (!spin->frame)
extraClass |= PseudoClass_Frameless;
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
} else if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
if (gb->features & QStyleOptionFrame::Flat)
extraClass |= PseudoClass_Flat;
@@ -2036,7 +2046,7 @@ QRenderRule QStyleSheetStyle::renderRule(const QObject *obj, const QStyleOption
}
#endif
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
// LineEdit sets Sunken flag to indicate Sunken frame (argh)
if (const QLineEdit *lineEdit = qobject_cast<const QLineEdit *>(obj)) {
state &= ~QStyle::State_Sunken;
@@ -2362,7 +2372,7 @@ static QWidget *embeddedWidget(QWidget *w)
}
#endif
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
if (QAbstractSpinBox *sb = qobject_cast<QAbstractSpinBox *>(w))
return sb->findChild<QLineEdit *>();
#endif
@@ -2384,19 +2394,19 @@ static QWidget *embeddedWidget(QWidget *w)
*/
static QWidget *containerWidget(const QWidget *w)
{
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
if (qobject_cast<const QLineEdit *>(w)) {
//if the QLineEdit is an embeddedWidget, we need the rule of the real widget
#if QT_CONFIG(combobox)
if (qobject_cast<const QComboBox *>(w->parentWidget()))
return w->parentWidget();
#endif
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
if (qobject_cast<const QAbstractSpinBox *>(w->parentWidget()))
return w->parentWidget();
#endif
}
-#endif // QT_NO_LINEEDIT
+#endif // QT_CONFIG(lineedit)
#if QT_CONFIG(scrollarea)
if (const QAbstractScrollArea *sa = qobject_cast<const QAbstractScrollArea *>(w->parentWidget())) {
@@ -2457,7 +2467,7 @@ static quint64 extendedPseudoClass(const QWidget *w)
pc |= (combo->isEditable() ? PseudoClass_Editable : PseudoClass_ReadOnly);
} else
#endif
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
if (const QLineEdit *edit = qobject_cast<const QLineEdit *>(w)) {
pc |= (edit->isReadOnly() ? PseudoClass_ReadOnly : PseudoClass_Editable);
} else
@@ -2827,10 +2837,10 @@ void QStyleSheetStyle::polish(QWidget *w)
#ifndef QT_NO_FRAME
|| qobject_cast<QFrame *>(w)
#endif
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
|| qobject_cast<QMainWindow *>(w)
#endif
-#ifndef QT_NO_MDIAREA
+#if QT_CONFIG(mdiarea)
|| qobject_cast<QMdiSubWindow *>(w)
#endif
#if QT_CONFIG(menubar)
@@ -2983,7 +2993,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
}
break;
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CC_SpinBox:
if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
QStyleOptionSpinBox spinOpt(*spin);
@@ -3046,7 +3056,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
return;
}
break;
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
case CC_GroupBox:
if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
@@ -3223,7 +3233,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
break;
#endif // QT_CONFIG(scrollbar)
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
case CC_Slider:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
rule.drawRule(p, opt->rect);
@@ -3277,7 +3287,7 @@ void QStyleSheetStyle::drawComplexControl(ComplexControl cc, const QStyleOptionC
return;
}
break;
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
case CC_MdiControls:
if (hasStyleRule(w, PseudoElement_MdiCloseButton)
@@ -4339,7 +4349,7 @@ void QStyleSheetStyle::drawPrimitive(PrimitiveElement pe, const QStyleOption *op
case PE_PanelLineEdit:
if (const QStyleOptionFrame *frm = qstyleoption_cast<const QStyleOptionFrame *>(opt)) {
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
if (w && qobject_cast<const QAbstractSpinBox *>(w->parentWidget())) {
QRenderRule spinboxRule = renderRule(w->parentWidget(), opt);
if (!spinboxRule.hasNativeBorder() || !spinboxRule.baseStyleCanDraw())
@@ -4992,7 +5002,7 @@ QSize QStyleSheetStyle::sizeFromContents(ContentsType ct, const QStyleOption *op
break;
case CT_GroupBox:
case CT_LineEdit:
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
if (qobject_cast<QAbstractSpinBox *>(w ? w->parentWidget() : 0))
return csz; // we only care about the size hint of the line edit
#endif
@@ -5390,7 +5400,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
}
break;
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CC_SpinBox:
if (const QStyleOptionSpinBox *spin = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
QRenderRule upRule = renderRule(w, opt, PseudoElement_SpinBoxUpButton);
@@ -5449,7 +5459,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
: QWindowsStyle::subControlRect(cc, &spinBox, sc, w);
}
break;
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
case CC_GroupBox:
if (const QStyleOptionGroupBox *gb = qstyleoption_cast<const QStyleOptionGroupBox *>(opt)) {
@@ -5619,7 +5629,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
break;
#endif // QT_CONFIG(scrollbar)
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
case CC_Slider:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
QRenderRule subRule = renderRule(w, opt, PseudoElement_SliderGroove);
@@ -5652,7 +5662,7 @@ QRect QStyleSheetStyle::subControlRect(ComplexControl cc, const QStyleOptionComp
}
}
break;
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
case CC_MdiControls:
if (hasStyleRule(w, PseudoElement_MdiCloseButton)
diff --git a/src/widgets/styles/qwindowsstyle.cpp b/src/widgets/styles/qwindowsstyle.cpp
index 2cdfebae0a..657166fc8d 100644
--- a/src/widgets/styles/qwindowsstyle.cpp
+++ b/src/widgets/styles/qwindowsstyle.cpp
@@ -46,7 +46,9 @@
#include "qbitmap.h"
#include "qdrawutil.h" // for now
#include "qevent.h"
+#if QT_CONFIG(menu)
#include "qmenu.h"
+#endif
#if QT_CONFIG(menubar)
#include "qmenubar.h"
#include <private/qmenubar_p.h>
@@ -62,7 +64,9 @@
#endif
#include "qwidget.h"
#include "qdebug.h"
+#if QT_CONFIG(mainwindow)
#include "qmainwindow.h"
+#endif
#include "qfile.h"
#include "qtextstream.h"
#include "qpixmapcache.h"
@@ -345,12 +349,12 @@ int QWindowsStylePrivate::fixedPixelMetric(QStyle::PixelMetric pm)
return 2;
#endif
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
case QStyle::PM_SliderLength:
return 11;
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
case QStyle::PM_MenuBarHMargin:
case QStyle::PM_MenuBarVMargin:
case QStyle::PM_MenuBarPanelWidth:
@@ -365,7 +369,7 @@ int QWindowsStylePrivate::fixedPixelMetric(QStyle::PixelMetric pm)
case QStyle::PM_DockWidgetFrameWidth:
return 4;
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
case QStyle::PM_ToolBarHandleExtent:
return 10;
default:
@@ -437,7 +441,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
ret = 60;
break;
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
// Returns the number of pixels to use for the business part of the
// slider (i.e., the non-tickmark portion). The remaining space is shared
// equally between the tickmark regions.
@@ -465,7 +469,7 @@ int QWindowsStyle::pixelMetric(PixelMetric pm, const QStyleOption *opt, const QW
ret = thick;
}
break;
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
case PM_IconViewIconSize:
ret = proxy()->pixelMetric(PM_LargeIconSize, opt, widget);
@@ -1113,7 +1117,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
break;
#endif // QT_CONFIG(rubberband)
-#if !defined(QT_NO_MENU) && !defined(QT_NO_MAINWINDOW)
+#if QT_CONFIG(menu) && QT_CONFIG(mainwindow)
case CE_MenuBarEmptyArea:
if (widget && qobject_cast<const QMainWindow *>(widget->parentWidget())) {
p->fillRect(opt->rect, opt->palette.button());
@@ -1124,7 +1128,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
}
break;
#endif
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
case CE_MenuItem:
if (const QStyleOptionMenuItem *menuitem = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
int x, y, w, h;
@@ -1261,7 +1265,7 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
}
break;
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
#if QT_CONFIG(menubar)
case CE_MenuBarItem:
if (const QStyleOptionMenuItem *mbi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
@@ -1924,7 +1928,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
QPainter *p, const QWidget *widget) const
{
switch (cc) {
-#ifndef QT_NO_SLIDER
+#if QT_CONFIG(slider)
case CC_Slider:
if (const QStyleOptionSlider *slider = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
int thickness = proxy()->pixelMetric(PM_SliderControlThickness, slider, widget);
@@ -2144,7 +2148,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
}
}
break;
-#endif // QT_NO_SLIDER
+#endif // QT_CONFIG(slider)
#if QT_CONFIG(scrollbar)
case CC_ScrollBar:
if (const QStyleOptionSlider *scrollbar = qstyleoption_cast<const QStyleOptionSlider *>(opt)) {
@@ -2229,7 +2233,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
}
break;
#endif // QT_CONFIG(combobox)
-#ifndef QT_NO_SPINBOX
+#if QT_CONFIG(spinbox)
case CC_SpinBox:
if (const QStyleOptionSpinBox *sb = qstyleoption_cast<const QStyleOptionSpinBox *>(opt)) {
QStyleOptionSpinBox copy = *sb;
@@ -2318,7 +2322,7 @@ void QWindowsStyle::drawComplexControl(ComplexControl cc, const QStyleOptionComp
}
}
break;
-#endif // QT_NO_SPINBOX
+#endif // QT_CONFIG(spinbox)
default:
QCommonStyle::drawComplexControl(cc, opt, p, widget);
@@ -2351,7 +2355,7 @@ QSize QWindowsStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz = QSize(w, h);
}
break;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
case CT_MenuItem:
if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) {
int w = sz.width();
@@ -2393,7 +2397,7 @@ QSize QWindowsStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt,
sz.setWidth(w);
}
break;
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
#if QT_CONFIG(menubar)
case CT_MenuBarItem:
if (!sz.isEmpty())
diff --git a/src/widgets/util/qcompleter.cpp b/src/widgets/util/qcompleter.cpp
index 88c83b0c3f..d444fe6053 100644
--- a/src/widgets/util/qcompleter.cpp
+++ b/src/widgets/util/qcompleter.cpp
@@ -159,7 +159,9 @@
#include "QtGui/qevent.h"
#include "QtWidgets/qdesktopwidget.h"
#include <private/qdesktopwidget_p.h>
+#if QT_CONFIG(lineedit)
#include "QtWidgets/qlineedit.h"
+#endif
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp
index fb3782881c..447c7b2aeb 100644
--- a/src/widgets/util/qsystemtrayicon.cpp
+++ b/src/widgets/util/qsystemtrayicon.cpp
@@ -42,7 +42,9 @@
#ifndef QT_NO_SYSTEMTRAYICON
+#if QT_CONFIG(menu)
#include "qmenu.h"
+#endif
#include "qlist.h"
#include "qevent.h"
#include "qpoint.h"
@@ -182,7 +184,7 @@ QSystemTrayIcon::~QSystemTrayIcon()
d->remove_sys();
}
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
/*!
Sets the specified \a menu to be the context menu for the system tray icon.
@@ -228,7 +230,7 @@ QMenu* QSystemTrayIcon::contextMenu() const
return d->menu;
}
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
/*!
\property QSystemTrayIcon::icon
diff --git a/src/widgets/util/qsystemtrayicon.h b/src/widgets/util/qsystemtrayicon.h
index 918dd0478e..81f396ed83 100644
--- a/src/widgets/util/qsystemtrayicon.h
+++ b/src/widgets/util/qsystemtrayicon.h
@@ -78,7 +78,7 @@ public:
MiddleClick
};
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void setContextMenu(QMenu *menu);
QMenu *contextMenu() const;
#endif
diff --git a/src/widgets/util/qsystemtrayicon_p.h b/src/widgets/util/qsystemtrayicon_p.h
index 3f5cab40be..318edbd1e3 100644
--- a/src/widgets/util/qsystemtrayicon_p.h
+++ b/src/widgets/util/qsystemtrayicon_p.h
@@ -57,7 +57,10 @@
#ifndef QT_NO_SYSTEMTRAYICON
+#if QT_CONFIG(menu)
#include "QtWidgets/qmenu.h"
+#endif
+#include "QtWidgets/qwidget.h"
#include "QtGui/qpixmap.h"
#include <qpa/qplatformsystemtrayicon.h>
#include "QtCore/qstring.h"
diff --git a/src/widgets/util/qsystemtrayicon_x11.cpp b/src/widgets/util/qsystemtrayicon_x11.cpp
index fd9fdfb507..cd593d8d98 100644
--- a/src/widgets/util/qsystemtrayicon_x11.cpp
+++ b/src/widgets/util/qsystemtrayicon_x11.cpp
@@ -47,7 +47,9 @@
#include "qevent.h"
#include "qapplication.h"
#include "qlist.h"
+#if QT_CONFIG(menu)
#include "qmenu.h"
+#endif
#include "qtimer.h"
#include "qsystemtrayicon_p.h"
#include "qpaintengine.h"
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index 22f3745b26..c72c060f9a 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -43,8 +43,6 @@
#include <private/qlineedit_p.h>
#include <qabstractspinbox.h>
-#ifndef QT_NO_SPINBOX
-
#include <qapplication.h>
#include <qstylehints.h>
#include <qclipboard.h>
@@ -53,7 +51,9 @@
#include <qdatetimeedit.h>
#endif
#include <qevent.h>
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#include <qpainter.h>
#include <qpalette.h>
#include <qstylepainter.h>
@@ -2145,5 +2145,3 @@ QVariant QAbstractSpinBoxPrivate::variantBound(const QVariant &min,
QT_END_NAMESPACE
#include "moc_qabstractspinbox.cpp"
-
-#endif // QT_NO_SPINBOX
diff --git a/src/widgets/widgets/qabstractspinbox.h b/src/widgets/widgets/qabstractspinbox.h
index d81cbfdc34..88735baf1c 100644
--- a/src/widgets/widgets/qabstractspinbox.h
+++ b/src/widgets/widgets/qabstractspinbox.h
@@ -44,10 +44,9 @@
#include <QtWidgets/qwidget.h>
#include <QtGui/qvalidator.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(spinbox);
-#ifndef QT_NO_SPINBOX
+QT_BEGIN_NAMESPACE
class QLineEdit;
@@ -175,8 +174,6 @@ private:
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractSpinBox::StepEnabled)
-#endif // QT_NO_SPINBOX
-
QT_END_NAMESPACE
#endif // QABSTRACTSPINBOX_H
diff --git a/src/widgets/widgets/qabstractspinbox_p.h b/src/widgets/widgets/qabstractspinbox_p.h
index 5ec59d899b..8f312fa900 100644
--- a/src/widgets/widgets/qabstractspinbox_p.h
+++ b/src/widgets/widgets/qabstractspinbox_p.h
@@ -54,8 +54,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "QtWidgets/qabstractspinbox.h"
-#ifndef QT_NO_SPINBOX
-
#include "QtWidgets/qlineedit.h"
#include "QtWidgets/qstyleoption.h"
#include "QtGui/qvalidator.h"
@@ -63,6 +61,8 @@
#include "QtCore/qvariant.h"
#include "private/qwidget_p.h"
+QT_REQUIRE_CONFIG(spinbox);
+
QT_BEGIN_NAMESPACE
QVariant operator+(const QVariant &arg1, const QVariant &arg2);
@@ -165,6 +165,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_SPINBOX
-
#endif // QABSTRACTSPINBOX_P_H
diff --git a/src/widgets/widgets/qcombobox.cpp b/src/widgets/widgets/qcombobox.cpp
index ed0fd3e2b0..cd2e20694e 100644
--- a/src/widgets/widgets/qcombobox.cpp
+++ b/src/widgets/widgets/qcombobox.cpp
@@ -52,7 +52,9 @@
#endif
#include <qitemdelegate.h>
#include <qmap.h>
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#include <qevent.h>
#include <qlayout.h>
#include <qscrollbar.h>
@@ -1128,7 +1130,7 @@ void QComboBoxPrivate::updateViewContainerPaletteAndOpacity()
Q_Q(QComboBox);
QStyleOptionComboBox opt;
q->initStyleOption(&opt);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (q->style()->styleHint(QStyle::SH_ComboBox_Popup, &opt, q)) {
QMenu menu;
menu.ensurePolished();
diff --git a/src/widgets/widgets/qcombobox.h b/src/widgets/widgets/qcombobox.h
index ff27a999d9..59f2a425a0 100644
--- a/src/widgets/widgets/qcombobox.h
+++ b/src/widgets/widgets/qcombobox.h
@@ -45,6 +45,7 @@
#include <QtWidgets/qabstractitemdelegate.h>
#include <QtCore/qabstractitemmodel.h>
#include <QtCore/qvariant.h>
+#include <QtGui/qvalidator.h>
QT_REQUIRE_CONFIG(combobox);
diff --git a/src/widgets/widgets/qdockwidget.cpp b/src/widgets/widgets/qdockwidget.cpp
index 36d7ab3421..bfb3a98d7e 100644
--- a/src/widgets/widgets/qdockwidget.cpp
+++ b/src/widgets/widgets/qdockwidget.cpp
@@ -845,7 +845,7 @@ bool QDockWidgetPrivate::isAnimating() const
bool QDockWidgetPrivate::mousePressEvent(QMouseEvent *event)
{
-#if !defined(QT_NO_MAINWINDOW)
+#if QT_CONFIG(mainwindow)
Q_Q(QDockWidget);
QDockWidgetLayout *dwLayout
@@ -874,7 +874,7 @@ bool QDockWidgetPrivate::mousePressEvent(QMouseEvent *event)
return true;
}
-#endif // !defined(QT_NO_MAINWINDOW)
+#endif // QT_CONFIG(mainwindow)
return false;
}
@@ -897,7 +897,7 @@ bool QDockWidgetPrivate::mouseDoubleClickEvent(QMouseEvent *event)
bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
{
bool ret = false;
-#if !defined(QT_NO_MAINWINDOW)
+#if QT_CONFIG(mainwindow)
Q_Q(QDockWidget);
if (!state)
@@ -938,20 +938,20 @@ bool QDockWidgetPrivate::mouseMoveEvent(QMouseEvent *event)
ret = true;
}
-#endif // !defined(QT_NO_MAINWINDOW)
+#endif // QT_CONFIG(mainwindow)
return ret;
}
bool QDockWidgetPrivate::mouseReleaseEvent(QMouseEvent *event)
{
-#if !defined(QT_NO_MAINWINDOW)
+#if QT_CONFIG(mainwindow)
if (event->button() == Qt::LeftButton && state && !state->nca) {
endDrag();
return true; //filter out the event
}
-#endif // !defined(QT_NO_MAINWINDOW)
+#endif // QT_CONFIG(mainwindow)
return false;
}
diff --git a/src/widgets/widgets/qlabel_p.h b/src/widgets/widgets/qlabel_p.h
index f3236ac527..e05a5b5c35 100644
--- a/src/widgets/widgets/qlabel_p.h
+++ b/src/widgets/widgets/qlabel_p.h
@@ -65,7 +65,9 @@
#include "qimage.h"
#include "qbitmap.h"
#include "qpicture.h"
+#if QT_CONFIG(menu)
#include "qmenu.h"
+#endif
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/widgets/qlineedit.cpp b/src/widgets/widgets/qlineedit.cpp
index 06e878f657..d0a794222e 100644
--- a/src/widgets/widgets/qlineedit.cpp
+++ b/src/widgets/widgets/qlineedit.cpp
@@ -40,7 +40,6 @@
#include "qlineedit.h"
#include "qlineedit_p.h"
-#ifndef QT_NO_LINEEDIT
#include "qaction.h"
#include "qapplication.h"
#include "qclipboard.h"
@@ -49,7 +48,9 @@
#include "qevent.h"
#include "qfontmetrics.h"
#include "qstylehints.h"
+#if QT_CONFIG(menu)
#include "qmenu.h"
+#endif
#include "qpainter.h"
#include "qpixmap.h"
#include "qpointer.h"
@@ -61,8 +62,10 @@
#include "qvariant.h"
#include "qvector.h"
#include "qdebug.h"
+#if QT_CONFIG(textedit)
#include "qtextedit.h"
#include <private/qtextedit_p.h>
+#endif
#include <private/qwidgettextcontrol_p.h>
#ifndef QT_NO_ACCESSIBILITY
@@ -2231,5 +2234,3 @@ void QLineEdit::changeEvent(QEvent *ev)
QT_END_NAMESPACE
#include "moc_qlineedit.cpp"
-
-#endif // QT_NO_LINEEDIT
diff --git a/src/widgets/widgets/qlineedit.h b/src/widgets/widgets/qlineedit.h
index ba6ef5c181..b98307390c 100644
--- a/src/widgets/widgets/qlineedit.h
+++ b/src/widgets/widgets/qlineedit.h
@@ -46,10 +46,9 @@
#include <QtCore/qstring.h>
#include <QtCore/qmargins.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(lineedit);
-#ifndef QT_NO_LINEEDIT
+QT_BEGIN_NAMESPACE
class QValidator;
class QMenu;
@@ -264,8 +263,6 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_clearButtonClicked())
};
-#endif // QT_NO_LINEEDIT
-
QT_END_NAMESPACE
#endif // QLINEEDIT_H
diff --git a/src/widgets/widgets/qlineedit_p.cpp b/src/widgets/widgets/qlineedit_p.cpp
index ae35a64663..5b352f5554 100644
--- a/src/widgets/widgets/qlineedit_p.cpp
+++ b/src/widgets/widgets/qlineedit_p.cpp
@@ -40,8 +40,6 @@
#include "qlineedit.h"
#include "qlineedit_p.h"
-#ifndef QT_NO_LINEEDIT
-
#include "qvariant.h"
#if QT_CONFIG(itemviews)
#include "qabstractitemview.h"
@@ -58,6 +56,7 @@
#endif
#include <qpainter.h>
#include <qpropertyanimation.h>
+#include <qvalidator.h>
QT_BEGIN_NAMESPACE
@@ -624,5 +623,3 @@ int QLineEditPrivate::effectiveRightTextMargin() const
QT_END_NAMESPACE
#include "moc_qlineedit_p.cpp"
-
-#endif
diff --git a/src/widgets/widgets/qlineedit_p.h b/src/widgets/widgets/qlineedit_p.h
index 094425e45e..77a91880df 100644
--- a/src/widgets/widgets/qlineedit_p.h
+++ b/src/widgets/widgets/qlineedit_p.h
@@ -53,7 +53,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#ifndef QT_NO_LINEEDIT
#include "private/qwidget_p.h"
#include "QtWidgets/qlineedit.h"
#if QT_CONFIG(toolbutton)
@@ -73,6 +72,8 @@
#include <algorithm>
+QT_REQUIRE_CONFIG(lineedit);
+
QT_BEGIN_NAMESPACE
class QLineEditPrivate;
@@ -256,8 +257,6 @@ private:
Q_DECLARE_TYPEINFO(QLineEditPrivate::SideWidgetEntry, Q_PRIMITIVE_TYPE);
Q_DECLARE_TYPEINFO(QLineEditPrivate::SideWidgetLocation, Q_PRIMITIVE_TYPE);
-#endif // QT_NO_LINEEDIT
-
QT_END_NAMESPACE
#endif // QLINEEDIT_P_H
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp
index 15480e527e..d97fedadab 100644
--- a/src/widgets/widgets/qmainwindow.cpp
+++ b/src/widgets/widgets/qmainwindow.cpp
@@ -42,8 +42,6 @@
#include "qmainwindow.h"
#include "qmainwindowlayout_p.h"
-#ifndef QT_NO_MAINWINDOW
-
#if QT_CONFIG(dockwidget)
#include "qdockwidget.h"
#endif
@@ -1446,7 +1444,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event)
if (child == this)
return;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QMenu *popup = createPopupMenu();
if (popup) {
if (!popup->isEmpty()) {
@@ -1461,7 +1459,7 @@ void QMainWindow::contextMenuEvent(QContextMenuEvent *event)
}
#endif // QT_NO_CONTEXTMENU
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
/*!
Returns a popup menu containing checkable entries for the toolbars and
dock widgets present in the main window. If there are no toolbars and
@@ -1522,10 +1520,8 @@ QMenu *QMainWindow::createPopupMenu()
Q_UNUSED(d);
return menu;
}
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
QT_END_NAMESPACE
#include "moc_qmainwindow.cpp"
-
-#endif // QT_NO_MAINWINDOW
diff --git a/src/widgets/widgets/qmainwindow.h b/src/widgets/widgets/qmainwindow.h
index ff489efa2d..50d840cf61 100644
--- a/src/widgets/widgets/qmainwindow.h
+++ b/src/widgets/widgets/qmainwindow.h
@@ -46,10 +46,9 @@
#include <QtWidgets/qtabwidget.h>
#endif
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(mainwindow);
-#ifndef QT_NO_MAINWINDOW
+QT_BEGIN_NAMESPACE
class QDockWidget;
class QMainWindowPrivate;
@@ -182,7 +181,7 @@ public:
QByteArray saveState(int version = 0) const;
bool restoreState(const QByteArray &state, int version = 0);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
virtual QMenu *createPopupMenu();
#endif
@@ -215,8 +214,6 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QMainWindow::DockOptions)
-#endif // QT_NO_MAINWINDOW
-
QT_END_NAMESPACE
#endif // QDYNAMICMAINWINDOW_H
diff --git a/src/widgets/widgets/qmainwindowlayout.cpp b/src/widgets/widgets/qmainwindowlayout.cpp
index da5f00efe0..1767a8458f 100644
--- a/src/widgets/widgets/qmainwindowlayout.cpp
+++ b/src/widgets/widgets/qmainwindowlayout.cpp
@@ -40,7 +40,6 @@
#include "qmainwindowlayout_p.h"
-#ifndef QT_NO_MAINWINDOW
#if QT_CONFIG(dockwidget)
#include "qdockarealayout_p.h"
#include "qdockwidget.h"
@@ -2725,5 +2724,3 @@ bool QMainWindowLayout::restoreState(QDataStream &stream)
QT_END_NAMESPACE
#include "moc_qmainwindowlayout_p.cpp"
-
-#endif // QT_NO_MAINWINDOW
diff --git a/src/widgets/widgets/qmainwindowlayout_p.h b/src/widgets/widgets/qmainwindowlayout_p.h
index 2ffc367da1..c61c4f6aa8 100644
--- a/src/widgets/widgets/qmainwindowlayout_p.h
+++ b/src/widgets/widgets/qmainwindowlayout_p.h
@@ -54,8 +54,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qmainwindow.h"
-#ifndef QT_NO_MAINWINDOW
-
#include "QtWidgets/qlayout.h"
#if QT_CONFIG(tabbar)
#include "QtWidgets/qtabbar.h"
@@ -73,6 +71,8 @@
#endif
#include "qtoolbararealayout_p.h"
+QT_REQUIRE_CONFIG(mainwindow);
+
QT_BEGIN_NAMESPACE
class QToolBar;
@@ -590,6 +590,4 @@ QDebug operator<<(QDebug debug, const QMainWindowLayout *layout);
QT_END_NAMESPACE
-#endif // QT_NO_MAINWINDOW
-
#endif // QDYNAMICMAINWINDOWLAYOUT_P_H
diff --git a/src/widgets/widgets/qmdiarea.cpp b/src/widgets/widgets/qmdiarea.cpp
index 418764223d..4e7925556a 100644
--- a/src/widgets/widgets/qmdiarea.cpp
+++ b/src/widgets/widgets/qmdiarea.cpp
@@ -156,8 +156,6 @@
#include "qmdiarea_p.h"
-#ifndef QT_NO_MDIAREA
-
#include <QApplication>
#include <QStyle>
#include <QChildEvent>
@@ -171,7 +169,9 @@
#include <private/qdesktopwidget_p.h>
#include <QDebug>
#include <qmath.h>
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#include <private/qlayoutengine_p.h>
#include <algorithm>
@@ -610,7 +610,7 @@ void QMdiAreaTabBar::contextMenuEvent(QContextMenuEvent *event)
return;
}
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QMdiSubWindowPrivate *subWindowPrivate = subWindow->d_func();
if (!subWindowPrivate->systemMenu) {
event->ignore();
@@ -638,7 +638,7 @@ void QMdiAreaTabBar::contextMenuEvent(QContextMenuEvent *event)
// Restore action visibility.
subWindowPrivate->updateActions();
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
}
#endif // QT_NO_CONTEXTMENU
@@ -2698,5 +2698,3 @@ void QMdiArea::setupViewport(QWidget *viewport)
QT_END_NAMESPACE
#include "moc_qmdiarea.cpp"
-
-#endif // QT_NO_MDIAREA
diff --git a/src/widgets/widgets/qmdiarea.h b/src/widgets/widgets/qmdiarea.h
index acc59296b6..05deb9e21f 100644
--- a/src/widgets/widgets/qmdiarea.h
+++ b/src/widgets/widgets/qmdiarea.h
@@ -46,10 +46,9 @@
#include <QtWidgets/qtabwidget.h>
#endif
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(mdiarea);
-#ifndef QT_NO_MDIAREA
+QT_BEGIN_NAMESPACE
class QMdiSubWindow;
@@ -171,5 +170,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QMdiArea::AreaOptions)
QT_END_NAMESPACE
-#endif // QT_NO_MDIAREA
#endif // QMDIAREA_H
diff --git a/src/widgets/widgets/qmdiarea_p.h b/src/widgets/widgets/qmdiarea_p.h
index 10b5de6840..4740993af7 100644
--- a/src/widgets/widgets/qmdiarea_p.h
+++ b/src/widgets/widgets/qmdiarea_p.h
@@ -55,7 +55,7 @@
#include "qmdiarea.h"
#include "qmdisubwindow.h"
-#ifndef QT_NO_MDIAREA
+QT_REQUIRE_CONFIG(mdiarea);
#include <QList>
#include <QVector>
@@ -266,8 +266,6 @@ public:
#endif // QT_CONFIG(rubberband)
};
-#endif // QT_NO_MDIAREA
-
QT_END_NAMESPACE
#endif // QMDIAREA_P_H
diff --git a/src/widgets/widgets/qmdisubwindow.cpp b/src/widgets/widgets/qmdisubwindow.cpp
index 4819e0d104..129898a08d 100644
--- a/src/widgets/widgets/qmdisubwindow.cpp
+++ b/src/widgets/widgets/qmdisubwindow.cpp
@@ -147,8 +147,6 @@
#include "qmdisubwindow_p.h"
-#ifndef QT_NO_MDIAREA
-
#include <QApplication>
#include <QStylePainter>
#include <QVBoxLayout>
@@ -157,12 +155,17 @@
#include <QWhatsThis>
#endif
#include <QToolTip>
+#if QT_CONFIG(mainwindow)
#include <QMainWindow>
+#endif
#include <QScrollBar>
#include <QDebug>
#include <QMdiArea>
#include <QScopedValueRollback>
+#include <QAction>
+#if QT_CONFIG(menu)
#include <QMenu>
+#endif
QT_BEGIN_NAMESPACE
@@ -717,7 +720,7 @@ ControlContainer::ControlContainer(QMdiSubWindow *mdiChild)
m_menuLabel = new ControlElement<ControlLabel>(mdiChild);
m_menuLabel->setWindowIcon(mdiChild->windowIcon());
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
connect(m_menuLabel, SIGNAL(_q_clicked()), mdiChild, SLOT(showSystemMenu()));
#endif
connect(m_menuLabel, SIGNAL(_q_doubleClicked()), mdiChild, SLOT(close()));
@@ -740,7 +743,7 @@ ControlContainer::~ControlContainer()
*/
QMenuBar *QMdiSubWindowPrivate::menuBar() const
{
-#if defined(QT_NO_MAINWINDOW)
+#if !QT_CONFIG(mainwindow)
return 0;
#else
Q_Q(const QMdiSubWindow);
@@ -861,7 +864,7 @@ QMdiSubWindowPrivate::QMdiSubWindowPrivate()
: baseWidget(0),
restoreFocusWidget(0),
controlContainer(0),
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
sizeGrip(0),
#endif
#if QT_CONFIG(rubberband)
@@ -1037,7 +1040,7 @@ void QMdiSubWindowPrivate::initOperationMap()
operationMap.insert(BottomRightResize, OperationInfo(HResize | VResize, Qt::SizeFDiagCursor));
}
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
/*!
\internal
@@ -1300,7 +1303,7 @@ void QMdiSubWindowPrivate::setNormalMode()
restoreSize.setWidth(-1);
restoreSize.setHeight(-1);
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
setSizeGripVisible(true);
#endif
@@ -1347,7 +1350,7 @@ void QMdiSubWindowPrivate::setMaximizeMode()
storeFocusWidget();
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
setSizeGripVisible(false);
#endif
@@ -1773,7 +1776,7 @@ bool QMdiSubWindowPrivate::drawTitleBarWhenMaximized() const
if (q->style()->styleHint(QStyle::SH_Workspace_FillSpaceOnMaximize, 0, q))
return true;
-#if !QT_CONFIG(menubar) || defined(QT_NO_MAINWINDOW)
+#if !QT_CONFIG(menubar) || !QT_CONFIG(mainwindow)
Q_UNUSED(isChildOfQMdiSubWindow);
return true;
#else
@@ -1838,7 +1841,7 @@ void QMdiSubWindowPrivate::removeButtonsFromMenuBar()
return;
QMenuBar *currentMenuBar = 0;
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
if (QMainWindow *mainWindow = qobject_cast<QMainWindow *>(q->window())) {
// NB! We can't use menuBar() here because that one will actually create
// a menubar for us if not set. That's not what we want :-)
@@ -2106,7 +2109,7 @@ void QMdiSubWindowPrivate::setWindowFlags(Qt::WindowFlags windowFlags)
}
#endif
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
if ((windowFlags & Qt::FramelessWindowHint) && sizeGrip)
delete sizeGrip;
#endif
@@ -2145,7 +2148,7 @@ void QMdiSubWindowPrivate::setEnabled(WindowStateAction action, bool enable)
actions[action]->setEnabled(enable);
}
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void QMdiSubWindowPrivate::addToSystemMenu(WindowStateAction action, const QString &text,
const char *slot)
{
@@ -2167,7 +2170,7 @@ QSize QMdiSubWindowPrivate::iconSize() const
return QSize(q->style()->pixelMetric(QStyle::PM_MdiSubWindowMinimizedWidth, 0, q), titleBarHeight());
}
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
/*!
\internal
@@ -2209,7 +2212,7 @@ void QMdiSubWindowPrivate::setSizeGripVisible(bool visible) const
grip->setVisible(visible);
}
-#endif // QT_NO_SIZEGRIP
+#endif // QT_CONFIG(sizegrip)
/*!
\internal
@@ -2248,7 +2251,7 @@ QMdiSubWindow::QMdiSubWindow(QWidget *parent, Qt::WindowFlags flags)
: QWidget(*new QMdiSubWindowPrivate, parent, 0)
{
Q_D(QMdiSubWindow);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
d->createSystemMenu();
addActions(d->systemMenu->actions());
#endif
@@ -2320,7 +2323,7 @@ void QMdiSubWindow::setWidget(QWidget *widget)
else
widget->setParent(this);
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
QSizeGrip *sizeGrip = widget->findChild<QSizeGrip *>();
if (sizeGrip)
sizeGrip->installEventFilter(this);
@@ -2481,7 +2484,7 @@ void QMdiSubWindow::setKeyboardPageStep(int step)
d_func()->keyboardPageStep = step;
}
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
/*!
Sets \a systemMenu as the current system menu for this subwindow.
@@ -2561,7 +2564,7 @@ void QMdiSubWindow::showSystemMenu()
globalPopupPos -= QPoint(d->systemMenu->sizeHint().width(), 0);
d->systemMenu->popup(globalPopupPos);
}
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
/*!
\since 4.4
@@ -2625,7 +2628,7 @@ void QMdiSubWindow::showShaded()
if (hasFocus() || isAncestorOf(QApplication::focusWidget()))
d->ensureWindowState(Qt::WindowActive);
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
d->setSizeGripVisible(false);
#endif
@@ -2682,7 +2685,7 @@ bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event)
if (!object)
return QWidget::eventFilter(object, event);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
// System menu events.
if (d->systemMenu && d->systemMenu == object) {
if (event->type() == QEvent::MouseButtonDblClick) {
@@ -2701,7 +2704,7 @@ bool QMdiSubWindow::eventFilter(QObject *object, QEvent *event)
}
#endif
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
if (object != d->baseWidget && parent() && qobject_cast<QSizeGrip *>(object)) {
if (event->type() != QEvent::MouseButtonPress || !testOption(QMdiSubWindow::RubberBandResize))
return QWidget::eventFilter(object, event);
@@ -2832,7 +2835,7 @@ bool QMdiSubWindow::event(QEvent *event)
d->isMaximizeMode = false;
d->isWidgetHiddenByUs = false;
if (!parent()) {
-#if !defined(QT_NO_SIZEGRIP)
+#if QT_CONFIG(sizegrip)
if (isMacStyle(style()))
delete d->sizeGrip;
#endif
@@ -2927,7 +2930,7 @@ void QMdiSubWindow::showEvent(QShowEvent *showEvent)
return;
}
-#if !defined(QT_NO_SIZEGRIP)
+#if QT_CONFIG(sizegrip)
if (isMacStyle(style()) && !d->sizeGrip
&& !(windowFlags() & Qt::FramelessWindowHint)) {
d->setSizeGrip(new QSizeGrip(this));
@@ -3065,7 +3068,7 @@ void QMdiSubWindow::leaveEvent(QEvent * /*leaveEvent*/)
void QMdiSubWindow::resizeEvent(QResizeEvent *resizeEvent)
{
Q_D(QMdiSubWindow);
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
if (d->sizeGrip) {
d->sizeGrip->move(isLeftToRight() ? width() - d->sizeGrip->width() : 0,
height() - d->sizeGrip->height());
@@ -3208,7 +3211,7 @@ void QMdiSubWindow::mousePressEvent(QMouseEvent *mouseEvent)
}
d->activeSubControl = d->hoveredSubControl;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (d->activeSubControl == QStyle::SC_TitleBarSysMenu)
showSystemMenu();
else
@@ -3233,7 +3236,7 @@ void QMdiSubWindow::mouseDoubleClickEvent(QMouseEvent *mouseEvent)
Q_D(QMdiSubWindow);
if (!d->isMoveOperation()) {
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (d->hoveredSubControl == QStyle::SC_TitleBarSysMenu)
close();
#endif
@@ -3469,7 +3472,7 @@ void QMdiSubWindow::childEvent(QChildEvent *childEvent)
{
if (childEvent->type() != QEvent::ChildPolished)
return;
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
if (QSizeGrip *sizeGrip = qobject_cast<QSizeGrip *>(childEvent->child()))
d_func()->setSizeGrip(sizeGrip);
#endif
@@ -3527,7 +3530,7 @@ QSize QMdiSubWindow::minimumSizeHint() const
}
}
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
// SizeGrip
int sizeGripHeight = 0;
if (d->sizeGrip && d->sizeGrip->isVisibleTo(const_cast<QMdiSubWindow *>(this)))
@@ -3544,5 +3547,3 @@ QT_END_NAMESPACE
#include "moc_qmdisubwindow.cpp"
#include "qmdisubwindow.moc"
-
-#endif //QT_NO_MDIAREA
diff --git a/src/widgets/widgets/qmdisubwindow.h b/src/widgets/widgets/qmdisubwindow.h
index 875c9a22c8..adaafa352a 100644
--- a/src/widgets/widgets/qmdisubwindow.h
+++ b/src/widgets/widgets/qmdisubwindow.h
@@ -43,10 +43,9 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(mdiarea);
-#ifndef QT_NO_MDIAREA
+QT_BEGIN_NAMESPACE
class QMenu;
class QMdiArea;
@@ -90,7 +89,7 @@ public:
void setKeyboardPageStep(int step);
int keyboardPageStep() const;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void setSystemMenu(QMenu *systemMenu);
QMenu *systemMenu() const;
#endif
@@ -102,7 +101,7 @@ Q_SIGNALS:
void aboutToActivate();
public Q_SLOTS:
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void showSystemMenu();
#endif
void showShaded();
@@ -148,6 +147,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QMdiSubWindow::SubWindowOptions)
QT_END_NAMESPACE
-#endif // QT_NO_MDIAREA
-
#endif // QMDISUBWINDOW_H
diff --git a/src/widgets/widgets/qmdisubwindow_p.h b/src/widgets/widgets/qmdisubwindow_p.h
index 51652a78ff..d03aca168b 100644
--- a/src/widgets/widgets/qmdisubwindow_p.h
+++ b/src/widgets/widgets/qmdisubwindow_p.h
@@ -54,18 +54,20 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qmdisubwindow.h"
-#ifndef QT_NO_MDIAREA
-
#include <QStyle>
#include <QStyleOptionTitleBar>
#if QT_CONFIG(menubar)
#include <QMenuBar>
#endif
+#if QT_CONFIG(sizegrip)
#include <QSizeGrip>
+#endif
#include <QPointer>
#include <QDebug>
#include <private/qwidget_p.h>
+QT_REQUIRE_CONFIG(mdiarea);
+
QT_BEGIN_NAMESPACE
class QVBoxLayout;
@@ -178,7 +180,7 @@ public:
QPointer<QWidget> baseWidget;
QPointer<QWidget> restoreFocusWidget;
QPointer<QMdi::ControlContainer> controlContainer;
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
QPointer<QSizeGrip> sizeGrip;
#endif
#if QT_CONFIG(rubberband)
@@ -234,7 +236,7 @@ public:
void leaveInteractiveMode();
void removeBaseWidget();
void initOperationMap();
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void createSystemMenu();
#endif
void updateCursor();
@@ -273,12 +275,12 @@ public:
void setVisible(WindowStateAction, bool visible = true);
#ifndef QT_NO_ACTION
void setEnabled(WindowStateAction, bool enable = true);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void addToSystemMenu(WindowStateAction, const QString &text, const char *slot);
#endif
#endif // QT_NO_ACTION
QSize iconSize() const;
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
void setSizeGrip(QSizeGrip *sizeGrip);
void setSizeGripVisible(bool visible = true) const;
#endif
@@ -343,8 +345,6 @@ public:
}
};
-#endif // QT_NO_MDIAREA
-
QT_END_NAMESPACE
#endif // QMDISUBWINDOW_P_H
diff --git a/src/widgets/widgets/qmenu.cpp b/src/widgets/widgets/qmenu.cpp
index c1fb409380..ded218de73 100644
--- a/src/widgets/widgets/qmenu.cpp
+++ b/src/widgets/widgets/qmenu.cpp
@@ -39,8 +39,6 @@
#include "qmenu.h"
-#ifndef QT_NO_MENU
-
#include <QtWidgets/private/qtwidgetsglobal_p.h>
#include "qdebug.h"
@@ -856,6 +854,24 @@ void QMenuPrivate::_q_overrideMenuActionDestroyed()
menuAction=defaultMenuAction;
}
+void QMenuPrivate::adjustMenuScreen(const QPoint &p)
+{
+ Q_Q(QMenu);
+ // The windowHandle must point to the screen where the menu will be shown.
+ // The (item) size calculations depend on the menu screen,
+ // so a wrong screen would often cause wrong sizes (on high DPI)
+ const QScreen *primaryScreen = QApplication::primaryScreen();
+ const QScreen *currentScreen = q->windowHandle() ? q->windowHandle()->screen() : primaryScreen;
+ const int screenNumberForPoint = QApplication::desktop()->screenNumber(p);
+ QScreen *actualScreen = QGuiApplication::screens().at(screenNumberForPoint);
+ if (actualScreen && currentScreen != actualScreen) {
+ if (!q->windowHandle()) // Try to create a window handle if not created.
+ createWinId();
+ if (q->windowHandle())
+ q->windowHandle()->setScreen(actualScreen);
+ itemsDirty = true;
+ }
+}
void QMenuPrivate::updateLayoutDirection()
{
@@ -2321,6 +2337,7 @@ void QMenu::popup(const QPoint &p, QAction *atAction)
d->motions = 0;
d->doChildEffects = true;
d->updateLayoutDirection();
+ d->adjustMenuScreen(p);
#if QT_CONFIG(menubar)
// if this menu is part of a chain attached to a QMenuBar, set the
@@ -3766,5 +3783,3 @@ QT_END_NAMESPACE
// for private slots
#include "moc_qmenu.cpp"
#include "qmenu.moc"
-
-#endif // QT_NO_MENU
diff --git a/src/widgets/widgets/qmenu.h b/src/widgets/widgets/qmenu.h
index 61849790cf..7cf73f55b3 100644
--- a/src/widgets/widgets/qmenu.h
+++ b/src/widgets/widgets/qmenu.h
@@ -50,10 +50,9 @@
Q_FORWARD_DECLARE_OBJC_CLASS(NSMenu);
#endif
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(menu);
-#ifndef QT_NO_MENU
+QT_BEGIN_NAMESPACE
class QMenuPrivate;
class QStyleOptionMenuItem;
@@ -280,8 +279,6 @@ private:
inline QT_DEPRECATED void qt_mac_set_dock_menu(QMenu *menu) { menu->setAsDockMenu(); }
#endif
-#endif // QT_NO_MENU
-
QT_END_NAMESPACE
#endif // QMENU_H
diff --git a/src/widgets/widgets/qmenu_mac.mm b/src/widgets/widgets/qmenu_mac.mm
index 65b7030e20..7d932c670f 100644
--- a/src/widgets/widgets/qmenu_mac.mm
+++ b/src/widgets/widgets/qmenu_mac.mm
@@ -54,7 +54,7 @@
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
namespace {
// TODO use QtMacExtras copy of this function when available.
@@ -139,7 +139,7 @@ void QMenuPrivate::moveWidgetToPlatformItem(QWidget *widget, QPlatformMenuItem*
container->show();
}
-#endif //QT_NO_MENU
+#endif // QT_CONFIG(menu)
#if QT_CONFIG(menubar)
diff --git a/src/widgets/widgets/qmenu_p.h b/src/widgets/widgets/qmenu_p.h
index e86545ad2a..5869bc8420 100644
--- a/src/widgets/widgets/qmenu_p.h
+++ b/src/widgets/widgets/qmenu_p.h
@@ -64,9 +64,9 @@
#include <qpa/qplatformmenu.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(menu);
-#ifndef QT_NO_MENU
+QT_BEGIN_NAMESPACE
class QTornOffMenu;
class QEventLoop;
@@ -449,6 +449,7 @@ public:
bool hasMouseMoved(const QPoint &globalPos);
+ void adjustMenuScreen(const QPoint &p);
void updateLayoutDirection();
//menu fading/scrolling effects
@@ -480,8 +481,6 @@ public:
QRect rect() const;
};
-#endif // QT_NO_MENU
-
QT_END_NAMESPACE
#endif // QMENU_P_H
diff --git a/src/widgets/widgets/qmenubar.cpp b/src/widgets/widgets/qmenubar.cpp
index b2fd932486..aa8e6a1c6a 100644
--- a/src/widgets/widgets/qmenubar.cpp
+++ b/src/widgets/widgets/qmenubar.cpp
@@ -49,7 +49,9 @@
#include <qpainter.h>
#include <qstylepainter.h>
#include <qevent.h>
+#if QT_CONFIG(mainwindow)
#include <qmainwindow.h>
+#endif
#include <qtoolbar.h>
#if QT_CONFIG(toolbutton)
#include <qtoolbutton.h>
@@ -82,7 +84,7 @@ QMenuBarExtension::QMenuBarExtension(QWidget *parent)
{
setObjectName(QLatin1String("qt_menubar_ext_button"));
setAutoRaise(true);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
setPopupMode(QToolButton::InstantPopup);
#endif
setIcon(style()->standardIcon(QStyle::SP_ToolBarHorizontalExtensionButton, 0, parentWidget()));
diff --git a/src/widgets/widgets/qplaintextedit.cpp b/src/widgets/widgets/qplaintextedit.cpp
index 6d3f5649c2..555b1f94ad 100644
--- a/src/widgets/widgets/qplaintextedit.cpp
+++ b/src/widgets/widgets/qplaintextedit.cpp
@@ -46,7 +46,9 @@
#include <qdebug.h>
#include <qdrag.h>
#include <qclipboard.h>
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#include <qstyle.h>
#include <qtimer.h>
#include "private/qtextdocumentlayout_p.h"
@@ -63,8 +65,6 @@
#include <qtexttable.h>
#include <qvariant.h>
-#ifndef QT_NO_TEXTEDIT
-
QT_BEGIN_NAMESPACE
static inline bool shouldEnableInputMethod(QPlainTextEdit *plaintextedit)
@@ -3216,5 +3216,3 @@ QT_END_NAMESPACE
#include "moc_qplaintextedit.cpp"
#include "moc_qplaintextedit_p.cpp"
-
-#endif // QT_NO_TEXTEDIT
diff --git a/src/widgets/widgets/qplaintextedit.h b/src/widgets/widgets/qplaintextedit.h
index 09e714fd3c..cd25b45d50 100644
--- a/src/widgets/widgets/qplaintextedit.h
+++ b/src/widgets/widgets/qplaintextedit.h
@@ -50,11 +50,10 @@
#include <QtGui/qtextformat.h>
#include <QtGui/qabstracttextdocumentlayout.h>
-#ifndef QT_NO_TEXTEDIT
+QT_REQUIRE_CONFIG(textedit);
QT_BEGIN_NAMESPACE
-
class QStyleSheet;
class QTextDocument;
class QMenu;
@@ -337,7 +336,4 @@ private:
QT_END_NAMESPACE
-
-#endif // QT_NO_TEXTEDIT
-
#endif // QPLAINTEXTEDIT_H
diff --git a/src/widgets/widgets/qplaintextedit_p.h b/src/widgets/widgets/qplaintextedit_p.h
index 2484f9a33c..3d6e7781ed 100644
--- a/src/widgets/widgets/qplaintextedit_p.h
+++ b/src/widgets/widgets/qplaintextedit_p.h
@@ -59,15 +59,17 @@
#endif
#include "QtGui/qtextcursor.h"
#include "QtGui/qtextformat.h"
+#if QT_CONFIG(menu)
#include "QtWidgets/qmenu.h"
+#endif
#include "QtGui/qabstracttextdocumentlayout.h"
#include "QtCore/qbasictimer.h"
#include "qplaintextedit.h"
-#ifndef QT_NO_TEXTEDIT
-
#include "private/qwidgettextcontrol_p.h"
+QT_REQUIRE_CONFIG(textedit);
+
QT_BEGIN_NAMESPACE
class QMimeData;
@@ -187,6 +189,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_TEXTEDIT
-
#endif // QPLAINTEXTEDIT_P_H
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index 3dd6ee9b0a..caf175e6ff 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -47,7 +47,6 @@
#include "qdrawutil.h"
#include "qevent.h"
#include "qfontmetrics.h"
-#include "qmenu.h"
#include "qstylepainter.h"
#include "qpixmap.h"
#include "qpointer.h"
@@ -65,7 +64,10 @@
#include "qaccessible.h"
#endif
+#if QT_CONFIG(menu)
+#include "qmenu.h"
#include "private/qmenu_p.h"
+#endif
#include "private/qpushbutton_p.h"
QT_BEGIN_NAMESPACE
@@ -314,7 +316,7 @@ void QPushButton::initStyleOption(QStyleOptionButton *option) const
option->features = QStyleOptionButton::None;
if (d->flat)
option->features |= QStyleOptionButton::Flat;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (d->menu)
option->features |= QStyleOptionButton::HasMenu;
#endif
@@ -419,7 +421,7 @@ QSize QPushButton::sizeHint() const
if(!empty || !h)
h = qMax(h, sz.height());
opt.rect.setSize(QSize(w, h)); // PM_MenuButtonIndicator depends on the height
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (menu())
w += style()->pixelMetric(QStyle::PM_MenuButtonIndicator, &opt, this);
#endif
@@ -499,13 +501,13 @@ void QPushButton::focusOutEvent(QFocusEvent *e)
}
QAbstractButton::focusOutEvent(e);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (d->menu && d->menu->isVisible()) // restore pressed status
setDown(true);
#endif
}
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
/*!
Associates the popup menu \a menu with this push button. This
turns the button into a menu button, which in some styles will
@@ -628,7 +630,7 @@ QPoint QPushButtonPrivate::adjustedMenuPosition()
return QPoint(x,y);
}
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
void QPushButtonPrivate::resetLayoutItemMargins()
{
diff --git a/src/widgets/widgets/qpushbutton.h b/src/widgets/widgets/qpushbutton.h
index ea9baa8ccb..c005f320cc 100644
--- a/src/widgets/widgets/qpushbutton.h
+++ b/src/widgets/widgets/qpushbutton.h
@@ -74,7 +74,7 @@ public:
bool isDefault() const;
void setDefault(bool);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void setMenu(QMenu* menu);
QMenu* menu() const;
#endif
@@ -83,7 +83,7 @@ public:
bool isFlat() const;
public Q_SLOTS:
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void showMenu();
#endif
@@ -101,7 +101,7 @@ public:
private:
Q_DISABLE_COPY(QPushButton)
Q_DECLARE_PRIVATE(QPushButton)
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
Q_PRIVATE_SLOT(d_func(), void _q_popupPressed())
#endif
};
diff --git a/src/widgets/widgets/qpushbutton_p.h b/src/widgets/widgets/qpushbutton_p.h
index a32b599b94..a58675fe64 100644
--- a/src/widgets/widgets/qpushbutton_p.h
+++ b/src/widgets/widgets/qpushbutton_p.h
@@ -76,7 +76,7 @@ public:
#if 0 // Used to be included in Qt4 for Q_WS_MAC
bool hitButton(const QPoint &pos);
#endif
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QPoint adjustedMenuPosition();
#endif
void resetLayoutItemMargins();
diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp
index e40c922e97..b4168268a0 100644
--- a/src/widgets/widgets/qscrollbar.cpp
+++ b/src/widgets/widgets/qscrollbar.cpp
@@ -44,7 +44,9 @@
#include "qscrollbar.h"
#include "qstyle.h"
#include "qstyleoption.h"
+#if QT_CONFIG(menu)
#include "qmenu.h"
+#endif
#include <QtCore/qelapsedtimer.h>
#ifndef QT_NO_ACCESSIBILITY
@@ -395,7 +397,7 @@ void QScrollBar::contextMenuEvent(QContextMenuEvent *event)
return ;
}
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
bool horiz = HORIZONTAL;
QPointer<QMenu> menu = new QMenu(this);
QAction *actScrollHere = menu->addAction(tr("Scroll here"));
@@ -426,7 +428,7 @@ void QScrollBar::contextMenuEvent(QContextMenuEvent *event)
triggerAction(QAbstractSlider::SliderSingleStepSub);
else if (actionSelected == actScrollDn)
triggerAction(QAbstractSlider::SliderSingleStepAdd);
-#endif // QT_NO_MENU
+#endif // QT_CONFIG(menu)
}
#endif // QT_NO_CONTEXTMENU
diff --git a/src/widgets/widgets/qsizegrip.cpp b/src/widgets/widgets/qsizegrip.cpp
index fcbdbc7674..dc5a7158dd 100644
--- a/src/widgets/widgets/qsizegrip.cpp
+++ b/src/widgets/widgets/qsizegrip.cpp
@@ -39,8 +39,6 @@
#include "qsizegrip.h"
-#ifndef QT_NO_SIZEGRIP
-
#include "qapplication.h"
#include "qevent.h"
#include "qpainter.h"
@@ -508,5 +506,3 @@ bool QSizeGrip::event(QEvent *event)
QT_END_NAMESPACE
#include "moc_qsizegrip.cpp"
-
-#endif //QT_NO_SIZEGRIP
diff --git a/src/widgets/widgets/qsizegrip.h b/src/widgets/widgets/qsizegrip.h
index 831b146dd2..6ad2405339 100644
--- a/src/widgets/widgets/qsizegrip.h
+++ b/src/widgets/widgets/qsizegrip.h
@@ -43,10 +43,10 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(sizegrip);
+QT_BEGIN_NAMESPACE
-#ifndef QT_NO_SIZEGRIP
class QSizeGripPrivate;
class Q_WIDGETS_EXPORT QSizeGrip : public QWidget
{
@@ -76,7 +76,6 @@ private:
Q_DISABLE_COPY(QSizeGrip)
Q_PRIVATE_SLOT(d_func(), void _q_showIfNotHidden())
};
-#endif // QT_NO_SIZEGRIP
QT_END_NAMESPACE
diff --git a/src/widgets/widgets/qslider.cpp b/src/widgets/widgets/qslider.cpp
index 356cbcfce7..47d3b2fb81 100644
--- a/src/widgets/widgets/qslider.cpp
+++ b/src/widgets/widgets/qslider.cpp
@@ -38,7 +38,6 @@
****************************************************************************/
#include "qslider.h"
-#ifndef QT_NO_SLIDER
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
#endif
@@ -547,8 +546,6 @@ Q_WIDGETS_EXPORT QStyleOptionSlider qt_qsliderStyleOption(QSlider *slider)
return sliderOption;
}
-#endif
-
QT_END_NAMESPACE
#include "moc_qslider.cpp"
diff --git a/src/widgets/widgets/qslider.h b/src/widgets/widgets/qslider.h
index 001863c18d..642e836af7 100644
--- a/src/widgets/widgets/qslider.h
+++ b/src/widgets/widgets/qslider.h
@@ -42,12 +42,11 @@
#include <QtWidgets/qtwidgetsglobal.h>
-#if QT_CONFIG(slider)
-
#include <QtWidgets/qabstractslider.h>
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(slider);
+QT_BEGIN_NAMESPACE
class QSliderPrivate;
class QStyleOptionSlider;
@@ -102,6 +101,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_CONFIG(slider)
-
#endif // QSLIDER_H
diff --git a/src/widgets/widgets/qspinbox.cpp b/src/widgets/widgets/qspinbox.cpp
index 508cb05cfc..b62a7768ce 100644
--- a/src/widgets/widgets/qspinbox.cpp
+++ b/src/widgets/widgets/qspinbox.cpp
@@ -40,8 +40,6 @@
#include <private/qabstractspinbox_p.h>
#include <qspinbox.h>
-#ifndef QT_NO_SPINBOX
-
#include <qlineedit.h>
#include <qlocale.h>
#include <qvalidator.h>
@@ -1321,5 +1319,3 @@ bool QSpinBox::event(QEvent *event)
QT_END_NAMESPACE
#include "moc_qspinbox.cpp"
-
-#endif // QT_NO_SPINBOX
diff --git a/src/widgets/widgets/qspinbox.h b/src/widgets/widgets/qspinbox.h
index 2eb12fd90d..b61e665413 100644
--- a/src/widgets/widgets/qspinbox.h
+++ b/src/widgets/widgets/qspinbox.h
@@ -43,10 +43,9 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qabstractspinbox.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(spinbox);
-#ifndef QT_NO_SPINBOX
+QT_BEGIN_NAMESPACE
class QSpinBoxPrivate;
class Q_WIDGETS_EXPORT QSpinBox : public QAbstractSpinBox
@@ -168,8 +167,6 @@ private:
Q_DECLARE_PRIVATE(QDoubleSpinBox)
};
-#endif // QT_NO_SPINBOX
-
QT_END_NAMESPACE
#endif // QSPINBOX_H
diff --git a/src/widgets/widgets/qstatusbar.cpp b/src/widgets/widgets/qstatusbar.cpp
index da7c86a2af..4635b73a81 100644
--- a/src/widgets/widgets/qstatusbar.cpp
+++ b/src/widgets/widgets/qstatusbar.cpp
@@ -47,8 +47,12 @@
#include "qtimer.h"
#include "qstyle.h"
#include "qstyleoption.h"
+#if QT_CONFIG(sizegrip)
#include "qsizegrip.h"
+#endif
+#if QT_CONFIG(mainwindow)
#include "qmainwindow.h"
+#endif
#ifndef QT_NO_ACCESSIBILITY
#include "qaccessible.h"
@@ -79,7 +83,7 @@ public:
QBoxLayout * box;
QTimer * timer;
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
QSizeGrip * resizer;
bool showSizeGrip;
#endif
@@ -101,7 +105,7 @@ public:
return i;
}
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
void tryToShowSizeGrip()
{
if (!showSizeGrip)
@@ -127,7 +131,7 @@ QRect QStatusBarPrivate::messageRect() const
int left = 6;
int right = q->width() - 12;
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
if (resizer && resizer->isVisible()) {
if (rtl)
left = resizer->x() + resizer->width();
@@ -232,7 +236,7 @@ QStatusBar::QStatusBar(QWidget * parent)
d->box = 0;
d->timer = 0;
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
d->resizer = 0;
setSizeGripEnabled(true); // causes reformat()
#else
@@ -429,7 +433,7 @@ void QStatusBar::removeWidget(QWidget *widget)
bool QStatusBar::isSizeGripEnabled() const
{
-#ifdef QT_NO_SIZEGRIP
+#if !QT_CONFIG(sizegrip)
return false;
#else
Q_D(const QStatusBar);
@@ -439,7 +443,7 @@ bool QStatusBar::isSizeGripEnabled() const
void QStatusBar::setSizeGripEnabled(bool enabled)
{
-#ifdef QT_NO_SIZEGRIP
+#if !QT_CONFIG(sizegrip)
Q_UNUSED(enabled);
#else
Q_D(QStatusBar);
@@ -475,7 +479,7 @@ void QStatusBar::reformat()
delete d->box;
QBoxLayout *vbox;
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
if (d->resizer) {
d->box = new QHBoxLayout(this);
d->box->setMargin(0);
@@ -516,7 +520,7 @@ void QStatusBar::reformat()
int itemH = qMin(qSmartMinSize(item->w).height(), item->w->maximumHeight());
maxH = qMax(maxH, itemH);
}
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
if (d->resizer) {
maxH = qMax(maxH, d->resizer->sizeHint().height());
d->box->addSpacing(1);
@@ -647,7 +651,7 @@ void QStatusBar::hideOrShow()
*/
void QStatusBar::showEvent(QShowEvent *)
{
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
Q_D(QStatusBar);
if (d->resizer && d->showSizeGrip)
d->tryToShowSizeGrip();
@@ -720,7 +724,7 @@ bool QStatusBar::event(QEvent *e)
maxH = qMax(maxH, itemH);
}
-#ifndef QT_NO_SIZEGRIP
+#if QT_CONFIG(sizegrip)
if (d->resizer)
maxH = qMax(maxH, d->resizer->sizeHint().height());
#endif
diff --git a/src/widgets/widgets/qtextedit.cpp b/src/widgets/widgets/qtextedit.cpp
index 6ea67d385e..df8ecba112 100644
--- a/src/widgets/widgets/qtextedit.cpp
+++ b/src/widgets/widgets/qtextedit.cpp
@@ -38,19 +38,22 @@
****************************************************************************/
#include "qtextedit_p.h"
+#if QT_CONFIG(lineedit)
#include "qlineedit.h"
+#endif
#if QT_CONFIG(textbrowser)
#include "qtextbrowser.h"
#endif
-#ifndef QT_NO_TEXTEDIT
#include <qfont.h>
#include <qpainter.h>
#include <qevent.h>
#include <qdebug.h>
#include <qdrag.h>
#include <qclipboard.h>
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#include <qstyle.h>
#include <qtimer.h>
#ifndef QT_NO_ACCESSIBILITY
@@ -69,12 +72,8 @@
#include <qtexttable.h>
#include <qvariant.h>
-#endif
-
QT_BEGIN_NAMESPACE
-
-#ifndef QT_NO_TEXTEDIT
static inline bool shouldEnableInputMethod(QTextEdit *textedit)
{
return !textedit->isReadOnly();
@@ -2658,8 +2657,6 @@ void QTextEdit::ensureCursorVisible()
(\a available is true) or unavailable (\a available is false).
*/
-#endif // QT_NO_TEXTEDIT
-
QT_END_NAMESPACE
#include "moc_qtextedit.cpp"
diff --git a/src/widgets/widgets/qtextedit.h b/src/widgets/widgets/qtextedit.h
index a3e5bd2a8a..954f0167ae 100644
--- a/src/widgets/widgets/qtextedit.h
+++ b/src/widgets/widgets/qtextedit.h
@@ -47,12 +47,10 @@
#include <QtGui/qtextcursor.h>
#include <QtGui/qtextformat.h>
-#ifndef QT_NO_TEXTEDIT
-
+QT_REQUIRE_CONFIG(textedit);
QT_BEGIN_NAMESPACE
-
class QStyleSheet;
class QTextDocument;
class QMenu;
@@ -329,6 +327,4 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(QTextEdit::AutoFormatting)
QT_END_NAMESPACE
-#endif // QT_NO_TEXTEDIT
-
#endif // QTEXTEDIT_H
diff --git a/src/widgets/widgets/qtextedit_p.h b/src/widgets/widgets/qtextedit_p.h
index 28257fe29f..c4ee75c78d 100644
--- a/src/widgets/widgets/qtextedit_p.h
+++ b/src/widgets/widgets/qtextedit_p.h
@@ -59,16 +59,18 @@
#endif
#include "QtGui/qtextcursor.h"
#include "QtGui/qtextformat.h"
+#if QT_CONFIG(menu)
#include "QtWidgets/qmenu.h"
+#endif
#include "QtGui/qabstracttextdocumentlayout.h"
#include "QtCore/qbasictimer.h"
#include "QtCore/qurl.h"
#include "qtextedit.h"
-#ifndef QT_NO_TEXTEDIT
-
#include "private/qwidgettextcontrol_p.h"
+QT_REQUIRE_CONFIG(textedit);
+
QT_BEGIN_NAMESPACE
class QMimeData;
@@ -141,6 +143,4 @@ public:
QT_END_NAMESPACE
-#endif // QT_NO_TEXTEDIT
-
#endif // QTEXTEDIT_P_H
diff --git a/src/widgets/widgets/qtoolbutton.cpp b/src/widgets/widgets/qtoolbutton.cpp
index 60c9c43399..96b88340cd 100644
--- a/src/widgets/widgets/qtoolbutton.cpp
+++ b/src/widgets/widgets/qtoolbutton.cpp
@@ -45,19 +45,23 @@
#include <qdrawutil.h>
#include <qevent.h>
#include <qicon.h>
-#include <qmenu.h>
#include <qpainter.h>
#include <qpointer.h>
#include <qstyle.h>
#include <qstyleoption.h>
#include <qtooltip.h>
+#if QT_CONFIG(mainwindow)
#include <qmainwindow.h>
+#endif
#include <qtoolbar.h>
#include <qvariant.h>
#include <qstylepainter.h>
#include <private/qabstractbutton_p.h>
#include <private/qaction_p.h>
+#if QT_CONFIG(menu)
+#include <qmenu.h>
#include <private/qmenu_p.h>
+#endif
QT_BEGIN_NAMESPACE
@@ -66,7 +70,7 @@ class QToolButtonPrivate : public QAbstractButtonPrivate
Q_DECLARE_PUBLIC(QToolButton)
public:
void init();
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void _q_buttonPressed();
void _q_buttonReleased();
void popupTimerDone();
@@ -90,14 +94,14 @@ public:
uint autoRaise : 1;
uint repeat : 1;
QAction *defaultAction;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
bool hasMenu() const;
//workaround for task 177850
QList<QAction *> actionsCopy;
#endif
};
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
bool QToolButtonPrivate::hasMenu() const
{
return ((defaultAction && defaultAction->menu())
@@ -215,7 +219,7 @@ void QToolButtonPrivate::init()
q->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed,
QSizePolicy::ToolButton));
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QObject::connect(q, SIGNAL(pressed()), q, SLOT(_q_buttonPressed()));
QObject::connect(q, SIGNAL(released()), q, SLOT(_q_buttonReleased()));
#endif
@@ -287,7 +291,7 @@ void QToolButton::initStyleOption(QStyleOptionToolButton *option) const
option->features |= QStyleOptionToolButton::Arrow;
if (d->popupMode == QToolButton::DelayedPopup)
option->features |= QStyleOptionToolButton::PopupDelay;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (d->hasMenu())
option->features |= QStyleOptionToolButton::HasMenu;
#endif
@@ -472,7 +476,7 @@ void QToolButton::actionEvent(QActionEvent *event)
case QEvent::ActionRemoved:
if (d->defaultAction == action)
d->defaultAction = 0;
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (action == d->menuAction)
d->menuAction = 0;
#endif
@@ -551,7 +555,7 @@ void QToolButton::leaveEvent(QEvent * e)
*/
void QToolButton::timerEvent(QTimerEvent *e)
{
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
Q_D(QToolButton);
if (e->timerId() == d->popupTimer.timerId()) {
d->popupTimerDone();
@@ -590,7 +594,7 @@ void QToolButton::changeEvent(QEvent *e)
void QToolButton::mousePressEvent(QMouseEvent *e)
{
Q_D(QToolButton);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
QStyleOptionToolButton opt;
initStyleOption(&opt);
if (e->button() == Qt::LeftButton && (d->popupMode == MenuButtonPopup)) {
@@ -629,7 +633,7 @@ bool QToolButton::hitButton(const QPoint &pos) const
}
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
/*!
Associates the given \a menu with this tool button.
@@ -822,10 +826,7 @@ void QToolButtonPrivate::_q_menuTriggered(QAction *action)
if (action && !actionsCopy.contains(action))
emit q->triggered(action);
}
-#endif // QT_NO_MENU
-
-#ifndef QT_NO_MENU
/*! \enum QToolButton::ToolButtonPopupMode
Describes how a menu should be popped up for tool buttons that has
@@ -900,7 +901,7 @@ bool QToolButton::autoRaise() const
void QToolButton::setDefaultAction(QAction *action)
{
Q_D(QToolButton);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
bool hadMenu = false;
hadMenu = d->hasMenu();
#endif
@@ -925,7 +926,7 @@ void QToolButton::setDefaultAction(QAction *action)
#if QT_CONFIG(whatsthis)
setWhatsThis(action->whatsThis());
#endif
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
if (action->menu() && !hadMenu) {
// new 'default' popup mode defined introduced by tool bar. We
// should have changed QToolButton's default instead. Do that
diff --git a/src/widgets/widgets/qtoolbutton.h b/src/widgets/widgets/qtoolbutton.h
index 7ba9a18fef..dd9964cb94 100644
--- a/src/widgets/widgets/qtoolbutton.h
+++ b/src/widgets/widgets/qtoolbutton.h
@@ -56,7 +56,7 @@ class Q_WIDGETS_EXPORT QToolButton : public QAbstractButton
{
Q_OBJECT
Q_ENUMS(Qt::ToolButtonStyle Qt::ArrowType)
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
Q_PROPERTY(ToolButtonPopupMode popupMode READ popupMode WRITE setPopupMode)
#endif
Q_PROPERTY(Qt::ToolButtonStyle toolButtonStyle READ toolButtonStyle WRITE setToolButtonStyle)
@@ -82,7 +82,7 @@ public:
Qt::ArrowType arrowType() const;
void setArrowType(Qt::ArrowType type);
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void setMenu(QMenu* menu);
QMenu* menu() const;
@@ -96,7 +96,7 @@ public:
bool autoRaise() const;
public Q_SLOTS:
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
void showMenu();
#endif
void setToolButtonStyle(Qt::ToolButtonStyle style);
@@ -124,7 +124,7 @@ protected:
private:
Q_DISABLE_COPY(QToolButton)
Q_DECLARE_PRIVATE(QToolButton)
-#ifndef QT_NO_MENU
+#if QT_CONFIG(menu)
Q_PRIVATE_SLOT(d_func(), void _q_buttonPressed())
Q_PRIVATE_SLOT(d_func(), void _q_buttonReleased())
Q_PRIVATE_SLOT(d_func(), void _q_updateButtonDown())
diff --git a/src/widgets/widgets/qwidgetanimator.cpp b/src/widgets/widgets/qwidgetanimator.cpp
index 3a00999e57..b6828a14ef 100644
--- a/src/widgets/widgets/qwidgetanimator.cpp
+++ b/src/widgets/widgets/qwidgetanimator.cpp
@@ -40,7 +40,9 @@
#include <QtCore/qpropertyanimation.h>
#include <QtWidgets/qwidget.h>
#include <QtWidgets/qstyle.h>
+#if QT_CONFIG(mainwindow)
#include <private/qmainwindowlayout_p.h>
+#endif
#include "qwidgetanimator_p.h"
@@ -61,7 +63,7 @@ void QWidgetAnimator::abort(QWidget *w)
if (anim) {
anim->stop();
}
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
m_mainWindowLayout->animationFinished(w);
#endif
#else
@@ -108,9 +110,9 @@ void QWidgetAnimator::animate(QWidget *widget, const QRect &_final_geometry, boo
{
//we do it in one shot
widget->setGeometry(final_geometry);
-#ifndef QT_NO_MAINWINDOW
+#if QT_CONFIG(mainwindow)
m_mainWindowLayout->animationFinished(widget);
-#endif //QT_NO_MAINWINDOW
+#endif // QT_CONFIG(mainwindow)
}
}
diff --git a/src/widgets/widgets/qwidgetlinecontrol.cpp b/src/widgets/widgets/qwidgetlinecontrol.cpp
index 3abe82ce59..1b7a41d547 100644
--- a/src/widgets/widgets/qwidgetlinecontrol.cpp
+++ b/src/widgets/widgets/qwidgetlinecontrol.cpp
@@ -39,8 +39,6 @@
#include "qwidgetlinecontrol_p.h"
-#ifndef QT_NO_LINEEDIT
-
#if QT_CONFIG(itemviews)
#include "qabstractitemview.h"
#endif
@@ -57,6 +55,8 @@
#include "qgraphicssceneevent.h"
#endif
+#include "qvalidator.h"
+
QT_BEGIN_NAMESPACE
@@ -1973,5 +1973,3 @@ bool QWidgetLineControl::isRedoAvailable() const
QT_END_NAMESPACE
#include "moc_qwidgetlinecontrol_p.cpp"
-
-#endif
diff --git a/src/widgets/widgets/qwidgetlinecontrol_p.h b/src/widgets/widgets/qwidgetlinecontrol_p.h
index 243a1a7723..16c9cc71eb 100644
--- a/src/widgets/widgets/qwidgetlinecontrol_p.h
+++ b/src/widgets/widgets/qwidgetlinecontrol_p.h
@@ -53,7 +53,6 @@
#include <QtWidgets/private/qtwidgetsglobal_p.h>
-#ifndef QT_NO_LINEEDIT
#include "private/qwidget_p.h"
#include "QtWidgets/qlineedit.h"
#include "QtGui/qtextlayout.h"
@@ -76,8 +75,9 @@
# undef DrawText
#endif
-QT_BEGIN_NAMESPACE
+QT_REQUIRE_CONFIG(lineedit);
+QT_BEGIN_NAMESPACE
class Q_WIDGETS_EXPORT QWidgetLineControl : public QInputControl
{
@@ -564,6 +564,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_LINEEDIT
-
#endif // QWIDGETLINECONTROL_P_H
diff --git a/src/widgets/widgets/qwidgetresizehandler.cpp b/src/widgets/widgets/qwidgetresizehandler.cpp
index 0e971a37cd..3612a04e99 100644
--- a/src/widgets/widgets/qwidgetresizehandler.cpp
+++ b/src/widgets/widgets/qwidgetresizehandler.cpp
@@ -44,7 +44,9 @@
#include "qdesktopwidget.h"
#include <private/qdesktopwidget_p.h>
#include "qcursor.h"
+#if QT_CONFIG(sizegrip)
#include "qsizegrip.h"
+#endif
#include "qevent.h"
#include "qdebug.h"
#include "private/qlayoutengine_p.h"
diff --git a/src/widgets/widgets/qwidgettextcontrol.cpp b/src/widgets/widgets/qwidgettextcontrol.cpp
index 706e63bbdc..aa5a3329e9 100644
--- a/src/widgets/widgets/qwidgettextcontrol.cpp
+++ b/src/widgets/widgets/qwidgettextcontrol.cpp
@@ -48,12 +48,16 @@
#include <qdebug.h>
#include <qdrag.h>
#include <qclipboard.h>
+#if QT_CONFIG(menu)
#include <qmenu.h>
+#endif
#include <qstyle.h>
#include <qtimer.h>
#include "private/qtextdocumentlayout_p.h"
#include "private/qabstracttextdocumentlayout_p.h"
+#if QT_CONFIG(textedit)
#include "private/qtextedit_p.h"
+#endif
#include "qtextdocument.h"
#include "private/qtextdocument_p.h"
#include "qtextlist.h"
@@ -79,7 +83,9 @@
#include <qinputmethod.h>
#include <qtooltip.h>
#include <qstyleoption.h>
+#if QT_CONFIG(lineedit)
#include <QtWidgets/qlineedit.h>
+#endif
#include <QtGui/qaccessible.h>
#include <QtCore/qmetaobject.h>
@@ -1350,7 +1356,7 @@ process:
QVariant QWidgetTextControl::loadResource(int type, const QUrl &name)
{
-#ifdef QT_NO_TEXTEDIT
+#if !QT_CONFIG(textedit)
Q_UNUSED(type);
Q_UNUSED(name);
#else
@@ -2411,7 +2417,7 @@ void QWidgetTextControl::setAcceptRichText(bool accept)
d->acceptRichText = accept;
}
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
void QWidgetTextControl::setExtraSelections(const QList<QTextEdit::ExtraSelection> &selections)
{
@@ -2475,7 +2481,7 @@ QList<QTextEdit::ExtraSelection> QWidgetTextControl::extraSelections() const
return selections;
}
-#endif // QT_NO_TEXTEDIT
+#endif // QT_CONFIG(textedit)
void QWidgetTextControl::setTextWidth(qreal width)
{
@@ -3296,7 +3302,7 @@ void QUnicodeControlCharacterMenu::menuActionTriggered()
QChar c(qt_controlCharacters[idx].character);
QString str(c);
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
if (QTextEdit *edit = qobject_cast<QTextEdit *>(editWidget)) {
edit->insertPlainText(str);
return;
@@ -3305,7 +3311,7 @@ void QUnicodeControlCharacterMenu::menuActionTriggered()
if (QWidgetTextControl *control = qobject_cast<QWidgetTextControl *>(editWidget)) {
control->insertPlainText(str);
}
-#ifndef QT_NO_LINEEDIT
+#if QT_CONFIG(lineedit)
if (QLineEdit *edit = qobject_cast<QLineEdit *>(editWidget)) {
edit->insert(str);
return;
diff --git a/src/widgets/widgets/qwidgettextcontrol_p.h b/src/widgets/widgets/qwidgettextcontrol_p.h
index e2539a30e7..11ff63c5e4 100644
--- a/src/widgets/widgets/qwidgettextcontrol_p.h
+++ b/src/widgets/widgets/qwidgettextcontrol_p.h
@@ -56,8 +56,12 @@
#include <QtGui/qtextoption.h>
#include <QtGui/qtextcursor.h>
#include <QtGui/qtextformat.h>
+#if QT_CONFIG(textedit)
#include <QtWidgets/qtextedit.h>
+#endif
+#if QT_CONFIG(menu)
#include <QtWidgets/qmenu.h>
+#endif
#include <QtCore/qrect.h>
#include <QtGui/qabstracttextdocumentlayout.h>
#include <QtGui/qtextdocumentfragment.h>
@@ -148,7 +152,7 @@ public:
bool acceptRichText() const;
void setAcceptRichText(bool accept);
-#ifndef QT_NO_TEXTEDIT
+#if QT_CONFIG(textedit)
void setExtraSelections(const QList<QTextEdit::ExtraSelection> &selections);
QList<QTextEdit::ExtraSelection> extraSelections() const;
#endif
diff --git a/src/widgets/widgets/qwidgettextcontrol_p_p.h b/src/widgets/widgets/qwidgettextcontrol_p_p.h
index 3917752d19..232dab180f 100644
--- a/src/widgets/widgets/qwidgettextcontrol_p_p.h
+++ b/src/widgets/widgets/qwidgettextcontrol_p_p.h
@@ -55,7 +55,9 @@
#include "QtGui/qtextdocumentfragment.h"
#include "QtGui/qtextcursor.h"
#include "QtGui/qtextformat.h"
+#if QT_CONFIG(menu)
#include "QtWidgets/qmenu.h"
+#endif
#include "QtGui/qabstracttextdocumentlayout.h"
#include "QtCore/qbasictimer.h"
#include "QtCore/qpointer.h"
diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri
index 5737af41c3..a197c41b95 100644
--- a/src/widgets/widgets/widgets.pri
+++ b/src/widgets/widgets/widgets.pri
@@ -1,25 +1,8 @@
# Qt widgets module
HEADERS += \
- widgets/qabstractspinbox.h \
- widgets/qabstractspinbox_p.h \
widgets/qframe.h \
widgets/qframe_p.h \
- widgets/qlineedit.h \
- widgets/qlineedit_p.h \
- widgets/qmainwindow.h \
- widgets/qmainwindowlayout_p.h \
- widgets/qmdiarea.h \
- widgets/qmdiarea_p.h \
- widgets/qmdisubwindow.h \
- widgets/qmdisubwindow_p.h \
- widgets/qmenu.h \
- widgets/qmenu_p.h \
- widgets/qsizegrip.h \
- widgets/qslider.h \
- widgets/qspinbox.h \
- widgets/qtextedit.h \
- widgets/qtextedit_p.h \
widgets/qtoolbar.h \
widgets/qtoolbar_p.h \
widgets/qtoolbarlayout_p.h \
@@ -28,34 +11,17 @@ HEADERS += \
widgets/qabstractscrollarea_p.h \
widgets/qfocusframe.h \
widgets/qwidgetanimator_p.h \
- widgets/qwidgetlinecontrol_p.h \
- widgets/qtoolbararealayout_p.h \
- widgets/qplaintextedit.h \
- widgets/qplaintextedit_p.h
+ widgets/qtoolbararealayout_p.h
SOURCES += \
- widgets/qabstractspinbox.cpp \
widgets/qframe.cpp \
- widgets/qlineedit_p.cpp \
- widgets/qlineedit.cpp \
- widgets/qmainwindow.cpp \
- widgets/qmainwindowlayout.cpp \
- widgets/qmdiarea.cpp \
- widgets/qmdisubwindow.cpp \
- widgets/qmenu.cpp \
- widgets/qsizegrip.cpp \
- widgets/qslider.cpp \
- widgets/qspinbox.cpp \
- widgets/qtextedit.cpp \
widgets/qtoolbar.cpp \
widgets/qtoolbarlayout.cpp \
widgets/qtoolbarseparator.cpp \
widgets/qabstractscrollarea.cpp \
widgets/qfocusframe.cpp \
widgets/qwidgetanimator.cpp \
- widgets/qwidgetlinecontrol.cpp \
- widgets/qtoolbararealayout.cpp \
- widgets/qplaintextedit.cpp
+ widgets/qtoolbararealayout.cpp
qtConfig(abstractbutton) {
HEADERS += \
@@ -177,6 +143,48 @@ qtConfig(lcdnumber) {
widgets/qlcdnumber.cpp
}
+qtConfig(lineedit) {
+ HEADERS += \
+ widgets/qlineedit.h \
+ widgets/qlineedit_p.h \
+ widgets/qwidgetlinecontrol_p.h
+
+ SOURCES += \
+ widgets/qlineedit_p.cpp \
+ widgets/qlineedit.cpp \
+ widgets/qwidgetlinecontrol.cpp
+}
+
+qtConfig(mainwindow) {
+ HEADERS += \
+ widgets/qmainwindow.h \
+ widgets/qmainwindowlayout_p.h
+
+ SOURCES += \
+ widgets/qmainwindow.cpp \
+ widgets/qmainwindowlayout.cpp
+}
+
+qtConfig(mdiarea) {
+ HEADERS += \
+ widgets/qmdiarea.h \
+ widgets/qmdiarea_p.h \
+ widgets/qmdisubwindow.h \
+ widgets/qmdisubwindow_p.h
+
+ SOURCES += \
+ widgets/qmdiarea.cpp \
+ widgets/qmdisubwindow.cpp
+}
+
+qtConfig(menu) {
+ HEADERS += \
+ widgets/qmenu.h \
+ widgets/qmenu_p.h
+
+ SOURCES += widgets/qmenu.cpp
+}
+
qtConfig(menubar) {
HEADERS += \
widgets/qmenubar.h \
@@ -241,6 +249,27 @@ qtConfig(scrollbar) {
SOURCES += widgets/qscrollbar.cpp
}
+qtConfig(sizegrip) {
+ HEADERS += widgets/qsizegrip.h
+ SOURCES += widgets/qsizegrip.cpp
+}
+
+qtConfig(slider) {
+ HEADERS += widgets/qslider.h
+ SOURCES += widgets/qslider.cpp
+}
+
+qtConfig(spinbox) {
+ HEADERS += \
+ widgets/qabstractspinbox.h \
+ widgets/qabstractspinbox_p.h \
+ widgets/qspinbox.h
+
+ SOURCES += \
+ widgets/qabstractspinbox.cpp \
+ widgets/qspinbox.cpp
+}
+
qtConfig(splashscreen) {
HEADERS += \
widgets/qsplashscreen.h
@@ -275,6 +304,18 @@ qtConfig(tabbar) {
SOURCES += widgets/qtabbar.cpp
}
+qtConfig(textedit) {
+ HEADERS += \
+ widgets/qplaintextedit.h \
+ widgets/qplaintextedit_p.h \
+ widgets/qtextedit.h \
+ widgets/qtextedit_p.h
+
+ SOURCES += \
+ widgets/qplaintextedit.cpp \
+ widgets/qtextedit.cpp
+}
+
qtConfig(textbrowser) {
HEADERS += widgets/qtextbrowser.h
SOURCES += widgets/qtextbrowser.cpp
@@ -315,7 +356,10 @@ macx {
widgets/qmaccocoaviewcontainer_mac.h
OBJECTIVE_SOURCES += \
- widgets/qmenu_mac.mm \
widgets/qmacnativewidget_mac.mm \
widgets/qmaccocoaviewcontainer_mac.mm
+
+ qtConfig(menu)|qtConfig(menubar) {
+ SOURCES += widgets/qmenu_mac.mm
+ }
}