Skip to content

Commit 87279e0

Browse files
committed
GUI: LineEdit: Fix cursor jumping to the end when editing
The issue was that editing the text triggers the change of the option, which in turn triggers updateUiState which sets the content of the LineEdit to the changed option causing the cursor to jump to the end. As a workaround only set the LineEdit contet when it's not focused.
1 parent b6f1684 commit 87279e0

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

gui/QT/option/lineedit_ui.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ void LineEditUi::connectSignals(){
1313
}
1414

1515
void LineEditUi::updateUiState(const std::string &text){
16-
line->setText(QString::fromStdString(text));
16+
if(!line->hasFocus())
17+
line->setText(QString::fromStdString(text));
1718
}
1819

1920
void LineEditUi::updateUiState(){

0 commit comments

Comments
 (0)