diff --git a/plasma/plasma.h b/plasma/plasma.h index c929a413..ab46fe4b 100644 --- a/plasma/plasma.h +++ b/plasma/plasma.h @@ -192,8 +192,7 @@ enum ItemStatus { UnknownStatus = 0, /**< The status is unknown **/ PassiveStatus = 1, /**< The Item is passive **/ ActiveStatus = 2, /**< The Item is active **/ - NeedsAttentionStatus = 3, /**< The Item needs attention **/ - AcceptingInputStatus = 4 /**< The Item is accepting input **/ + NeedsAttentionStatus = 3 /**< The Item needs attention **/ }; Q_ENUMS(ItemStatus) diff --git a/plasma/widgets/combobox.cpp b/plasma/widgets/combobox.cpp index 083a5696..ea9abac3 100644 --- a/plasma/widgets/combobox.cpp +++ b/plasma/widgets/combobox.cpp @@ -108,18 +108,6 @@ void ComboBox::clear() void ComboBox::focusOutEvent(QFocusEvent *event) { - QGraphicsWidget *widget = parentWidget(); - Plasma::Applet *applet = qobject_cast(widget); - - while (!applet && widget) { - widget = widget->parentWidget(); - applet = qobject_cast(widget); - } - - if (applet) { - applet->setStatus(Plasma::UnknownStatus); - } - if (nativeWidget()->isEditable()) { QEvent closeEvent(QEvent::CloseSoftwareInputPanel); if (qApp) { @@ -140,22 +128,6 @@ void ComboBox::changeEvent(QEvent *event) QGraphicsProxyWidget::changeEvent(event); } -void ComboBox::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - QGraphicsWidget *widget = parentWidget(); - Plasma::Applet *applet = qobject_cast(widget); - - while (!applet && widget) { - widget = widget->parentWidget(); - applet = qobject_cast(widget); - } - - if (applet) { - applet->setStatus(Plasma::AcceptingInputStatus); - } - QGraphicsProxyWidget::mousePressEvent(event); -} - int ComboBox::count() const { return nativeWidget()->count(); diff --git a/plasma/widgets/combobox.h b/plasma/widgets/combobox.h index 4d2ecba6..1e89c287 100644 --- a/plasma/widgets/combobox.h +++ b/plasma/widgets/combobox.h @@ -115,7 +115,6 @@ Q_SIGNALS: protected: void focusOutEvent(QFocusEvent *event); void changeEvent(QEvent *event); - void mousePressEvent(QGraphicsSceneMouseEvent *event); private: ComboBoxPrivate * const d; diff --git a/plasma/widgets/lineedit.cpp b/plasma/widgets/lineedit.cpp index d2365ca5..c0ae1501 100644 --- a/plasma/widgets/lineedit.cpp +++ b/plasma/widgets/lineedit.cpp @@ -130,22 +130,6 @@ void LineEdit::changeEvent(QEvent *event) QGraphicsProxyWidget::changeEvent(event); } -void LineEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - QGraphicsWidget *widget = parentWidget(); - Plasma::Applet *applet = qobject_cast(widget); - - while (!applet && widget) { - widget = widget->parentWidget(); - applet = qobject_cast(widget); - } - - if (applet) { - applet->setStatus(Plasma::AcceptingInputStatus); - } - QGraphicsProxyWidget::mousePressEvent(event); -} - void LineEdit::focusInEvent(QFocusEvent *event) { QGraphicsProxyWidget::focusInEvent(event); @@ -153,24 +137,10 @@ void LineEdit::focusInEvent(QFocusEvent *event) // as of Qt 4.7, apparently we have a bug here in QGraphicsProxyWidget nativeWidget()->setFocus(event->reason()); } - - emit focusChanged(true); } void LineEdit::focusOutEvent(QFocusEvent *event) { - QGraphicsWidget *widget = parentWidget(); - Plasma::Applet *applet = qobject_cast(widget); - - while (!applet && widget) { - widget = widget->parentWidget(); - applet = qobject_cast(widget); - } - - if (applet) { - applet->setStatus(Plasma::UnknownStatus); - } - if (qApp) { if (QGraphicsView *view = qobject_cast(qApp->focusWidget())) { if (view->scene() && view->scene() == scene()) { @@ -181,8 +151,6 @@ void LineEdit::focusOutEvent(QFocusEvent *event) } QGraphicsProxyWidget::focusOutEvent(event); - - emit focusChanged(false); } } // namespace Plasma diff --git a/plasma/widgets/lineedit.h b/plasma/widgets/lineedit.h index e01cc4ac..8d39f92c 100644 --- a/plasma/widgets/lineedit.h +++ b/plasma/widgets/lineedit.h @@ -100,7 +100,6 @@ public: protected: void changeEvent(QEvent *event); - void mousePressEvent(QGraphicsSceneMouseEvent *event); void focusInEvent(QFocusEvent *event); void focusOutEvent(QFocusEvent *event); @@ -114,11 +113,6 @@ Q_SIGNALS: * @since 4.4 */ void textChanged(const QString &text); - /** - * Emitted when the widget receives or loses focus - * @since 4.7 - */ - void focusChanged(bool focused); private: Q_PRIVATE_SLOT(d, void setPalette()) diff --git a/plasma/widgets/spinbox.cpp b/plasma/widgets/spinbox.cpp index 9f686457..5f141a89 100644 --- a/plasma/widgets/spinbox.cpp +++ b/plasma/widgets/spinbox.cpp @@ -115,36 +115,8 @@ void SpinBox::changeEvent(QEvent *event) QGraphicsProxyWidget::changeEvent(event); } -void SpinBox::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - QGraphicsWidget *widget = parentWidget(); - Plasma::Applet *applet = qobject_cast(widget); - - while (!applet && widget) { - widget = widget->parentWidget(); - applet = qobject_cast(widget); - } - - if (applet) { - applet->setStatus(Plasma::AcceptingInputStatus); - } - QGraphicsProxyWidget::mousePressEvent(event); -} - void SpinBox::focusOutEvent(QFocusEvent *event) { - QGraphicsWidget *widget = parentWidget(); - Plasma::Applet *applet = qobject_cast(widget); - - while (!applet && widget) { - widget = widget->parentWidget(); - applet = qobject_cast(widget); - } - - if (applet) { - applet->setStatus(Plasma::UnknownStatus); - } - QEvent closeEvent(QEvent::CloseSoftwareInputPanel); if (qApp) { if (QGraphicsView *view = qobject_cast(qApp->focusWidget())) { diff --git a/plasma/widgets/spinbox.h b/plasma/widgets/spinbox.h index c5a3d82a..ab95f59e 100644 --- a/plasma/widgets/spinbox.h +++ b/plasma/widgets/spinbox.h @@ -70,7 +70,6 @@ public: protected: void changeEvent(QEvent *event); - void mousePressEvent(QGraphicsSceneMouseEvent *event); void focusOutEvent(QFocusEvent *event); public Q_SLOTS: diff --git a/plasma/widgets/textedit.cpp b/plasma/widgets/textedit.cpp index 15cd4975..0bedc045 100644 --- a/plasma/widgets/textedit.cpp +++ b/plasma/widgets/textedit.cpp @@ -126,36 +126,8 @@ void TextEdit::changeEvent(QEvent *event) QGraphicsProxyWidget::changeEvent(event); } -void TextEdit::mousePressEvent(QGraphicsSceneMouseEvent *event) -{ - QGraphicsWidget *widget = parentWidget(); - Plasma::Applet *applet = qobject_cast(widget); - - while (!applet && widget) { - widget = widget->parentWidget(); - applet = qobject_cast(widget); - } - - if (applet) { - applet->setStatus(Plasma::AcceptingInputStatus); - } - QGraphicsProxyWidget::mousePressEvent(event); -} - void TextEdit::focusOutEvent(QFocusEvent *event) { - QGraphicsWidget *widget = parentWidget(); - Plasma::Applet *applet = qobject_cast(widget); - - while (!applet && widget) { - widget = widget->parentWidget(); - applet = qobject_cast(widget); - } - - if (applet) { - applet->setStatus(Plasma::UnknownStatus); - } - QEvent closeEvent(QEvent::CloseSoftwareInputPanel); if (qApp) { if (QGraphicsView *view = qobject_cast(qApp->focusWidget())) { diff --git a/plasma/widgets/textedit.h b/plasma/widgets/textedit.h index c9f4d830..3719034c 100644 --- a/plasma/widgets/textedit.h +++ b/plasma/widgets/textedit.h @@ -96,7 +96,6 @@ Q_SIGNALS: protected: void changeEvent(QEvent *event); void contextMenuEvent(QGraphicsSceneContextMenuEvent *event); - void mousePressEvent(QGraphicsSceneMouseEvent *event); void focusOutEvent(QFocusEvent *event); private: