diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.cpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.cpp index 486d5806..8cb20fdd 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.cpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.cpp @@ -19,3 +19,13 @@ void TextInput::contextMenuEvent(QContextMenuEvent* event) { menu->popup(event->globalPos()); } } + +void TextInput::focusInEvent(QFocusEvent* event) { + QLineEdit::focusInEvent(event); + emit this->focusChanged(); +} + +void TextInput::focusOutEvent(QFocusEvent* event) { + QLineEdit::focusOutEvent(event); + emit this->focusChanged(); +} diff --git a/src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.hpp b/src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.hpp index 53b7635b..a4ba1b00 100644 --- a/src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.hpp +++ b/src/Insight/UserInterfaces/InsightWindow/Widgets/TextInput.hpp @@ -2,6 +2,7 @@ #include #include +#include namespace Bloom::Widgets { @@ -12,8 +13,13 @@ namespace Bloom::Widgets public: explicit TextInput(QWidget* parent = nullptr); + signals: + void focusChanged(); + protected: void contextMenuEvent(QContextMenuEvent* event) override; + void focusInEvent(QFocusEvent* event) override; + void focusOutEvent(QFocusEvent* event) override; }; }