auto item = new QListWidgetItem(name.c_str(), listWidget);
item->setBackground(QBrush(QColor(0xff, 0xdd, 0xdd)));
});
+ setGlobalHotkeys();
+}
+
+void Mainwindow::setGlobalHotkeys() {
+ QShortcut *shortcut = new QShortcut(QKeySequence("f"), this);
+ connect(shortcut, &QShortcut::activated, this, &Mainwindow::requestNewFunction);
+
+ shortcut = new QShortcut(QKeySequence("r"), listWidget);
+ connect(shortcut, &QShortcut::activated, [=]() {
+ QListWidgetItem * item = listWidget->currentItem();
+ if (item) renameFunction(item);
+ });
}
void Mainwindow::quit()