MCPcopy Create free account
hub / github.com/Vector35/debugger / DebugRegistersWidget

Method DebugRegistersWidget

ui/registerswidget.cpp:404–504  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402
403
404DebugRegistersWidget::DebugRegistersWidget(ViewFrame* view, BinaryViewRef data, Menu* menu) :
405 QTableView(view), m_view(view)
406{
407 m_controller = DebuggerController::GetController(data);
408 if (!m_controller)
409 return;
410
411 m_model = new DebugRegistersListModel(this, m_controller, view);
412 m_filter = new DebugRegisterFilterProxyModel(this);
413 m_filter->setSourceModel(m_model);
414 setModel(m_filter);
415 setEditTriggers(QAbstractItemView::EditKeyPressed);
416 setShowGrid(false);
417
418 m_delegate = new DebugRegistersItemDelegate(this);
419 setItemDelegate(m_delegate);
420
421 setSelectionBehavior(QAbstractItemView::SelectItems);
422 setSelectionMode(QAbstractItemView::SingleSelection);
423
424 verticalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
425 verticalHeader()->setVisible(false);
426
427 horizontalHeader()->setStretchLastSection(true);
428 setHorizontalScrollBarPolicy(Qt::ScrollBarAsNeeded);
429 setHorizontalScrollMode(QAbstractItemView::ScrollPerPixel);
430 setVerticalScrollMode(QAbstractItemView::ScrollPerPixel);
431
432 resizeColumnsToContents();
433 resizeRowsToContents();
434
435 m_actionHandler.setupActionHandler(this);
436 m_contextMenuManager = new ContextMenuManager(this);
437 m_menu = menu;
438 if (m_menu == nullptr)
439 m_menu = new Menu();
440
441 QString actionName = QString::fromStdString("Set to Zero");
442 UIAction::registerAction(actionName);
443 m_menu->addAction(actionName, "Options", MENU_ORDER_NORMAL);
444 m_actionHandler.bindAction(actionName, UIAction([=]() { setToZero(); }, [&]() { return selectionNotEmpty(); }));
445
446 actionName = QString::fromStdString("Edit Value");
447 UIAction::registerAction(actionName, QKeySequence(Qt::Key_E));
448 m_menu->addAction(actionName, "Options", MENU_ORDER_NORMAL);
449 m_actionHandler.bindAction(actionName, UIAction([=]() { editValue(); }, [&]() { return selectionNotEmpty(); }));
450
451 actionName = QString::fromStdString("Jump to Address");
452 UIAction::registerAction(actionName);
453 m_menu->addAction(actionName, "Options", MENU_ORDER_FIRST);
454 m_actionHandler.bindAction(actionName, UIAction([=]() { jump(); }, [&]() { return selectionNotEmpty(); }));
455
456 actionName = QString::fromStdString("Jump to Address in New Pane");
457 UIAction::registerAction(actionName);
458 m_menu->addAction(actionName, "Options", MENU_ORDER_FIRST);
459 m_actionHandler.bindAction(actionName, UIAction([=]() { jumpInNewPane(); }, [&]() { return selectionNotEmpty(); }));
460
461 m_menu->addAction("Copy", "Options", MENU_ORDER_NORMAL);

Callers

nothing calls this directly

Calls 2

Tested by

no test coverage detected