#pragma once #include #include namespace chatterino { namespace widgets { template inline void CreateShortcut(WidgetType *w, const char *key, Func func) { auto s = new QShortcut(QKeySequence(key), w); s->setContext(Qt::WidgetWithChildrenShortcut); QObject::connect(s, &QShortcut::activated, w, func); } } // namespace widgets } // namespace chatterino