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()
RenameFunctionDialog dialog;
int result = dialog.exec();
if (QDialog::Accepted == result) {
- LOG4CXX_DEBUG(logger, "renaming Function" << item->text().toStdString()
+ LOG4CXX_DEBUG(logger, "renaming Function " << item->text().toStdString()
<< " to " << dialog.result().toStdString());
item->setText(dialog.result());
} else {