Sure. I think your original idea would work if you did not create a new CriticalAlarms model every time you make a query. If you make CriticalAlarms a member variable of your class, create it and connect to the selectionChanged() signal and then simply call setQuery() on that instance each time the calendar selection changes, your model will be reset with each query and the current selection will be cleared. The selection model won't be destroyed, it will just be cleared. The next time an item is selected, the selectionChanged() signal will be emitted.

So basically, remove line 87 above, remove the new connection you added after line 90 (keeping the original one from line 61), and make CriticalAlarms into self.CriticalAlarms. Then I think your original code will work. You probably don't have to change get_CriticalAlarms() return value since you'll be returning the same object reference (self.CriticalAlarms).