Add feature.dialog

Change-Id: I160d0f270d7f41671459358b9c180d71dd7786d6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
bb10
Stephan Binner 2017-03-10 13:20:12 +01:00
parent 901ed36f36
commit b1a7a7b250
25 changed files with 113 additions and 58 deletions

View File

@ -66,6 +66,7 @@
"features.buttongroup",
"features.checkbox",
"features.combobox",
"features.dialog",
"features.datetimeedit",
"features.dialogbuttonbox",
"features.printer",

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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>

View File

@ -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

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -43,6 +43,8 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qwidget.h>
QT_REQUIRE_CONFIG(dialog);
QT_BEGIN_NAMESPACE

View File

@ -61,6 +61,8 @@
#endif
#include <qpa/qplatformdialoghelper.h>
QT_REQUIRE_CONFIG(dialog);
QT_BEGIN_NAMESPACE
class QSizeGrip;

View File

@ -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

View File

@ -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

View File

@ -42,14 +42,15 @@
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtGui/qwindowdefs.h>
#include <QtWidgets/qdialog.h>
#include <QtGui/qfont.h>
#ifndef QT_NO_FONTDIALOG
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_FONTDIALOG
class QFontDialogPrivate;
class Q_WIDGETS_EXPORT QFontDialog : public QDialog
@ -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

View File

@ -41,15 +41,16 @@
#define QINPUTDIALOG_H
#include <QtWidgets/qtwidgetsglobal.h>
#include <QtWidgets/qdialog.h>
#include <QtCore/qstring.h>
#include <QtWidgets/qlineedit.h>
#ifndef QT_NO_INPUTDIALOG
#include <QtWidgets/qdialog.h>
QT_BEGIN_NAMESPACE
#ifndef QT_NO_INPUTDIALOG
class QInputDialogPrivate;
class Q_WIDGETS_EXPORT QInputDialog : public QDialog
@ -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

View File

@ -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

View File

@ -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

View File

@ -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;

View File

@ -62,7 +62,6 @@
#include <private/qtextengine_p.h>
#include <qdebug.h>
#include <qlocale.h>
#include <qdialog.h>
#include <qmath.h>
#include <limits.h>

View File

@ -67,7 +67,6 @@
#include <private/qlayoutengine_p.h>
#include <qdebug.h>
#include <qlocale.h>
#include <qdialog.h>
#include <qtableview.h>
#include <limits.h>

View File

@ -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);

View File

@ -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

View File

@ -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;