summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephan Binner <stephan.binner@basyskom.com>2017-07-09 11:37:40 +0200
committerStephan Binner <stephan.binner@basyskom.com>2017-07-11 02:52:29 +0000
commit6cd46c9a61c3493b975416ec4309af75db5dafaf (patch)
tree29e4b5e744e0a2702bbbc17d0acea9f6090a9245 /src
parent3835194d340f8756d2ac7a5f9ae2a3519cb891b9 (diff)
Convert features.datetimeedit to QT_[REQUIRE_]CONFIG
Change-Id: I083cd565fab8c33dc3633b71f962de099c2b3481 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/itemviews/qitemeditorfactory.cpp6
-rw-r--r--src/widgets/styles/qmacstyle_mac.mm4
-rw-r--r--src/widgets/styles/qmacstyle_mac_p_p.h2
-rw-r--r--src/widgets/widgets/qabstractspinbox.cpp2
-rw-r--r--src/widgets/widgets/qdatetimeedit.cpp4
-rw-r--r--src/widgets/widgets/qdatetimeedit.h7
-rw-r--r--src/widgets/widgets/qdatetimeedit_p.h4
-rw-r--r--src/widgets/widgets/widgets.pri12
8 files changed, 22 insertions, 19 deletions
diff --git a/src/widgets/itemviews/qitemeditorfactory.cpp b/src/widgets/itemviews/qitemeditorfactory.cpp
index c535cf5f9e..a31689e0b5 100644
--- a/src/widgets/itemviews/qitemeditorfactory.cpp
+++ b/src/widgets/itemviews/qitemeditorfactory.cpp
@@ -44,7 +44,9 @@
#ifndef QT_NO_ITEMVIEWS
#include <qcombobox.h>
+#if QT_CONFIG(datetimeedit)
#include <qdatetimeedit.h>
+#endif
#if QT_CONFIG(label)
#include <qlabel.h>
#endif
@@ -252,7 +254,7 @@ QWidget *QDefaultItemEditorFactory::createEditor(int userType, QWidget *parent)
sb->setMaximum(INT_MAX);
return sb; }
#endif
-#ifndef QT_NO_DATETIMEEDIT
+#if QT_CONFIG(datetimeedit)
case QVariant::Date: {
QDateTimeEdit *ed = new QDateEdit(parent);
ed->setFrame(false);
@@ -308,7 +310,7 @@ QByteArray QDefaultItemEditorFactory::valuePropertyName(int userType) const
case QVariant::Double:
return "value";
#endif
-#ifndef QT_NO_DATETIMEEDIT
+#if QT_CONFIG(datetimeedit)
case QVariant::Date:
return "date";
case QVariant::Time:
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm
index 423ab6be5e..134df0cd72 100644
--- a/src/widgets/styles/qmacstyle_mac.mm
+++ b/src/widgets/styles/qmacstyle_mac.mm
@@ -96,7 +96,9 @@
#endif
#include <qdebug.h>
#include <qlibrary.h>
+#if QT_CONFIG(datetimeedit)
#include <qdatetimeedit.h>
+#endif
#include <qmath.h>
#include <QtWidgets/qgraphicsproxywidget.h>
#include <QtWidgets/qgraphicsview.h>
@@ -1391,7 +1393,7 @@ void QMacStylePrivate::initComboboxBdi(const QStyleOptionComboBox *combo, HIThem
// an extra check here before using the mini and small buttons.
int h = combo->rect.size().height();
if (combo->editable){
-#ifndef QT_NO_DATETIMEEDIT
+#if QT_CONFIG(datetimeedit)
if (qobject_cast<const QDateTimeEdit *>(widget)) {
// Except when, you know, we get a QDateTimeEdit with calendarPopup
// enabled. And then things get weird, basically because it's a
diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h
index f6bb2fdddd..4963e3692c 100644
--- a/src/widgets/styles/qmacstyle_mac_p_p.h
+++ b/src/widgets/styles/qmacstyle_mac_p_p.h
@@ -96,7 +96,9 @@
#include <qtreeview.h>
#include <qtableview.h>
#include <qdebug.h>
+#if QT_CONFIG(datetimeedit)
#include <qdatetimeedit.h>
+#endif
#include <qmath.h>
#include <qpair.h>
#include <qvector.h>
diff --git a/src/widgets/widgets/qabstractspinbox.cpp b/src/widgets/widgets/qabstractspinbox.cpp
index 4a3abe0c32..22f3745b26 100644
--- a/src/widgets/widgets/qabstractspinbox.cpp
+++ b/src/widgets/widgets/qabstractspinbox.cpp
@@ -49,7 +49,9 @@
#include <qstylehints.h>
#include <qclipboard.h>
#include <qdatetime.h>
+#if QT_CONFIG(datetimeedit)
#include <qdatetimeedit.h>
+#endif
#include <qevent.h>
#include <qmenu.h>
#include <qpainter.h>
diff --git a/src/widgets/widgets/qdatetimeedit.cpp b/src/widgets/widgets/qdatetimeedit.cpp
index e136363b17..053b184226 100644
--- a/src/widgets/widgets/qdatetimeedit.cpp
+++ b/src/widgets/widgets/qdatetimeedit.cpp
@@ -54,8 +54,6 @@
#include <algorithm>
-#ifndef QT_NO_DATETIMEEDIT
-
//#define QDATETIMEEDIT_QDTEDEBUG
#ifdef QDATETIMEEDIT_QDTEDEBUG
# define QDTEDEBUG qDebug() << QString::fromLatin1("%1:%2").arg(__FILE__).arg(__LINE__)
@@ -2674,5 +2672,3 @@ void QCalendarPopup::hideEvent(QHideEvent *)
QT_END_NAMESPACE
#include "moc_qdatetimeedit.cpp"
#include "moc_qdatetimeedit_p.cpp"
-
-#endif // QT_NO_DATETIMEEDIT
diff --git a/src/widgets/widgets/qdatetimeedit.h b/src/widgets/widgets/qdatetimeedit.h
index 30e4a58bb3..b46434c1a4 100644
--- a/src/widgets/widgets/qdatetimeedit.h
+++ b/src/widgets/widgets/qdatetimeedit.h
@@ -45,10 +45,9 @@
#include <QtCore/qvariant.h>
#include <QtWidgets/qabstractspinbox.h>
-QT_BEGIN_NAMESPACE
-
+QT_REQUIRE_CONFIG(datetimeedit);
-#ifndef QT_NO_DATETIMEEDIT
+QT_BEGIN_NAMESPACE
class QDateTimeEditPrivate;
class QStyleOptionSpinBox;
@@ -228,8 +227,6 @@ Q_SIGNALS:
Q_DECLARE_OPERATORS_FOR_FLAGS(QDateTimeEdit::Sections)
-#endif // QT_NO_DATETIMEEDIT
-
QT_END_NAMESPACE
#endif // QDATETIMEEDIT_H
diff --git a/src/widgets/widgets/qdatetimeedit_p.h b/src/widgets/widgets/qdatetimeedit_p.h
index 5302d6d9a7..bc70780de9 100644
--- a/src/widgets/widgets/qdatetimeedit_p.h
+++ b/src/widgets/widgets/qdatetimeedit_p.h
@@ -63,8 +63,6 @@
#include "qdebug.h"
-#ifndef QT_NO_DATETIMEEDIT
-
QT_BEGIN_NAMESPACE
class QCalendarPopup;
@@ -181,6 +179,4 @@ private:
QT_END_NAMESPACE
-#endif // QT_NO_DATETIMEEDIT
-
#endif // QDATETIMEEDIT_P_H
diff --git a/src/widgets/widgets/widgets.pri b/src/widgets/widgets/widgets.pri
index b142be8041..610932c6ce 100644
--- a/src/widgets/widgets/widgets.pri
+++ b/src/widgets/widgets/widgets.pri
@@ -8,8 +8,6 @@ HEADERS += \
widgets/qcalendarwidget.h \
widgets/qcombobox.h \
widgets/qcombobox_p.h \
- widgets/qdatetimeedit.h \
- widgets/qdatetimeedit_p.h \
widgets/qdial.h \
widgets/qdockwidget.h \
widgets/qdockwidget_p.h \
@@ -71,7 +69,6 @@ SOURCES += \
widgets/qabstractspinbox.cpp \
widgets/qcalendarwidget.cpp \
widgets/qcombobox.cpp \
- widgets/qdatetimeedit.cpp \
widgets/qdial.cpp \
widgets/qdockwidget.cpp \
widgets/qdockarealayout.cpp \
@@ -148,6 +145,15 @@ qtConfig(commandlinkbutton) {
widgets/qcommandlinkbutton.cpp
}
+qtConfig(datetimeedit) {
+ HEADERS += \
+ widgets/qdatetimeedit.h \
+ widgets/qdatetimeedit_p.h
+
+ SOURCES += \
+ widgets/qdatetimeedit.cpp
+}
+
qtConfig(fontcombobox) {
HEADERS += widgets/qfontcombobox.h
SOURCES += widgets/qfontcombobox.cpp