X-Git-Url: https://git.siccegge.de//index.cgi?p=frida%2Ffrida.git;a=blobdiff_plain;f=src%2Fgui%2FMainwindow.cxx;h=8d6bb6882f10ebf4f7b05e2ca767b48a285eeb1b;hp=412c42400f4170d06457edc400efebd70bd7b9ff;hb=2a014774e29e324bc5b5f26143d0384351738ca1;hpb=37e3e9570967efad39ba74213f51bd12aebe4c8c diff --git a/src/gui/Mainwindow.cxx b/src/gui/Mainwindow.cxx index 412c424..8d6bb68 100644 --- a/src/gui/Mainwindow.cxx +++ b/src/gui/Mainwindow.cxx @@ -1,14 +1,12 @@ -#include "Mainwindow.h++" +#include "Mainwindow.hxx" +#include "widgets/BasicBlockWidget.hxx" +#include "qt.hxx" #include #include #include -namespace { - -} - Mainwindow::Mainwindow() { openAction = new QAction(tr("&Open"), this); @@ -75,7 +73,7 @@ void Mainwindow::populateSymbolInformation(const std::string& sym) { // Listing QTableWidget * t = new QTableWidget(); t->setColumnCount(3); - t->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents); + t->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); curBin->for_each_instruction(sym, [&t](long add, std::string bytes, std::string mnemonic) { int row = t->rowCount(); std::stringstream s; @@ -92,12 +90,29 @@ void Mainwindow::populateSymbolInformation(const std::string& sym) { // CFG QGraphicsScene * scene = new QGraphicsScene; - QGraphicsRectItem *rect = scene->addRect(QRectF(0, 0, 100, 100)); - rect->setFlag(QGraphicsItem::ItemIsMovable); - QGraphicsView * view = new QGraphicsView(scene); - w->addTab(view, "CFG"); + BasicBlockWidget * s1 = new BasicBlockWidget; + scene->addItem(s1); + s1->setFlag(QGraphicsItem::ItemIsMovable, true); + + BasicBlockWidget * s2 = new BasicBlockWidget; + scene->addItem(s2); + s2->setFlag(QGraphicsItem::ItemIsMovable, true); + s2->moveBy(-200, 350); + BasicBlockWidget * s3 = new BasicBlockWidget; + scene->addItem(s3); + s3->setFlag(QGraphicsItem::ItemIsMovable, true); + s3->moveBy(100, 350); + + BasicBlockWidget * s4 = new BasicBlockWidget; + scene->addItem(s4); + s4->setFlag(QGraphicsItem::ItemIsMovable, true); + s4->moveBy(400, 350); + + + QGraphicsView * view = new QGraphicsView(scene); + w->addTab(view, "CFG"); listWidget->addItem(sym.c_str()); stackedWidget->addWidget(w);