aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickabstractbutton.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2/qquickabstractbutton.cpp')
-rw-r--r--src/quicktemplates2/qquickabstractbutton.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/quicktemplates2/qquickabstractbutton.cpp b/src/quicktemplates2/qquickabstractbutton.cpp
index 969ab173..8ce4d0e5 100644
--- a/src/quicktemplates2/qquickabstractbutton.cpp
+++ b/src/quicktemplates2/qquickabstractbutton.cpp
@@ -44,7 +44,9 @@
#include <QtGui/qstylehints.h>
#include <QtGui/qguiapplication.h>
-#include <QtGui/private/qshortcutmap_p.h>
+#if QT_CONFIG(shortcut)
+# include <QtGui/private/qshortcutmap_p.h>
+#endif
#include <QtGui/private/qguiapplication_p.h>
#include <QtQuick/private/qquickevents_p_p.h>
#include <QtQml/qqmllist.h>
@@ -710,7 +712,7 @@ void QQuickAbstractButton::setIndicator(QQuickItem *indicator)
const qreal oldImplicitIndicatorHeight = implicitIndicatorHeight();
d->removeImplicitSizeListener(d->indicator);
- delete d->indicator;
+ QQuickControlPrivate::hideOldItem(d->indicator);
d->indicator = indicator;
if (indicator) {
@@ -1015,8 +1017,8 @@ void QQuickAbstractButton::componentComplete()
bool QQuickAbstractButton::event(QEvent *event)
{
- Q_D(QQuickAbstractButton);
#if QT_CONFIG(shortcut)
+ Q_D(QQuickAbstractButton);
if (event->type() == QEvent::Shortcut) {
QShortcutEvent *se = static_cast<QShortcutEvent *>(event);
if (se->shortcutId() == d->shortcutId) {
@@ -1101,9 +1103,9 @@ void QQuickAbstractButton::timerEvent(QTimerEvent *event)
void QQuickAbstractButton::itemChange(ItemChange change, const ItemChangeData &value)
{
- Q_D(QQuickAbstractButton);
QQuickControl::itemChange(change, value);
#if QT_CONFIG(shortcut)
+ Q_D(QQuickAbstractButton);
if (change == ItemVisibleHasChanged) {
if (value.boolValue)
d->grabShortcut();