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
This commit is contained in:
Bill Somerville 2014-05-22 11:09:21 +00:00
parent a9e1a70092
commit dc3363d490

View File

@ -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