How to notify array add changed in UE4 C++ code
Hi,
I create ViewModel using c++ code, and can use "UNoesisFunctionLibrary::NotifyChanged(this, IsTestName);" to notify property changed.
How to notify array add changed?
Thanks.
I create ViewModel using c++ code, and can use "UNoesisFunctionLibrary::NotifyChanged(this, IsTestName);" to notify property changed.
How to notify array add changed?
Thanks.
Re: How to notify array add changed in UE4 C++ code
You can use UNoesisFunctionLibrary::NotifyArrayChanged in much the same way, but that function is very coarse and not optimal.
NoesisTypeClass.h exposes more fine grained functions you can use. In your case, you want to use NoesisNotifyArrayPropertyAdd. The way to use it is that you pass the address of the array, like this:
NoesisTypeClass.h exposes more fine grained functions you can use. In your case, you want to use NoesisNotifyArrayPropertyAdd. The way to use it is that you pass the address of the array, like this:
Code: Select all
UCLASS()
class UMyClass : public UObject
{
UPROPERTY(BlueprintReadWrite)
TArray<SomeType> MyArray;
void AddSomething()
{
MyArray.Add(Something);
NoesisNotifyArrayPropertyAdd(&MyArray);
}
};
Who is online
Users browsing this forum: Bing [Bot] and 1 guest