summaryrefslogtreecommitdiffstats
path: root/doc/classes/Tree.xml
diff options
context:
space:
mode:
authorTechnoPorg <jonah.janzen@gmail.com>2022-01-25 08:37:41 -0700
committerTechnoPorg <jonah.janzen@gmail.com>2022-01-25 09:03:36 -0700
commit051ef479c93c0c830b60059e3dabed6fc381cdd6 (patch)
tree7e934e5aaa141e00de5d4a45ee7d92f4b9f6eb02 /doc/classes/Tree.xml
parent2f4d76f068b29783bde653406b51909b29a082a3 (diff)
downloadredot-engine-051ef479c93c0c830b60059e3dabed6fc381cdd6.tar.gz
Allow method binds to take Object subclasses as arguments
This commit adds a condition to VariantCaster that casts Variants of type OBJECT to any type T, if T is derived from Object. This change enables a fair bit of code cleanup. First, the Variant implicit cast operators for Node and Control can be removed, which allows for some invalid includes to be removed. Second, helper methods in Tree whose sole purpose was to cast arguments to TreeItem * are no longer necessary. A few small changes also had to be made to other files, due to the changes cascading down all the includes.
Diffstat (limited to 'doc/classes/Tree.xml')
-rw-r--r--doc/classes/Tree.xml8
1 files changed, 4 insertions, 4 deletions
diff --git a/doc/classes/Tree.xml b/doc/classes/Tree.xml
index 10bbdc0301..2eda8990ca 100644
--- a/doc/classes/Tree.xml
+++ b/doc/classes/Tree.xml
@@ -50,7 +50,7 @@
</method>
<method name="create_item">
<return type="TreeItem" />
- <argument index="0" name="parent" type="Object" default="null" />
+ <argument index="0" name="parent" type="TreeItem" default="null" />
<argument index="1" name="idx" type="int" default="-1" />
<description>
Creates an item in the tree and adds it as a child of [code]parent[/code].
@@ -170,7 +170,7 @@
</method>
<method name="get_item_area_rect" qualifiers="const">
<return type="Rect2" />
- <argument index="0" name="item" type="Object" />
+ <argument index="0" name="item" type="TreeItem" />
<argument index="1" name="column" type="int" default="-1" />
<description>
Returns the rectangle area for the specified item. If [code]column[/code] is specified, only get the position and size of that column, otherwise get the rectangle containing all columns.
@@ -185,7 +185,7 @@
</method>
<method name="get_next_selected">
<return type="TreeItem" />
- <argument index="0" name="from" type="Object" />
+ <argument index="0" name="from" type="TreeItem" />
<description>
Returns the next selected item after the given one, or [code]null[/code] if the end is reached.
If [code]from[/code] is [code]null[/code], this returns the first selected item.
@@ -239,7 +239,7 @@
</method>
<method name="scroll_to_item">
<return type="void" />
- <argument index="0" name="item" type="Object" />
+ <argument index="0" name="item" type="TreeItem" />
<description>
Causes the [Tree] to jump to the specified item.
</description>