From fea05bb0dba069c82b9dbe2a71b31f88cf54a712 Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 28 Feb 2017 19:51:52 +0100 Subject: Avoid "Unable to assign...." errors i.e. "Unable to assign [undefined] to Sink::ApplicationDomain::Folder::Ptr" Because qml does not know how to assign a default-constructed value we have to use conditional bindings. The !! operator checks for availability of the property which then triggers the binding. I assume an alternative viable approach would be to expose all controller properties as QVariants only, in which case an assignment from null would work (it doesn't for Folder::Ptr). --- components/package/contents/ui/MailListView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'components/package/contents/ui/MailListView.qml') diff --git a/components/package/contents/ui/MailListView.qml b/components/package/contents/ui/MailListView.qml index 1467979a..35fd4ec9 100644 --- a/components/package/contents/ui/MailListView.qml +++ b/components/package/contents/ui/MailListView.qml @@ -28,7 +28,7 @@ import org.kube.framework.domain 1.0 as KubeFramework Item { id: root property variant parentFolder - property variant currentMail + property variant currentMail: null property bool isDraft : false property int currentIndex -- cgit v1.2.3