Add feature.dialogbuttonbox
Change-Id: I8c136024c3bf431529033a806be646d867919daa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>bb10
parent
0b109a952b
commit
5c62fd9a2e
|
|
@ -59,6 +59,7 @@
|
|||
"features.buttongroup",
|
||||
"features.combobox",
|
||||
"features.datetimeedit",
|
||||
"features.dialogbuttonbox",
|
||||
"features.printer",
|
||||
"features.radiobutton",
|
||||
"features.spinbox",
|
||||
|
|
|
|||
|
|
@ -184,8 +184,10 @@ QAccessibleInterface *qAccessibleFactory(const QString &classname, QObject *obje
|
|||
} else if (classname == QLatin1String("QMdiSubWindow")) {
|
||||
iface = new QAccessibleMdiSubWindow(widget);
|
||||
#endif
|
||||
#if QT_CONFIG(dialogbuttonbox)
|
||||
} else if (classname == QLatin1String("QDialogButtonBox")) {
|
||||
iface = new QAccessibleDialogButtonBox(widget);
|
||||
#endif
|
||||
#ifndef QT_NO_DIAL
|
||||
} else if (classname == QLatin1String("QDial")) {
|
||||
iface = new QAccessibleDial(widget);
|
||||
|
|
|
|||
|
|
@ -54,7 +54,9 @@
|
|||
#include <QToolBox>
|
||||
#include <QMdiArea>
|
||||
#include <QMdiSubWindow>
|
||||
#if QT_CONFIG(dialogbuttonbox)
|
||||
#include <QDialogButtonBox>
|
||||
#endif
|
||||
#include <limits.h>
|
||||
#include <QRubberBand>
|
||||
#include <QTextBrowser>
|
||||
|
|
@ -480,7 +482,7 @@ QMdiSubWindow *QAccessibleMdiSubWindow::mdiSubWindow() const
|
|||
}
|
||||
#endif // QT_NO_MDIAREA
|
||||
|
||||
#ifndef QT_NO_DIALOGBUTTONBOX
|
||||
#if QT_CONFIG(dialogbuttonbox)
|
||||
// ======================= QAccessibleDialogButtonBox ======================
|
||||
QAccessibleDialogButtonBox::QAccessibleDialogButtonBox(QWidget *widget)
|
||||
: QAccessibleWidget(widget, QAccessible::Grouping)
|
||||
|
|
@ -488,7 +490,7 @@ QAccessibleDialogButtonBox::QAccessibleDialogButtonBox(QWidget *widget)
|
|||
Q_ASSERT(qobject_cast<QDialogButtonBox*>(widget));
|
||||
}
|
||||
|
||||
#endif // QT_NO_DIALOGBUTTONBOX
|
||||
#endif // QT_CONFIG(dialogbuttonbox)
|
||||
|
||||
#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)
|
||||
QAccessibleTextBrowser::QAccessibleTextBrowser(QWidget *widget)
|
||||
|
|
|
|||
|
|
@ -248,11 +248,13 @@ protected:
|
|||
};
|
||||
#endif // QT_NO_MDIAREA
|
||||
|
||||
#if QT_CONFIG(dialogbuttonbox)
|
||||
class QAccessibleDialogButtonBox : public QAccessibleWidget
|
||||
{
|
||||
public:
|
||||
explicit QAccessibleDialogButtonBox(QWidget *widget);
|
||||
};
|
||||
#endif
|
||||
|
||||
#if !defined(QT_NO_TEXTBROWSER) && !defined(QT_NO_CURSOR)
|
||||
class QAccessibleTextBrowser : public QAccessibleTextEdit
|
||||
|
|
|
|||
|
|
@ -423,18 +423,28 @@
|
|||
"condition": "features.lineedit && features.shortcut",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"dialogbuttonbox": {
|
||||
"label": "QDialogButtonBox",
|
||||
"purpose": "Presents buttons in a layout that is appropriate for the current widget style.",
|
||||
"section": "Dialogs",
|
||||
"output": [ "publicFeature" ]
|
||||
},
|
||||
"messagebox": {
|
||||
"label": "QMessageBox",
|
||||
"purpose": "Provides message boxes displaying informative messages and simple questions.",
|
||||
"section": "Dialogs",
|
||||
"condition" : "features.label",
|
||||
"condition" : "features.dialogbuttonbox && features.label",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"colordialog": {
|
||||
"label": "QColorDialog",
|
||||
"purpose": "Provides a dialog widget for specifying colors.",
|
||||
"section": "Dialogs",
|
||||
"condition": "features.spinbox && features.label",
|
||||
"condition": [
|
||||
"features.dialogbuttonbox",
|
||||
"features.label",
|
||||
"features.spinbox"
|
||||
],
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"filedialog": {
|
||||
|
|
@ -444,6 +454,7 @@
|
|||
"condition": [
|
||||
"features.buttongroup",
|
||||
"features.combobox",
|
||||
"features.dialogbuttonbox",
|
||||
"features.dirmodel",
|
||||
"features.label",
|
||||
"features.proxymodel",
|
||||
|
|
@ -458,7 +469,14 @@
|
|||
"label": "QFontDialog",
|
||||
"purpose": "Provides a dialog widget for selecting fonts.",
|
||||
"section": "Dialogs",
|
||||
"condition": "features.stringlistmodel && features.combobox && features.validator && features.groupbox && features.label",
|
||||
"condition": [
|
||||
"features.combobox",
|
||||
"features.dialogbuttonbox",
|
||||
"features.groupbox",
|
||||
"features.label",
|
||||
"features.stringlistmodel",
|
||||
"features.validator"
|
||||
],
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"progressdialog": {
|
||||
|
|
@ -472,7 +490,14 @@
|
|||
"label": "QInputDialog",
|
||||
"purpose": "Provides a simple convenience dialog to get a single value from the user.",
|
||||
"section": "Dialogs",
|
||||
"condition": "features.combobox && features.spinbox && features.stackedwidget && features.textedit && features.label",
|
||||
"condition": [
|
||||
"features.combobox",
|
||||
"features.dialogbuttonbox",
|
||||
"features.label",
|
||||
"features.spinbox",
|
||||
"features.stackedwidget",
|
||||
"features.textedit"
|
||||
],
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"errormessage": {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@
|
|||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtWidgets/qwidget.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(dialogbuttonbox);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,9 @@
|
|||
#include "qtoolbar.h"
|
||||
#include "qdebug.h"
|
||||
#include "qlayoutitem.h"
|
||||
#if QT_CONFIG(dialogbuttonbox)
|
||||
#include "qdialogbuttonbox.h"
|
||||
#endif
|
||||
#if 0 // Used to be included in Qt4 for Q_WS_MAC
|
||||
#include "private/qmacstyle_mac_p.h"
|
||||
#include "private/qmacstyle_mac_p_p.h"
|
||||
|
|
@ -400,8 +402,7 @@ QSize QPushButton::sizeHint() const
|
|||
initStyleOption(&opt);
|
||||
|
||||
// calculate contents size...
|
||||
#ifndef QT_NO_ICON
|
||||
|
||||
#if !defined(QT_NO_ICON) && QT_CONFIG(dialogbuttonbox)
|
||||
bool showButtonBoxIcons = qobject_cast<QDialogButtonBox*>(parentWidget())
|
||||
&& style()->styleHint(QStyle::SH_DialogButtonBox_ButtonsHaveIcons);
|
||||
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ HEADERS += \
|
|||
widgets/qdatetimeedit.h \
|
||||
widgets/qdatetimeedit_p.h \
|
||||
widgets/qdial.h \
|
||||
widgets/qdialogbuttonbox.h \
|
||||
widgets/qdockwidget.h \
|
||||
widgets/qdockwidget_p.h \
|
||||
widgets/qdockarealayout_p.h \
|
||||
|
|
@ -90,7 +89,6 @@ SOURCES += \
|
|||
widgets/qcombobox.cpp \
|
||||
widgets/qdatetimeedit.cpp \
|
||||
widgets/qdial.cpp \
|
||||
widgets/qdialogbuttonbox.cpp \
|
||||
widgets/qdockwidget.cpp \
|
||||
widgets/qdockarealayout.cpp \
|
||||
widgets/qeffects.cpp \
|
||||
|
|
@ -163,6 +161,14 @@ qtConfig(radiobutton) {
|
|||
widgets/qradiobutton.cpp
|
||||
}
|
||||
|
||||
qtConfig(dialogbuttonbox) {
|
||||
HEADERS += \
|
||||
widgets/qdialogbuttonbox.h
|
||||
|
||||
SOURCES += \
|
||||
widgets/qdialogbuttonbox.cpp
|
||||
}
|
||||
|
||||
macx {
|
||||
HEADERS += \
|
||||
widgets/qmacnativewidget_mac.h \
|
||||
|
|
|
|||
Loading…
Reference in New Issue