summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qlabel.cpp
diff options
context:
space:
mode:
authorStephan Binner <stephan.binner@basyskom.com>2017-03-08 20:11:43 +0100
committerStephan Binner <stephan.binner@basyskom.com>2017-03-13 08:57:54 +0000
commitd08deb0b4a64e24884eedaf5d8e20f967c38e82a (patch)
treeefcb170e95d4a1af0413c7ea0f995d26a0f8b7dc /src/widgets/widgets/qlabel.cpp
parentf06f1adb6cc3835793a15eafa2d5a3affad712a2 (diff)
Add feature.abstractbutton
Change-Id: Ie93c6d0a8256bc466d3419408b753d5f3738aa6b Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/widgets/widgets/qlabel.cpp')
-rw-r--r--src/widgets/widgets/qlabel.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/widgets/widgets/qlabel.cpp b/src/widgets/widgets/qlabel.cpp
index fa0cff45c9..39e072234e 100644
--- a/src/widgets/widgets/qlabel.cpp
+++ b/src/widgets/widgets/qlabel.cpp
@@ -41,7 +41,9 @@
#include "qevent.h"
#include "qdrawutil.h"
#include "qapplication.h"
+#if QT_CONFIG(abstractbutton)
#include "qabstractbutton.h"
+#endif
#include "qstyle.h"
#include "qstyleoption.h"
#include <limits.h>
@@ -972,12 +974,14 @@ bool QLabel::event(QEvent *e)
QShortcutEvent *se = static_cast<QShortcutEvent *>(e);
if (se->shortcutId() == d->shortcutId) {
QWidget * w = d->buddy;
- QAbstractButton *button = qobject_cast<QAbstractButton *>(w);
if (w->focusPolicy() != Qt::NoFocus)
w->setFocus(Qt::ShortcutFocusReason);
+#if QT_CONFIG(abstractbutton)
+ QAbstractButton *button = qobject_cast<QAbstractButton *>(w);
if (button && !se->isAmbiguous())
button->animateClick();
else
+#endif
window()->setAttribute(Qt::WA_KeyboardFocusChange);
return true;
}