diff options
author | Stephan Binner <stephan.binner@basyskom.com> | 2017-03-02 13:39:22 +0100 |
---|---|---|
committer | Stephan Binner <stephan.binner@basyskom.com> | 2017-03-03 20:34:58 +0000 |
commit | dc2512f3088d6f836ef06d35cbf1a5f7acb4ce7b (patch) | |
tree | 57d49188948653679bc98704e36629523008445f /src/widgets/accessible | |
parent | 46bf3d71e58457afcc8177a68243ac71308534db (diff) |
Add feature.label and feature.formlayout
Change-Id: Ic8dc0aee7f3fc0d8218ba709352b1378078c6070
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/accessible')
-rw-r--r-- | src/widgets/accessible/qaccessiblewidget.cpp | 6 | ||||
-rw-r--r-- | src/widgets/accessible/simplewidgets.cpp | 19 |
2 files changed, 21 insertions, 4 deletions
diff --git a/src/widgets/accessible/qaccessiblewidget.cpp b/src/widgets/accessible/qaccessiblewidget.cpp index 840a990799..94cf58ae3b 100644 --- a/src/widgets/accessible/qaccessiblewidget.cpp +++ b/src/widgets/accessible/qaccessiblewidget.cpp @@ -44,7 +44,9 @@ #include "qaction.h" #include "qapplication.h" #include "qgroupbox.h" +#if QT_CONFIG(label) #include "qlabel.h" +#endif #include "qtooltip.h" #include "qwhatsthis.h" #include "qwidget.h" @@ -81,7 +83,7 @@ static QString buddyString(const QWidget *widget) QWidget *parent = widget->parentWidget(); if (!parent) return QString(); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) && QT_CONFIG(label) for (QObject *o : parent->children()) { QLabel *label = qobject_cast<QLabel*>(o); if (label && label->buddy() == widget) @@ -309,7 +311,7 @@ QAccessibleWidget::relations(QAccessible::Relation match /*= QAccessible::AllRel if (match & QAccessible::Label) { const QAccessible::Relation rel = QAccessible::Label; if (QWidget *parent = widget()->parentWidget()) { -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) && QT_CONFIG(label) // first check for all siblings that are labels to us // ideally we would go through all objects and check, but that // will be too expensive diff --git a/src/widgets/accessible/simplewidgets.cpp b/src/widgets/accessible/simplewidgets.cpp index 184b934c34..99b22a735e 100644 --- a/src/widgets/accessible/simplewidgets.cpp +++ b/src/widgets/accessible/simplewidgets.cpp @@ -49,7 +49,9 @@ #endif #include <qtoolbutton.h> #include <qmenu.h> +#if QT_CONFIG(label) #include <qlabel.h> +#endif #include <qgroupbox.h> #include <qlcdnumber.h> #include <qlineedit.h> @@ -395,6 +397,7 @@ QAccessibleDisplay::QAccessibleDisplay(QWidget *w, QAccessible::Role role) QAccessible::Role QAccessibleDisplay::role() const { +#if QT_CONFIG(label) QLabel *l = qobject_cast<QLabel*>(object()); if (l) { if (l->pixmap()) @@ -416,6 +419,7 @@ QAccessible::Role QAccessibleDisplay::role() const return QAccessible::StatusBar; #endif } +#endif return QAccessibleWidget::role(); } @@ -426,7 +430,9 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const case QAccessible::Name: str = widget()->accessibleName(); if (str.isEmpty()) { - if (qobject_cast<QLabel*>(object())) { + if (false) { +#if QT_CONFIG(label) + } else if (qobject_cast<QLabel*>(object())) { QLabel *label = qobject_cast<QLabel*>(object()); str = label->text(); #ifndef QT_NO_TEXTHTMLPARSER @@ -441,6 +447,7 @@ QString QAccessibleDisplay::text(QAccessible::Text t) const if (label->buddy()) str = qt_accStripAmp(str); #endif +#endif // QT_CONFIG(label) #ifndef QT_NO_LCDNUMBER } else if (qobject_cast<QLCDNumber*>(object())) { QLCDNumber *l = qobject_cast<QLCDNumber*>(object()); @@ -475,7 +482,7 @@ QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > QAccessibleDisplay::relations(QAccessible::Relation match /* = QAccessible::AllRelations */) const { QVector<QPair<QAccessibleInterface*, QAccessible::Relation> > rels = QAccessibleWidget::relations(match); -#ifndef QT_NO_SHORTCUT +#if QT_CONFIG(shortcut) && QT_CONFIG(label) if (match & QAccessible::Labelled) { if (QLabel *label = qobject_cast<QLabel*>(object())) { const QAccessible::Relation rel = QAccessible::Labelled; @@ -507,26 +514,34 @@ QString QAccessibleDisplay::imageDescription() const /*! \internal */ QSize QAccessibleDisplay::imageSize() const { +#if QT_CONFIG(label) QLabel *label = qobject_cast<QLabel *>(widget()); if (!label) +#endif return QSize(); +#if QT_CONFIG(label) const QPixmap *pixmap = label->pixmap(); if (!pixmap) return QSize(); return pixmap->size(); +#endif } /*! \internal */ QPoint QAccessibleDisplay::imagePosition() const { +#if QT_CONFIG(label) QLabel *label = qobject_cast<QLabel *>(widget()); if (!label) +#endif return QPoint(); +#if QT_CONFIG(label) const QPixmap *pixmap = label->pixmap(); if (!pixmap) return QPoint(); return QPoint(label->mapToGlobal(label->pos())); +#endif } #ifndef QT_NO_GROUPBOX |