keep text cursor position on stringfield
This commit is contained in:
@@ -41,9 +41,13 @@ void StringField::UpdateWidgetValue(QWidget *widget, double timecode)
|
||||
|
||||
text->blockSignals(true);
|
||||
|
||||
QTextCursor cursor = text->textCursor();
|
||||
int pos = text->textCursor().position();
|
||||
|
||||
text->setHtml(GetValueAt(timecode).toString());
|
||||
text->setTextCursor(cursor);
|
||||
|
||||
QTextCursor new_cursor(text->document());
|
||||
new_cursor.setPosition(pos);
|
||||
text->setTextCursor(new_cursor);
|
||||
|
||||
text->blockSignals(false);
|
||||
}
|
||||
|
||||
@@ -123,6 +123,7 @@ TextEffect::TextEffect(Clip* c, const EffectMeta* em) :
|
||||
|
||||
size_val->SetDefault(48);
|
||||
text_val->SetValueAt(0, tr("Sample Text"));
|
||||
set_color_button->SetValueAt(0, QColor(Qt::white));
|
||||
halign_field->SetValueAt(0, Qt::AlignHCenter);
|
||||
valign_field->SetValueAt(0, Qt::AlignVCenter);
|
||||
word_wrap_field->SetValueAt(0, true);
|
||||
|
||||
Reference in New Issue
Block a user