summaryrefslogtreecommitdiff
path: root/scene/gui
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-01-28 15:06:54 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-01-28 15:07:22 +0100
commit7072b359b40f57e178e87b386acef5a6928e61fe (patch)
tree12dd2c6b157108cdc0689d814b3478d05e0a4487 /scene/gui
parent38c6611b91f5ee7ded0c2c1d279ab7dcdc4f2f1c (diff)
Improve some method bindings to use specific `Object` subtypes
This was made possible by changes to `VariantCaster` which now make it possible to pass any `Object`-derived type as pointer.
Diffstat (limited to 'scene/gui')
-rw-r--r--scene/gui/tree.cpp6
-rw-r--r--scene/gui/tree.h10
2 files changed, 3 insertions, 13 deletions
diff --git a/scene/gui/tree.cpp b/scene/gui/tree.cpp
index f2fe967f9a..7f9c4b18e4 100644
--- a/scene/gui/tree.cpp
+++ b/scene/gui/tree.cpp
@@ -1317,10 +1317,10 @@ void TreeItem::_bind_methods() {
ClassDB::bind_method(D_METHOD("get_children"), &TreeItem::get_children);
ClassDB::bind_method(D_METHOD("get_index"), &TreeItem::get_index);
- ClassDB::bind_method(D_METHOD("move_before", "item"), &TreeItem::_move_before);
- ClassDB::bind_method(D_METHOD("move_after", "item"), &TreeItem::_move_after);
+ ClassDB::bind_method(D_METHOD("move_before", "item"), &TreeItem::move_before);
+ ClassDB::bind_method(D_METHOD("move_after", "item"), &TreeItem::move_after);
- ClassDB::bind_method(D_METHOD("remove_child", "child"), &TreeItem::_remove_child);
+ ClassDB::bind_method(D_METHOD("remove_child", "child"), &TreeItem::remove_child);
{
MethodInfo mi;
diff --git a/scene/gui/tree.h b/scene/gui/tree.h
index fd65f90c49..c24763a0e4 100644
--- a/scene/gui/tree.h
+++ b/scene/gui/tree.h
@@ -188,16 +188,6 @@ protected:
return d;
}
- void _remove_child(Object *p_child) {
- remove_child(Object::cast_to<TreeItem>(p_child));
- }
-
- void _move_before(Object *p_item) {
- move_before(Object::cast_to<TreeItem>(p_item));
- }
- void _move_after(Object *p_item) {
- move_after(Object::cast_to<TreeItem>(p_item));
- }
Variant _call_recursive_bind(const Variant **p_args, int p_argcount, Callable::CallError &r_error);