浏览代码

Merge pull request #19050 from ibrahn/fix-signals-on-set

fix for TextEdit::set_text firing signals it shouldn't.
Juan Linietsky 7 年之前
父节点
当前提交
5b11d16f21
共有 2 个文件被更改,包括 2 次插入3 次删除
  1. 0 1
      scene/gui/line_edit.cpp
  2. 2 2
      scene/gui/text_edit.cpp

+ 0 - 1
scene/gui/line_edit.cpp

@@ -1005,7 +1005,6 @@ void LineEdit::set_text(String p_text) {
 	update();
 	cursor_pos = 0;
 	window_pos = 0;
-	_text_changed();
 }
 
 void LineEdit::clear() {

+ 2 - 2
scene/gui/text_edit.cpp

@@ -4110,7 +4110,7 @@ Control::CursorShape TextEdit::get_cursor_shape(const Point2 &p_pos) const {
 void TextEdit::set_text(String p_text) {
 
 	setting_text = true;
-	clear();
+	_clear();
 	_insert_text_at_cursor(p_text);
 	clear_undo_history();
 	cursor.column = 0;
@@ -4123,7 +4123,7 @@ void TextEdit::set_text(String p_text) {
 	cursor_set_column(0);
 	update();
 	setting_text = false;
-	_text_changed_emit();
+
 	//get_range()->set(0);
 };