Desktop: create new custom TextEdit widget for notes-field

Currently, the notes field uses a QTextEdit, which doesn't
send a signal if it goes out of focus.  But for undo of
dive-editing we don't want to create an undo object for
*every* text change.

Thus, create a custom TextEdit widget that derives from
QTextEdit and turns the focusOutEvent into a editingFinished
signal.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2018-12-28 14:14:31 +01:00 committed by Dirk Hohndel
parent 0882ca64b0
commit 2bb2643ae4
4 changed files with 35 additions and 1 deletions

View file

@ -454,7 +454,7 @@
<number>0</number>
</property>
<item>
<widget class="QTextEdit" name="notes">
<widget class="TextEdit" name="notes">
<property name="readOnly">
<bool>false</bool>
</property>
@ -601,6 +601,11 @@
<extends>QLineEdit</extends>
<header>desktop-widgets/locationinformation.h</header>
</customwidget>
<customwidget>
<class>TextEdit</class>
<extends>QTextEdit</extends>
<header>desktop-widgets/textedit.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="../../subsurface.qrc"/>