on xenial help sign in
Handle null targets properly
a1b46e0Daniel d'Andrada
plugins/Utils/inputwatcher.cpp+5−1
@@ -45,7 +45,11 @@ void InputWatcher::setTarget(QObject *value)
45 setTouchPressed(false);
45 setTouchPressed(false);
46
46
47 m_target = value;
47 m_target = value;
48+ if (m_target) {
48− m_target->installEventFilter(this);
49+ m_target->installEventFilter(this);
50+ }
51+
52+ Q_EMIT targetChanged(value);
49}
53}
50
54
51bool InputWatcher::targetPressed() const
55bool InputWatcher::targetPressed() const