Add feature.radiobutton
Change-Id: Ie11f178ce22e2fafdfdf1760288e90563569e0cb Reviewed-by: Lars Knoll <lars.knoll@qt.io>bb10
parent
863debd720
commit
fd08361ad3
|
|
@ -55,7 +55,16 @@
|
|||
"label": "QPrintDialog",
|
||||
"purpose": "Provides a dialog widget for specifying printer configuration.",
|
||||
"section": "Dialogs",
|
||||
"condition": "features.printer && features.combobox && features.buttongroup && features.spinbox && features.treeview && features.tabwidget && features.datetimeedit",
|
||||
"condition": [
|
||||
"features.buttongroup",
|
||||
"features.combobox",
|
||||
"features.datetimeedit",
|
||||
"features.printer",
|
||||
"features.radiobutton",
|
||||
"features.spinbox",
|
||||
"features.tabwidget",
|
||||
"features.treeview"
|
||||
],
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"printpreviewdialog": {
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@
|
|||
#include <qpushbutton.h>
|
||||
#include <qprogressbar.h>
|
||||
#include <qstatusbar.h>
|
||||
#if QT_CONFIG(radiobutton)
|
||||
#include <qradiobutton.h>
|
||||
#endif
|
||||
#include <qtoolbutton.h>
|
||||
#include <qmenu.h>
|
||||
#include <qlabel.h>
|
||||
|
|
@ -169,12 +171,15 @@ QRect QAccessibleButton::rect() const
|
|||
QStyleOptionButton opt;
|
||||
cb->initStyleOption(&opt);
|
||||
return cb->style()->subElementRect(QStyle::SE_CheckBoxClickRect, &opt, cb).translated(wpos);
|
||||
} else if (QRadioButton *rb = qobject_cast<QRadioButton *>(ab)) {
|
||||
}
|
||||
#if QT_CONFIG(radiobutton)
|
||||
else if (QRadioButton *rb = qobject_cast<QRadioButton *>(ab)) {
|
||||
QPoint wpos = rb->mapToGlobal(QPoint(0, 0));
|
||||
QStyleOptionButton opt;
|
||||
rb->initStyleOption(&opt);
|
||||
return rb->style()->subElementRect(QStyle::SE_RadioButtonClickRect, &opt, rb).translated(wpos);
|
||||
}
|
||||
#endif
|
||||
return QAccessibleWidget::rect();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -175,6 +175,12 @@
|
|||
"section": "Widgets",
|
||||
"output": [ "publicFeature", "feature" ]
|
||||
},
|
||||
"radiobutton": {
|
||||
"label": "QRadioButton",
|
||||
"purpose": "Provides a radio button with a text label.",
|
||||
"section": "Widgets",
|
||||
"output": [ "publicFeature" ]
|
||||
},
|
||||
"spinbox": {
|
||||
"label": "QSpinBox",
|
||||
"purpose": "Provides spin boxes handling integers and discrete sets of values.",
|
||||
|
|
|
|||
|
|
@ -58,7 +58,6 @@
|
|||
#include "private/qabstractscrollarea_p.h"
|
||||
#include <qtooltip.h>
|
||||
#include <qshareddata.h>
|
||||
#include <qradiobutton.h>
|
||||
#include <qtoolbutton.h>
|
||||
#include <qscrollbar.h>
|
||||
#include <qstring.h>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,9 @@
|
|||
#include "qdrawutil.h"
|
||||
#include "qevent.h"
|
||||
#include "qlayout.h"
|
||||
#if QT_CONFIG(radiobutton)
|
||||
#include "qradiobutton.h"
|
||||
#endif
|
||||
#include "qstyle.h"
|
||||
#include "qstyleoption.h"
|
||||
#include "qstylepainter.h"
|
||||
|
|
@ -430,11 +432,13 @@ void QGroupBoxPrivate::_q_fixFocus(Qt::FocusReason reason)
|
|||
QWidget * w = q;
|
||||
while ((w = w->nextInFocusChain()) != q) {
|
||||
if (q->isAncestorOf(w) && (w->focusPolicy() & Qt::TabFocus) == Qt::TabFocus && w->isVisibleTo(q)) {
|
||||
#if QT_CONFIG(radiobutton)
|
||||
if (!best && qobject_cast<QRadioButton*>(w) && ((QRadioButton*)w)->isChecked())
|
||||
// we prefer a checked radio button or a widget that
|
||||
// already has focus, if there is one
|
||||
best = w;
|
||||
else
|
||||
#endif
|
||||
if (!candidate)
|
||||
// but we'll accept anything that takes focus
|
||||
candidate = w;
|
||||
|
|
|
|||
|
|
@ -43,6 +43,8 @@
|
|||
#include <QtWidgets/qtwidgetsglobal.h>
|
||||
#include <QtWidgets/qabstractbutton.h>
|
||||
|
||||
QT_REQUIRE_CONFIG(radiobutton);
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -44,7 +44,6 @@ HEADERS += \
|
|||
widgets/qprogressbar.h \
|
||||
widgets/qpushbutton.h \
|
||||
widgets/qpushbutton_p.h \
|
||||
widgets/qradiobutton.h \
|
||||
widgets/qrubberband.h \
|
||||
widgets/qscrollbar.h \
|
||||
widgets/qscrollbar_p.h \
|
||||
|
|
@ -113,7 +112,6 @@ SOURCES += \
|
|||
widgets/qmenubar.cpp \
|
||||
widgets/qprogressbar.cpp \
|
||||
widgets/qpushbutton.cpp \
|
||||
widgets/qradiobutton.cpp \
|
||||
widgets/qrubberband.cpp \
|
||||
widgets/qscrollbar.cpp \
|
||||
widgets/qsizegrip.cpp \
|
||||
|
|
@ -151,6 +149,14 @@ qtConfig(commandlinkbutton) {
|
|||
widgets/qcommandlinkbutton.cpp
|
||||
}
|
||||
|
||||
qtConfig(radiobutton) {
|
||||
HEADERS += \
|
||||
widgets/qradiobutton.h
|
||||
|
||||
SOURCES += \
|
||||
widgets/qradiobutton.cpp
|
||||
}
|
||||
|
||||
macx {
|
||||
HEADERS += \
|
||||
widgets/qmacnativewidget_mac.h \
|
||||
|
|
|
|||
Loading…
Reference in New Issue