Skip to content

Editor inspector not updated on changing properties which use LineEdit for editing #43238

Closed
@Xrayez

Description

@Xrayez

Godot version:
3.2.3.stable

OS/device including version:
Windows 10.

Issue description:
The property_list_changed_notify() doesn't update the editor inspector if the property's value is String.

property_list_changed_notify_string_bug

I've stumbled upon this while working on goostengine/goost#30, so the same issue is also reproducible on the C++ side with the _change_notify().

This seems to work for other types for the "type" property.

Reverting the type_string property back to default value forces to update the inspector eventually. Switching the arrows (resource history) also works to force update the inspector that way.

This sounds like a bug to me, I don't see why it wouldn't work in this case.

Steps to reproduce:

tool
extends Node2D

# This works:
export(int) var type = TYPE_STRING setget set_type

# This doesn't work:
export(String) var type_string setget set_type_string

var value

# This works:
func set_type(p_type):
	type = p_type
	property_list_changed_notify()
	# The property editor for 'value' is successfully instantiated for this type.

# This doesn't work:
func set_type_string(p_type_string):
	type_string = p_type_string
	match type_string:
		"bool":
			print("Set type via string: bool")
			type = TYPE_BOOL
		"Vector2":
			print("Set type via string: Vector2")
			type = TYPE_VECTOR2
	property_list_changed_notify()
	# The property editor is not replaced with a new type.
	# Expected to update the property of 'value' in the inspector by now.


# The `value`s type is changed dynamically here.
func _get_property_list():
	return [
		{
			"type": type,
			"name": "value"
		}
	]

Minimal reproduction project:
property_list_changed_dynamic_string.zip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions