瀏覽代碼

Merge pull request #36613 from akien-mga/tab-container-add-child-fix

Signals: tab_changed now is emitted when it's on scene tree
Rémi Verschelde 5 年之前
父節點
當前提交
e66d519286
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      scene/gui/tab_container.cpp

+ 1 - 1
scene/gui/tab_container.cpp

@@ -538,7 +538,7 @@ void TabContainer::add_child_notify(Node *p_child) {
 
 	update();
 	p_child->connect_compat("renamed", this, "_child_renamed_callback");
-	if (first)
+	if (first && is_inside_tree())
 		emit_signal("tab_changed", current);
 }