summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephan Binner <stephan.binner@basyskom.com>2017-03-10 13:20:12 +0100
committerStephan Binner <stephan.binner@basyskom.com>2017-03-22 14:35:46 +0000
commitb1a7a7b250e3575579ad43979c5bc27283f3d5f2 (patch)
tree27f7572604d5d7cb918663c504a39775fa6433aa /src
parent901ed36f3649fc77e5dc4078c0f0e485732feb7a (diff)
Add feature.dialog
Change-Id: I160d0f270d7f41671459358b9c180d71dd7786d6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/printsupport/configure.json1
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog.h11
-rw-r--r--src/printsupport/dialogs/qabstractprintdialog_p.h2
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog.h9
-rw-r--r--src/printsupport/dialogs/qpagesetupdialog_p.h3
-rw-r--r--src/printsupport/dialogs/qprintdialog.h9
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.cpp3
-rw-r--r--src/printsupport/dialogs/qprintpreviewdialog.h3
-rw-r--r--src/widgets/configure.json16
-rw-r--r--src/widgets/dialogs/dialogs.pri12
-rw-r--r--src/widgets/dialogs/qcolordialog.h9
-rw-r--r--src/widgets/dialogs/qdialog.h2
-rw-r--r--src/widgets/dialogs/qdialog_p.h2
-rw-r--r--src/widgets/dialogs/qerrormessage.h9
-rw-r--r--src/widgets/dialogs/qfiledialog.h9
-rw-r--r--src/widgets/dialogs/qfontdialog.h11
-rw-r--r--src/widgets/dialogs/qinputdialog.h11
-rw-r--r--src/widgets/dialogs/qmessagebox.h9
-rw-r--r--src/widgets/dialogs/qprogressdialog.h9
-rw-r--r--src/widgets/dialogs/qwizard.h5
-rw-r--r--src/widgets/itemviews/qitemdelegate.cpp1
-rw-r--r--src/widgets/itemviews/qstyleditemdelegate.cpp1
-rw-r--r--src/widgets/styles/qstylesheetstyle.cpp7
-rw-r--r--src/widgets/widgets/qpushbutton.cpp13
-rw-r--r--src/widgets/widgets/qpushbutton_p.h4
25 files changed, 113 insertions, 58 deletions
diff --git a/src/printsupport/configure.json b/src/printsupport/configure.json
index cd775644c9..8d2a633481 100644
--- a/src/printsupport/configure.json
+++ b/src/printsupport/configure.json
@@ -66,6 +66,7 @@
"features.buttongroup",
"features.checkbox",
"features.combobox",
+ "features.dialog",
"features.datetimeedit",
"features.dialogbuttonbox",
"features.printer",
diff --git a/src/printsupport/dialogs/qabstractprintdialog.h b/src/printsupport/dialogs/qabstractprintdialog.h
index 6c57a301a6..e6d34cdb5b 100644
--- a/src/printsupport/dialogs/qabstractprintdialog.h
+++ b/src/printsupport/dialogs/qabstractprintdialog.h
@@ -41,13 +41,14 @@
#define QABSTRACTPRINTDIALOG_H
#include <QtPrintSupport/qtprintsupportglobal.h>
+
+#if QT_CONFIG(printdialog)
+
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_PRINTER
-
class QAbstractPrintDialogPrivate;
class QPrinter;
@@ -81,7 +82,6 @@ public:
Q_DECLARE_FLAGS(PrintDialogOptions, PrintDialogOption)
Q_FLAG(PrintDialogOptions)
-#ifndef QT_NO_PRINTDIALOG
explicit QAbstractPrintDialog(QPrinter *printer, QWidget *parent = Q_NULLPTR);
~QAbstractPrintDialog();
@@ -114,13 +114,12 @@ protected:
private:
Q_DISABLE_COPY(QAbstractPrintDialog)
-#endif // QT_NO_PRINTDIALOG
};
Q_DECLARE_OPERATORS_FOR_FLAGS(QAbstractPrintDialog::PrintDialogOptions)
-#endif // QT_NO_PRINTER
-
QT_END_NAMESPACE
+#endif // QT_NO_PRINTDIALOG
+
#endif // QABSTRACTPRINTDIALOG_H
diff --git a/src/printsupport/dialogs/qabstractprintdialog_p.h b/src/printsupport/dialogs/qabstractprintdialog_p.h
index fe4e18cfc3..12de4ee882 100644
--- a/src/printsupport/dialogs/qabstractprintdialog_p.h
+++ b/src/printsupport/dialogs/qabstractprintdialog_p.h
@@ -52,10 +52,10 @@
//
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
-#include "private/qdialog_p.h"
#ifndef QT_NO_PRINTDIALOG
+#include "private/qdialog_p.h"
#include "QtPrintSupport/qabstractprintdialog.h"
QT_BEGIN_NAMESPACE
diff --git a/src/printsupport/dialogs/qpagesetupdialog.h b/src/printsupport/dialogs/qpagesetupdialog.h
index 124d215700..bc7462ebaa 100644
--- a/src/printsupport/dialogs/qpagesetupdialog.h
+++ b/src/printsupport/dialogs/qpagesetupdialog.h
@@ -41,13 +41,14 @@
#define QPAGESETUPDIALOG_H
#include <QtPrintSupport/qtprintsupportglobal.h>
+
+#ifndef QT_NO_PRINTDIALOG
+
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_PRINTDIALOG
-
class QPrinter;
class QPageSetupDialogPrivate;
@@ -74,8 +75,8 @@ public:
QPrinter *printer();
};
-#endif // QT_NO_PRINTDIALOG
-
QT_END_NAMESPACE
+#endif // QT_NO_PRINTDIALOG
+
#endif // QPAGESETUPDIALOG_H
diff --git a/src/printsupport/dialogs/qpagesetupdialog_p.h b/src/printsupport/dialogs/qpagesetupdialog_p.h
index 46e178fef9..98b466ccdc 100644
--- a/src/printsupport/dialogs/qpagesetupdialog_p.h
+++ b/src/printsupport/dialogs/qpagesetupdialog_p.h
@@ -53,10 +53,11 @@
//
#include <QtPrintSupport/private/qtprintsupportglobal_p.h>
-#include "private/qdialog_p.h"
#ifndef QT_NO_PRINTDIALOG
+#include "private/qdialog_p.h"
+
#include "qbytearray.h"
#include "qpagesetupdialog.h"
#include "qpointer.h"
diff --git a/src/printsupport/dialogs/qprintdialog.h b/src/printsupport/dialogs/qprintdialog.h
index f01e515af4..35d650a7fc 100644
--- a/src/printsupport/dialogs/qprintdialog.h
+++ b/src/printsupport/dialogs/qprintdialog.h
@@ -41,13 +41,14 @@
#define QPRINTDIALOG_H
#include <QtPrintSupport/qtprintsupportglobal.h>
+
+#ifndef QT_NO_PRINTDIALOG
+
#include <QtPrintSupport/qabstractprintdialog.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_PRINTDIALOG
-
class QPrintDialogPrivate;
class QPushButton;
class QPrinter;
@@ -101,8 +102,8 @@ private:
# endif // Q_OS_UNIX
};
-#endif // QT_NO_PRINTDIALOG
-
QT_END_NAMESPACE
+#endif // QT_NO_PRINTDIALOG
+
#endif // QPRINTDIALOG_H
diff --git a/src/printsupport/dialogs/qprintpreviewdialog.cpp b/src/printsupport/dialogs/qprintpreviewdialog.cpp
index 4bed0b6454..33ba842a1f 100644
--- a/src/printsupport/dialogs/qprintpreviewdialog.cpp
+++ b/src/printsupport/dialogs/qprintpreviewdialog.cpp
@@ -40,7 +40,6 @@
#include "qprintpreviewdialog.h"
#include "qprintpreviewwidget.h"
#include <private/qprinter_p.h>
-#include "private/qdialog_p.h"
#include "qprintdialog.h"
#include <QtWidgets/qaction.h>
@@ -59,6 +58,8 @@
#ifndef QT_NO_PRINTPREVIEWDIALOG
+#include "private/qdialog_p.h"
+
#include <QtWidgets/qformlayout.h>
#include <QtWidgets/qlabel.h>
diff --git a/src/printsupport/dialogs/qprintpreviewdialog.h b/src/printsupport/dialogs/qprintpreviewdialog.h
index 903083167c..640369fdf3 100644
--- a/src/printsupport/dialogs/qprintpreviewdialog.h
+++ b/src/printsupport/dialogs/qprintpreviewdialog.h
@@ -41,10 +41,11 @@
#define QPRINTPREVIEWDIALOG_H
#include <QtPrintSupport/qtprintsupportglobal.h>
-#include <QtWidgets/qdialog.h>
#ifndef QT_NO_PRINTPREVIEWDIALOG
+#include <QtWidgets/qdialog.h>
+
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/configure.json b/src/widgets/configure.json
index dedea8c59e..13c7c774ed 100644
--- a/src/widgets/configure.json
+++ b/src/widgets/configure.json
@@ -468,11 +468,17 @@
"condition": "features.lineedit && features.shortcut",
"output": [ "publicFeature", "feature" ]
},
+ "dialog" : {
+ "label": "QDialog",
+ "purpose": "Base class of dialog windows.",
+ "section": "Dialogs",
+ "output": [ "publicFeature" ]
+ },
"dialogbuttonbox": {
"label": "QDialogButtonBox",
"purpose": "Presents buttons in a layout that is appropriate for the current widget style.",
"section": "Dialogs",
- "condition": "features.pushbutton",
+ "condition": "features.dialog && features.pushbutton",
"output": [ "publicFeature" ]
},
"messagebox": {
@@ -481,6 +487,7 @@
"section": "Dialogs",
"condition" : [
"features.checkbox",
+ "features.dialog",
"features.dialogbuttonbox",
"features.label",
"features.pushbutton"
@@ -492,6 +499,7 @@
"purpose": "Provides a dialog widget for specifying colors.",
"section": "Dialogs",
"condition": [
+ "features.dialog",
"features.dialogbuttonbox",
"features.label",
"features.pushbutton",
@@ -506,6 +514,7 @@
"condition": [
"features.buttongroup",
"features.combobox",
+ "features.dialog",
"features.dialogbuttonbox",
"features.dirmodel",
"features.label",
@@ -524,6 +533,7 @@
"condition": [
"features.checkbox",
"features.combobox",
+ "features.dialog",
"features.dialogbuttonbox",
"features.groupbox",
"features.label",
@@ -538,6 +548,7 @@
"purpose": "Provides feedback on the progress of a slow operation.",
"section": "Dialogs",
"condition": [
+ "features.dialog",
"features.label",
"features.pushbutton",
"features.progressbar"
@@ -550,6 +561,7 @@
"section": "Dialogs",
"condition": [
"features.combobox",
+ "features.dialog",
"features.dialogbuttonbox",
"features.label",
"features.pushbutton",
@@ -565,6 +577,7 @@
"section": "Dialogs",
"condition": [
"features.checkbox",
+ "features.dialog",
"features.textedit",
"features.label",
"features.pushbutton",
@@ -577,6 +590,7 @@
"purpose": "Provides a framework for multi-page click-through dialogs.",
"section": "Dialogs",
"condition": [
+ "features.dialog",
"features.pushbutton",
"features.properties",
"features.label"
diff --git a/src/widgets/dialogs/dialogs.pri b/src/widgets/dialogs/dialogs.pri
index 4f4a9b1517..8614d2bcc6 100644
--- a/src/widgets/dialogs/dialogs.pri
+++ b/src/widgets/dialogs/dialogs.pri
@@ -3,8 +3,6 @@
HEADERS += \
dialogs/qcolordialog.h \
dialogs/qfscompleter_p.h \
- dialogs/qdialog.h \
- dialogs/qdialog_p.h \
dialogs/qerrormessage.h \
dialogs/qfiledialog.h \
dialogs/qfiledialog_p.h \
@@ -30,7 +28,6 @@ else: FORMS += dialogs/qfiledialog.ui
INCLUDEPATH += $$PWD
SOURCES += \
dialogs/qcolordialog.cpp \
- dialogs/qdialog.cpp \
dialogs/qerrormessage.cpp \
dialogs/qfiledialog.cpp \
dialogs/qfontdialog.cpp \
@@ -42,4 +39,13 @@ SOURCES += \
dialogs/qfileinfogatherer.cpp \
dialogs/qwizard.cpp \
+qtConfig(dialog) {
+ HEADERS += \
+ dialogs/qdialog.h \
+ dialogs/qdialog_p.h
+
+ SOURCES += \
+ dialogs/qdialog.cpp
+}
+
RESOURCES += dialogs/qmessagebox.qrc
diff --git a/src/widgets/dialogs/qcolordialog.h b/src/widgets/dialogs/qcolordialog.h
index 3b56f0b5d1..fb5b843ce4 100644
--- a/src/widgets/dialogs/qcolordialog.h
+++ b/src/widgets/dialogs/qcolordialog.h
@@ -41,13 +41,14 @@
#define QCOLORDIALOG_H
#include <QtWidgets/qtwidgetsglobal.h>
+
+#ifndef QT_NO_COLORDIALOG
+
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_COLORDIALOG
-
class QColorDialogPrivate;
class Q_WIDGETS_EXPORT QColorDialog : public QDialog
@@ -124,8 +125,8 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QColorDialog::ColorDialogOptions)
-#endif // QT_NO_COLORDIALOG
-
QT_END_NAMESPACE
+#endif // QT_NO_COLORDIALOG
+
#endif // QCOLORDIALOG_H
diff --git a/src/widgets/dialogs/qdialog.h b/src/widgets/dialogs/qdialog.h
index d88ff4a841..72250172d3 100644
--- a/src/widgets/dialogs/qdialog.h
+++ b/src/widgets/dialogs/qdialog.h
@@ -43,6 +43,8 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
+QT_REQUIRE_CONFIG(dialog);
+
QT_BEGIN_NAMESPACE
diff --git a/src/widgets/dialogs/qdialog_p.h b/src/widgets/dialogs/qdialog_p.h
index 6723edae38..9ee89863f6 100644
--- a/src/widgets/dialogs/qdialog_p.h
+++ b/src/widgets/dialogs/qdialog_p.h
@@ -61,6 +61,8 @@
#endif
#include <qpa/qplatformdialoghelper.h>
+QT_REQUIRE_CONFIG(dialog);
+
QT_BEGIN_NAMESPACE
class QSizeGrip;
diff --git a/src/widgets/dialogs/qerrormessage.h b/src/widgets/dialogs/qerrormessage.h
index 5ffa568c10..976ba9abd5 100644
--- a/src/widgets/dialogs/qerrormessage.h
+++ b/src/widgets/dialogs/qerrormessage.h
@@ -41,13 +41,14 @@
#define QERRORMESSAGE_H
#include <QtWidgets/qtwidgetsglobal.h>
+
+#ifndef QT_NO_ERRORMESSAGE
+
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_ERRORMESSAGE
-
class QErrorMessagePrivate;
class Q_WIDGETS_EXPORT QErrorMessage: public QDialog
@@ -72,8 +73,8 @@ private:
Q_DISABLE_COPY(QErrorMessage)
};
-#endif // QT_NO_ERRORMESSAGE
-
QT_END_NAMESPACE
+#endif // QT_NO_ERRORMESSAGE
+
#endif // QERRORMESSAGE_H
diff --git a/src/widgets/dialogs/qfiledialog.h b/src/widgets/dialogs/qfiledialog.h
index 7959eebd7b..733dd03092 100644
--- a/src/widgets/dialogs/qfiledialog.h
+++ b/src/widgets/dialogs/qfiledialog.h
@@ -44,13 +44,14 @@
#include <QtCore/qdir.h>
#include <QtCore/qstring.h>
#include <QtCore/qurl.h>
+
+#ifndef QT_NO_FILEDIALOG
+
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_FILEDIALOG
-
class QModelIndex;
class QItemSelection;
struct QFileDialogArgs;
@@ -313,8 +314,8 @@ inline void QFileDialog::setDirectory(const QDir &adirectory)
Q_DECLARE_OPERATORS_FOR_FLAGS(QFileDialog::Options)
-#endif // QT_NO_FILEDIALOG
-
QT_END_NAMESPACE
+#endif // QT_NO_FILEDIALOG
+
#endif // QFILEDIALOG_H
diff --git a/src/widgets/dialogs/qfontdialog.h b/src/widgets/dialogs/qfontdialog.h
index 276f8f5e83..da13a5ab99 100644
--- a/src/widgets/dialogs/qfontdialog.h
+++ b/src/widgets/dialogs/qfontdialog.h
@@ -42,13 +42,14 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtGui/qwindowdefs.h>
-#include <QtWidgets/qdialog.h>
#include <QtGui/qfont.h>
-QT_BEGIN_NAMESPACE
+#ifndef QT_NO_FONTDIALOG
+#include <QtWidgets/qdialog.h>
+
+QT_BEGIN_NAMESPACE
-#ifndef QT_NO_FONTDIALOG
class QFontDialogPrivate;
@@ -117,8 +118,8 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QFontDialog::FontDialogOptions)
-#endif // QT_NO_FONTDIALOG
-
QT_END_NAMESPACE
+#endif // QT_NO_FONTDIALOG
+
#endif // QFONTDIALOG_H
diff --git a/src/widgets/dialogs/qinputdialog.h b/src/widgets/dialogs/qinputdialog.h
index 2fbea908cb..7b43e774a7 100644
--- a/src/widgets/dialogs/qinputdialog.h
+++ b/src/widgets/dialogs/qinputdialog.h
@@ -41,14 +41,15 @@
#define QINPUTDIALOG_H
#include <QtWidgets/qtwidgetsglobal.h>
-#include <QtWidgets/qdialog.h>
#include <QtCore/qstring.h>
#include <QtWidgets/qlineedit.h>
-QT_BEGIN_NAMESPACE
+#ifndef QT_NO_INPUTDIALOG
+#include <QtWidgets/qdialog.h>
+
+QT_BEGIN_NAMESPACE
-#ifndef QT_NO_INPUTDIALOG
class QInputDialogPrivate;
@@ -209,8 +210,8 @@ private:
Q_DECLARE_OPERATORS_FOR_FLAGS(QInputDialog::InputDialogOptions)
-#endif // QT_NO_INPUTDIALOG
-
QT_END_NAMESPACE
+#endif // QT_NO_INPUTDIALOG
+
#endif // QINPUTDIALOG_H
diff --git a/src/widgets/dialogs/qmessagebox.h b/src/widgets/dialogs/qmessagebox.h
index 3e561a5161..40e5c701fe 100644
--- a/src/widgets/dialogs/qmessagebox.h
+++ b/src/widgets/dialogs/qmessagebox.h
@@ -41,13 +41,14 @@
#define QMESSAGEBOX_H
#include <QtWidgets/qtwidgetsglobal.h>
+
+#ifndef QT_NO_MESSAGEBOX
+
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_MESSAGEBOX
-
class QLabel;
class QMessageBoxPrivate;
class QAbstractButton;
@@ -322,8 +323,8 @@ QString s = QApplication::tr("Executable '%1' requires Qt "\
str)).arg(QString::fromLatin1(qVersion())); QMessageBox::critical(0, QApplication::tr(\
"Incompatible Qt Library Error"), s, QMessageBox::Abort, 0); qFatal("%s", s.toLatin1().data()); }}
-#endif // QT_NO_MESSAGEBOX
-
QT_END_NAMESPACE
+#endif // QT_NO_MESSAGEBOX
+
#endif // QMESSAGEBOX_H
diff --git a/src/widgets/dialogs/qprogressdialog.h b/src/widgets/dialogs/qprogressdialog.h
index a5e333259f..f4e63fb088 100644
--- a/src/widgets/dialogs/qprogressdialog.h
+++ b/src/widgets/dialogs/qprogressdialog.h
@@ -41,13 +41,14 @@
#define QPROGRESSDIALOG_H
#include <QtWidgets/qtwidgetsglobal.h>
+
+#ifndef QT_NO_PROGRESSDIALOG
+
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_PROGRESSDIALOG
-
class QPushButton;
class QLabel;
class QProgressBar;
@@ -127,8 +128,8 @@ private:
Q_PRIVATE_SLOT(d_func(), void _q_disconnectOnClose())
};
-#endif // QT_NO_PROGRESSDIALOG
-
QT_END_NAMESPACE
+#endif // QT_NO_PROGRESSDIALOG
+
#endif // QPROGRESSDIALOG_H
diff --git a/src/widgets/dialogs/qwizard.h b/src/widgets/dialogs/qwizard.h
index 7915c9e7f8..3236ee90df 100644
--- a/src/widgets/dialogs/qwizard.h
+++ b/src/widgets/dialogs/qwizard.h
@@ -41,13 +41,14 @@
#define QWIZARD_H
#include <QtWidgets/qtwidgetsglobal.h>
+
+#ifndef QT_NO_WIZARD
+
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
-#ifndef QT_NO_WIZARD
-
class QAbstractButton;
class QWizardPage;
class QWizardPrivate;
diff --git a/src/widgets/itemviews/qitemdelegate.cpp b/src/widgets/itemviews/qitemdelegate.cpp
index 747d5db782..6a6220cd0a 100644
--- a/src/widgets/itemviews/qitemdelegate.cpp
+++ b/src/widgets/itemviews/qitemdelegate.cpp
@@ -62,7 +62,6 @@
#include <private/qtextengine_p.h>
#include <qdebug.h>
#include <qlocale.h>
-#include <qdialog.h>
#include <qmath.h>
#include <limits.h>
diff --git a/src/widgets/itemviews/qstyleditemdelegate.cpp b/src/widgets/itemviews/qstyleditemdelegate.cpp
index e4115c9e60..4149d3ac3a 100644
--- a/src/widgets/itemviews/qstyleditemdelegate.cpp
+++ b/src/widgets/itemviews/qstyleditemdelegate.cpp
@@ -67,7 +67,6 @@
#include <private/qlayoutengine_p.h>
#include <qdebug.h>
#include <qlocale.h>
-#include <qdialog.h>
#include <qtableview.h>
#include <limits.h>
diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp
index 2886093732..94ded82ef5 100644
--- a/src/widgets/styles/qstylesheetstyle.cpp
+++ b/src/widgets/styles/qstylesheetstyle.cpp
@@ -77,7 +77,9 @@
#include <qmainwindow.h>
#include <qdockwidget.h>
#include <qmdisubwindow.h>
+#if QT_CONFIG(dialog)
#include <qdialog.h>
+#endif
#include <private/qwidget_p.h>
#include <QAbstractSpinBox>
#if QT_CONFIG(label)
@@ -2819,7 +2821,10 @@ void QStyleSheetStyle::polish(QWidget *w)
#ifndef QT_NO_MENUBAR
|| qobject_cast<QMenuBar *>(w)
#endif
- || qobject_cast<QDialog *>(w)) {
+#if QT_CONFIG(dialog)
+ || qobject_cast<QDialog *>(w)
+#endif
+ ) {
w->setAttribute(Qt::WA_StyledBackground, true);
}
QWidget *ew = embeddedWidget(w);
diff --git a/src/widgets/widgets/qpushbutton.cpp b/src/widgets/widgets/qpushbutton.cpp
index 20758679f0..5b1e10eb32 100644
--- a/src/widgets/widgets/qpushbutton.cpp
+++ b/src/widgets/widgets/qpushbutton.cpp
@@ -40,8 +40,9 @@
#include "qapplication.h"
#include "qbitmap.h"
#include "qdesktopwidget.h"
-#include "qdialog.h"
+#if QT_CONFIG(dialog)
#include <private/qdialog_p.h>
+#endif
#include "qdrawutil.h"
#include "qevent.h"
#include "qfontmetrics.h"
@@ -292,6 +293,7 @@ QPushButton::~QPushButton()
{
}
+#if QT_CONFIG(dialog)
QDialog *QPushButtonPrivate::dialogParent() const
{
Q_Q(const QPushButton);
@@ -303,6 +305,7 @@ QDialog *QPushButtonPrivate::dialogParent() const
}
return 0;
}
+#endif
/*!
Initialize \a option with the values from this QPushButton. This method is useful
@@ -366,10 +369,12 @@ void QPushButton::setDefault(bool enable)
if (d->defaultButton == enable)
return;
d->defaultButton = enable;
+#if QT_CONFIG(dialog)
if (d->defaultButton) {
if (QDialog *dlg = d->dialogParent())
dlg->d_func()->setMainDefault(this);
}
+#endif
update();
#ifndef QT_NO_ACCESSIBILITY
QAccessible::State s;
@@ -478,9 +483,11 @@ void QPushButton::focusInEvent(QFocusEvent *e)
Q_D(QPushButton);
if (e->reason() != Qt::PopupFocusReason && autoDefault() && !d->defaultButton) {
d->defaultButton = true;
+#if QT_CONFIG(dialog)
QDialog *dlg = qobject_cast<QDialog*>(window());
if (dlg)
dlg->d_func()->setDefault(this);
+#endif
}
QAbstractButton::focusInEvent(e);
}
@@ -492,11 +499,13 @@ void QPushButton::focusOutEvent(QFocusEvent *e)
{
Q_D(QPushButton);
if (e->reason() != Qt::PopupFocusReason && autoDefault() && d->defaultButton) {
+#if QT_CONFIG(dialog)
QDialog *dlg = qobject_cast<QDialog*>(window());
if (dlg)
dlg->d_func()->setDefault(0);
else
d->defaultButton = false;
+#endif
}
QAbstractButton::focusOutEvent(e);
@@ -661,10 +670,12 @@ bool QPushButton::event(QEvent *e)
{
Q_D(QPushButton);
if (e->type() == QEvent::ParentChange) {
+#if QT_CONFIG(dialog)
if (QDialog *dialog = d->dialogParent()) {
if (d->defaultButton)
dialog->d_func()->setMainDefault(this);
}
+#endif
} else if (e->type() == QEvent::StyleChange
#ifdef Q_OS_MAC
|| e->type() == QEvent::MacSizeChange
diff --git a/src/widgets/widgets/qpushbutton_p.h b/src/widgets/widgets/qpushbutton_p.h
index 198091503a..a32b599b94 100644
--- a/src/widgets/widgets/qpushbutton_p.h
+++ b/src/widgets/widgets/qpushbutton_p.h
@@ -81,7 +81,11 @@ public:
#endif
void resetLayoutItemMargins();
void _q_popupPressed();
+#if QT_CONFIG(dialog)
QDialog *dialogParent() const;
+#else
+ QDialog *dialogParent() const { return 0; };
+#endif
QPointer<QMenu> menu;
uint autoDefault : 2;