From 154b64b1835b3a32f96ba6d2f6d6ff6bb093c428 Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Thu, 22 May 2014 11:09:21 +0000 Subject: [PATCH] Maintain cursor position during free text edits. The validation processing of the free text line edit field was causing the cursor position to be lost. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@4148 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- mainwindow.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mainwindow.cpp b/mainwindow.cpp index 3644382f7..5ee0d3187 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -2174,12 +2174,14 @@ void MainWindow::msgtype(QString t, QLineEdit* tx) //msgtype() } tx->setPalette(p); int len=t.length(); + auto pos = tx->cursorPosition (); if(text) { len=qMin(len,13); tx->setText(t.mid(0,len).toUpper()); } else { tx->setText(t); } + tx->setCursorPosition (pos); } void MainWindow::on_tx1_editingFinished() //tx1 edited