void DisassemblyView::viewUpdated(void) { Refresh(); emit viewportUpdated(); _needRepaint = true; }
DisassemblyView::DisassemblyView(QWidget * parent, medusa::Medusa * core) : QAbstractScrollArea(parent) , medusa::FullDisassemblyView( *core, medusa::FormatDisassembly::ShowAddress | medusa::FormatDisassembly::AddSpaceBeforeXref, 0, 0, core->GetDocument().GetStartAddress()) , _needRepaint(true) , _core(core) , _wChar(0), _hChar(0) , _addrLen(static_cast<int>(core->GetDocument().GetStartAddress().ToString().length() + 1)) , _cursorTimer(), _cursorBlink(false) , _cache() { setFont(); // this method initializes both _wChar and _hChar setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn); setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); connect(&_cursorTimer, SIGNAL(timeout()), this, SLOT(updateCursor())); _cursorTimer.setInterval(400); setContextMenuPolicy(Qt::CustomContextMenu); connect(this, SIGNAL(customContextMenuRequested(QPoint const &)), this, SLOT(showContextMenu(QPoint const &))); connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(horizontalScrollBarChanged(int))); connect(this, SIGNAL(DisassemblyViewAdded(medusa::Address const&)), this->parent(), SLOT(addDisassemblyView(medusa::Address const&))); connect(this, SIGNAL(SemanticViewAdded(medusa::Address const&)), this->parent(), SLOT(addSemanticView(medusa::Address const&))); connect(this, SIGNAL(ControlFlowGraphViewAdded(medusa::Address const&)), this->parent(), SLOT(addControlFlowGraphView(medusa::Address const&))); connect(this, SIGNAL(viewportUpdated()), this->viewport(), SLOT(update())); int w, h; QRect rect = viewport()->rect(); w = rect.width() / _wChar + 1; h = rect.height() / _hChar + 1; Resize(w, h); viewUpdated(); _UpdateActions(); }
/** * Removes the connections from the given viewport. * * * @param cvp */ void TrackTool::removeConnections(MdiCubeViewport *cvp) { disconnect(cubeViewport(), SIGNAL(viewportUpdated()), this, SLOT(locateCursor())); }