- mgr->connect_new_dyn_symbol_signal([&] (const std::string& name) {
- auto item = new QListWidgetItem(name.c_str(), listWidget);
- item->setBackground(QBrush(QColor(0xff, 0xdd, 0xdd)));
+ mgr->connect_new_dyn_symbol_signal([=] (const std::string& name) {
+ auto item = new QTreeWidgetItem(external, QStringList(name.c_str()));
+ item->setBackground(0, 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, [=]() {
+ QTreeWidgetItem * item = listWidget->currentItem();
+ if (item) renameFunction(objects_list[item]->getFunction());