focusChanged(bool) signal for LineEdit
This commit is contained in:
parent
02338c2bca
commit
98cb6e0a83
@ -189,6 +189,8 @@ 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)
|
||||
@ -215,6 +217,8 @@ void LineEdit::focusOutEvent(QFocusEvent *event)
|
||||
}
|
||||
|
||||
QGraphicsProxyWidget::focusOutEvent(event);
|
||||
|
||||
emit focusChanged(false);
|
||||
}
|
||||
|
||||
} // namespace Plasma
|
||||
|
@ -133,6 +133,11 @@ 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())
|
||||
|
Loading…
Reference in New Issue
Block a user