Topic: Element-Editor: Edit-Field for X-/Y-Position of terminals loses focus
Hello everybody!
In Element-Editor the Edit-Fields (SpinBoxes) for X- and Y-Position of terminals lose focus every time a key on the keyboard is hit. That makes editing the position with keyboard very annoying!
Trying to fix that, I edited the QET-Sources a bit and now I need someone to check, whether there are any side-effects.
For me it seems to work, but my Qt-Knowledge is very restricted, so I don't know if there may be something wrong.
Actually it compiles without warning!
Here's what I changed:
diff --git a/sources/editor/ui/terminaleditor.cpp b/sources/editor/ui/terminaleditor.cpp
index c84ae5ecf..77e0c2112 100644
--- a/sources/editor/ui/terminaleditor.cpp
+++ b/sources/editor/ui/terminaleditor.cpp
@@ -219,9 +219,9 @@ void TerminalEditor::activeConnections(bool active)
{
if (active) {
m_editor_connections << connect(ui->m_x_dsb, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged),
- this, &TerminalEditor::posEdited);
+ [this]() { TerminalEditor::posEdited(); ui->m_x_dsb->setFocus();} ) ;
m_editor_connections << connect(ui->m_y_dsb, QOverload<qreal>::of(&QDoubleSpinBox::valueChanged),
- this, &TerminalEditor::posEdited);
+ [this]() { TerminalEditor::posEdited(); ui->m_y_dsb->setFocus(); } ) ;
m_editor_connections << connect(ui->m_orientation_cb, QOverload<int>::of(&QComboBox::activated),
this, &TerminalEditor::orientationEdited);
m_editor_connections << connect(ui->m_name_le, &QLineEdit::editingFinished,
Could someone please use this diff to check, if it's ok?
Maybe you, Laurent?
In case that code works without side-effects I would create a pull-request on GitHub.
Thanks in advance!
plc-user