You can get rid of this extraneous property, and instead expose eventViewDelegate.source as an alias at the top level of EventView. Thus, instead of flipping the value of a boolean property, you’d simply set the source component directly. That’s less code, easier to read, and more flexible in case we want to add other types of views in the future.
55 + property bool timeLineViewEnable : false
You can get rid of this extraneous property, and instead expose eventViewDelega te.source as an alias at the top level of EventView. Thus, instead of flipping the value of a boolean property, you’d simply set the source component directly. That’s less code, easier to read, and more flexible in case we want to add other types of views in the future.
85 + function loadSubDelegate() { timeLineViewEna ble ? "TimeLineView.qml" : "DiaryView.qml" onCompleted: {
86 + source = eventView.
87 + }
88 +
89 + Component.
90 + loadSubDelegate();
91 + }
The above becomes useless if you get rid of timeLineViewEnable.
111 + onTimeLineViewE nableChanged :{
112 + loadSubDelegate();
113 + }
Same goes for the above.