diff options
author | Stephan Binner <stephan.binner@basyskom.com> | 2017-03-02 09:20:00 +0100 |
---|---|---|
committer | Stephan Binner <stephan.binner@basyskom.com> | 2017-03-06 20:34:42 +0000 |
commit | 5c62fd9a2e01047074b3594153e5652794ac6a36 (patch) | |
tree | a02696746efc73f8f6a840b0ae175f16d8aa04ba /src/widgets/styles | |
parent | 0b109a952b532338987c3305d2aa37a185984c80 (diff) |
Add feature.dialogbuttonbox
Change-Id: I8c136024c3bf431529033a806be646d867919daa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/styles')
-rw-r--r-- | src/widgets/styles/qcommonstyle.cpp | 6 | ||||
-rw-r--r-- | src/widgets/styles/qfusionstyle.cpp | 1 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 4 | ||||
-rw-r--r-- | src/widgets/styles/qmacstyle_mac_p_p.h | 2 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle.cpp | 10 | ||||
-rw-r--r-- | src/widgets/styles/qwindowsvistastyle_p_p.h | 2 |
6 files changed, 24 insertions, 1 deletions
diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index b54f49c8fc..604422dc4f 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -48,7 +48,9 @@ #include <qcache.h> #include <qdockwidget.h> #include <qdrawutil.h> +#if QT_CONFIG(dialogbuttonbox) #include <qdialogbuttonbox.h> +#endif #if QT_CONFIG(formlayout) #include <qformlayout.h> #else @@ -4926,9 +4928,11 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_ScrollBar_ContextMenu: ret = true; break; +#if QT_CONFIG(dialogbuttonbox) case SH_DialogButtons_DefaultButton: // This value not used anywhere. ret = QDialogButtonBox::AcceptRole; break; +#endif #ifndef QT_NO_GROUPBOX case SH_GroupBox_TextLabelVerticalAlignment: ret = Qt::AlignVCenter; @@ -5116,11 +5120,13 @@ int QCommonStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget case SH_TabBar_ElideMode: ret = Qt::ElideNone; break; +#if QT_CONFIG(dialogbuttonbox) case SH_DialogButtonLayout: ret = QDialogButtonBox::WinLayout; if (const QPlatformTheme *theme = QGuiApplicationPrivate::platformTheme()) ret = theme->themeHint(QPlatformTheme::DialogButtonBoxLayout).toInt(); break; +#endif case SH_ComboBox_PopupFrameStyle: ret = QFrame::StyledPanel | QFrame::Plain; break; diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index bf72983138..cf393744f0 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -53,7 +53,6 @@ #include <qgroupbox.h> #include <qprocess.h> #include <qpixmapcache.h> -#include <qdialogbuttonbox.h> #include <qscrollbar.h> #include <qspinbox.h> #include <qslider.h> diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index f884a1c279..e78946577c 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -57,7 +57,9 @@ #include <qbitmap.h> #include <qcheckbox.h> #include <qcombobox.h> +#if QT_CONFIG(dialogbuttonbox) #include <qdialogbuttonbox.h> +#endif #include <qdockwidget.h> #include <qevent.h> #include <qfocusframe.h> @@ -2931,9 +2933,11 @@ int QMacStyle::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_TabBar_ElideMode: ret = Qt::ElideRight; break; +#if QT_CONFIG(dialogbuttonbox) case SH_DialogButtonLayout: ret = QDialogButtonBox::MacLayout; break; +#endif case SH_FormLayoutWrapPolicy: ret = QFormLayout::DontWrapRows; break; diff --git a/src/widgets/styles/qmacstyle_mac_p_p.h b/src/widgets/styles/qmacstyle_mac_p_p.h index 798f6ed90b..819ac42293 100644 --- a/src/widgets/styles/qmacstyle_mac_p_p.h +++ b/src/widgets/styles/qmacstyle_mac_p_p.h @@ -55,7 +55,9 @@ #include <qbitmap.h> #include <qcheckbox.h> #include <qcombobox.h> +#if QT_CONFIG(dialogbuttonbox) #include <qdialogbuttonbox.h> +#endif #include <qdockwidget.h> #include <qevent.h> #include <qfocusframe.h> diff --git a/src/widgets/styles/qwindowsvistastyle.cpp b/src/widgets/styles/qwindowsvistastyle.cpp index 1bdd8bf0c8..5a53627e95 100644 --- a/src/widgets/styles/qwindowsvistastyle.cpp +++ b/src/widgets/styles/qwindowsvistastyle.cpp @@ -775,6 +775,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt } case PE_Widget: { +#if QT_CONFIG(dialogbuttonbox) const QDialogButtonBox *buttonBox = 0; if (qobject_cast<const QMessageBox *> (widget)) @@ -801,6 +802,7 @@ void QWindowsVistaStyle::drawPrimitive(PrimitiveElement element, const QStyleOpt theme.partId = TDLG_SECONDARYPANEL; d->drawBackground(theme); } +#endif } break; default: @@ -2315,16 +2317,20 @@ void QWindowsVistaStyle::polish(QWidget *widget) } } else if (qobject_cast<QMessageBox *> (widget)) { widget->setAttribute(Qt::WA_StyledBackground); +#if QT_CONFIG(dialogbuttonbox) QDialogButtonBox *buttonBox = widget->findChild<QDialogButtonBox *>(QLatin1String("qt_msgbox_buttonbox")); if (buttonBox) buttonBox->setContentsMargins(0, 9, 0, 0); +#endif } #ifndef QT_NO_INPUTDIALOG else if (qobject_cast<QInputDialog *> (widget)) { widget->setAttribute(Qt::WA_StyledBackground); +#if QT_CONFIG(dialogbuttonbox) QDialogButtonBox *buttonBox = widget->findChild<QDialogButtonBox *>(QLatin1String("qt_inputdlg_buttonbox")); if (buttonBox) buttonBox->setContentsMargins(0, 9, 0, 0); +#endif } #endif // QT_NO_INPUTDIALOG else if (QTreeView *tree = qobject_cast<QTreeView *> (widget)) { @@ -2355,16 +2361,20 @@ void QWindowsVistaStyle::unpolish(QWidget *widget) widget->setAttribute(Qt::WA_Hover, false); else if (qobject_cast<QMessageBox *> (widget)) { widget->setAttribute(Qt::WA_StyledBackground, false); +#if QT_CONFIG(dialogbuttonbox) QDialogButtonBox *buttonBox = widget->findChild<QDialogButtonBox *>(QLatin1String("qt_msgbox_buttonbox")); if (buttonBox) buttonBox->setContentsMargins(0, 0, 0, 0); +#endif } #ifndef QT_NO_INPUTDIALOG else if (qobject_cast<QInputDialog *> (widget)) { widget->setAttribute(Qt::WA_StyledBackground, false); +#if QT_CONFIG(dialogbuttonbox) QDialogButtonBox *buttonBox = widget->findChild<QDialogButtonBox *>(QLatin1String("qt_inputdlg_buttonbox")); if (buttonBox) buttonBox->setContentsMargins(0, 0, 0, 0); +#endif } #endif // QT_NO_INPUTDIALOG else if (QTreeView *tree = qobject_cast<QTreeView *> (widget)) { diff --git a/src/widgets/styles/qwindowsvistastyle_p_p.h b/src/widgets/styles/qwindowsvistastyle_p_p.h index 18b6f9c3f7..038bad0c58 100644 --- a/src/widgets/styles/qwindowsvistastyle_p_p.h +++ b/src/widgets/styles/qwindowsvistastyle_p_p.h @@ -80,7 +80,9 @@ #include <qtreeview.h> #include <qtextedit.h> #include <qmessagebox.h> +#if QT_CONFIG(dialogbuttonbox) #include <qdialogbuttonbox.h> +#endif #include <qinputdialog.h> #include <qtableview.h> #include <qdatetime.h> |