diff --git a/src/net/Qml.Net/Internal/DefaultCallbacks.cs b/src/net/Qml.Net/Internal/DefaultCallbacks.cs index b019dfb9..aa7fe9a3 100644 --- a/src/net/Qml.Net/Internal/DefaultCallbacks.cs +++ b/src/net/Qml.Net/Internal/DefaultCallbacks.cs @@ -146,6 +146,19 @@ namespace Qml.Net.Internal NetSignalInfo notifySignal = null; var notifySignalAttribute = propertyInfo.GetCustomAttribute(); + + // All properties have a default notify signal. + // This is so that when we read properties in QML, + // we don't get errors with "NON-NOTIFY PROPERTY BOUND + if (notifySignalAttribute == null && QmlNetConfig.AutoGenerateNotifySignals) + { + var dynamicName = $"dynamic__{propertyInfo.Name}Changed"; + notifySignalAttribute = new NotifySignalAttribute + { + Name = dynamicName + }; + } + if (notifySignalAttribute != null) { var name = notifySignalAttribute.Name; diff --git a/src/net/Qml.Net/QmlNetConfig.cs b/src/net/Qml.Net/QmlNetConfig.cs index d6ad05f5..3ae9a27e 100644 --- a/src/net/Qml.Net/QmlNetConfig.cs +++ b/src/net/Qml.Net/QmlNetConfig.cs @@ -18,6 +18,8 @@ namespace Qml.Net public static bool ShouldEnsureUIThread { get; set; } = true; + public static bool AutoGenerateNotifySignals { get; set; } = false; + public static Action EnsureUIThreadDelegate = () => { if (!QCoreApplication.IsMainThread)