summaryrefslogtreecommitdiffstats
path: root/desktop-widgets/textedit.h
diff options
context:
space:
mode:
Diffstat (limited to 'desktop-widgets/textedit.h')
-rw-r--r--desktop-widgets/textedit.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/desktop-widgets/textedit.h b/desktop-widgets/textedit.h
new file mode 100644
index 000000000..1b90c0248
--- /dev/null
+++ b/desktop-widgets/textedit.h
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: GPL-2.0
+#ifndef TEXTEDIT_H
+#define TEXTEDIT_H
+
+#include <QTextEdit>
+
+// QTextEdit does not possess a signal that fires when the user finished
+// editing the text. This subclass therefore overrides the focusOutEvent
+// and sends the textEdited signal.
+class TextEdit : public QTextEdit {
+ Q_OBJECT
+public:
+ using QTextEdit::QTextEdit; // Make constructors of QTextEdit available
+signals:
+ void editingFinished();
+private:
+ void focusOutEvent(QFocusEvent *ev) override;
+};
+
+#endif