+
+ using ActionSlot = std::function<void(QAction*)>;
+
+ template<typename Receiver, typename Slot>
+ ActionSlot buildActionSlot(Receiver *receiver, Slot slot)
+ {
+ static_assert(!std::is_same<Slot, const char*>::value, "Old-style slots not supported");
+ return [receiver, slot = std::move(slot)](QAction *action) {
+ (receiver->*slot)(action);
+ };
+ }
+
+ void setSlot(ActionSlot slot);