setCentralWidget(stackedWidget);
connect(listWidget, SIGNAL(currentRowChanged(int)),
- stackedWidget, SLOT(setCurrentIndex(int)));
+ this, SLOT(switchMainPlane(int)));
setWindowTitle(tr("FRIDA"));
manager->reset(fileName.toStdString());
}
+void Mainwindow::switchMainPlane(int index) {
+ stackedWidget->setCurrentWidget(objects_list[listWidget->currentItem()]);
+}
+
void Mainwindow::showListContextMenu(const QPoint& point) {
QListWidgetItem * item = listWidget->itemAt(point);
if (item) {
w->addTab(t, "Listing");
- listWidget->addItem(fun->getName().c_str());
+ QListWidgetItem * item = new QListWidgetItem(fun->getName().c_str(), listWidget);
stackedWidget->addWidget(w);
+ objects_list.insert(std::make_pair(item, w));
}
namespace {
QAction *openAction;
std::map<uint64_t, BasicBlockWidget*> blocks;
+ std::map<QListWidgetItem*, QWidget*> objects_list;
std::set<Function*> functions;
InformationManager* manager;
private Q_SLOTS:
void quit();
void open();
+ void switchMainPlane(int);
void showListContextMenu(const QPoint&);
void requestNewFunction();
};