mirror of
https://github.com/holub/mame
synced 2025-04-16 21:44:32 +03:00
debugqt: Port to Qt5 [O. Galibert]
This commit is contained in:
parent
1b452e3bfb
commit
a83ad4d11f
@ -142,7 +142,7 @@ function osdmodulesbuild()
|
||||
end
|
||||
MOC = _OPTIONS["QT_HOME"] .. "/bin/moc"
|
||||
else
|
||||
MOCTST = backtick("which moc-qt4 2>/dev/null")
|
||||
MOCTST = backtick("which moc-qt5 2>/dev/null")
|
||||
if (MOCTST=='') then
|
||||
MOCTST = backtick("which moc 2>/dev/null")
|
||||
end
|
||||
@ -185,7 +185,7 @@ function osdmodulesbuild()
|
||||
}
|
||||
else
|
||||
buildoptions {
|
||||
backtick("pkg-config --cflags QtGui"),
|
||||
backtick("pkg-config --cflags Qt5Widgets"),
|
||||
}
|
||||
end
|
||||
end
|
||||
@ -237,16 +237,18 @@ function osdmodulestargetconf()
|
||||
}
|
||||
links {
|
||||
"qtmain",
|
||||
"QtGui4",
|
||||
"QtCore4",
|
||||
"Qt5Core",
|
||||
"Qt5Gui",
|
||||
"Qt5Widgets",
|
||||
}
|
||||
elseif _OPTIONS["targetos"]=="macosx" then
|
||||
linkoptions {
|
||||
"-F" .. backtick("qmake -query QT_INSTALL_LIBS"),
|
||||
}
|
||||
links {
|
||||
"QtCore.framework",
|
||||
"QtGui.framework",
|
||||
"Qt5Core.framework",
|
||||
"Qt5Gui.framework",
|
||||
"Qt5Widgets.framework",
|
||||
}
|
||||
else
|
||||
if _OPTIONS["QT_HOME"]~=nil then
|
||||
@ -254,11 +256,12 @@ function osdmodulestargetconf()
|
||||
"-L" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"),
|
||||
}
|
||||
links {
|
||||
"QtGui",
|
||||
"QtCore",
|
||||
"Qt5Core",
|
||||
"Qt5Gui",
|
||||
"Qt5Widgets",
|
||||
}
|
||||
else
|
||||
local str = backtick("pkg-config --libs QtGui")
|
||||
local str = backtick("pkg-config --libs Qt5Widgets")
|
||||
addlibfromstring(str)
|
||||
addoptionsfromstring(str)
|
||||
end
|
||||
|
@ -18,11 +18,6 @@ if _OPTIONS["NO_OPENGL"]~="1" and _OPTIONS["USE_DISPATCH_GL"]~="1" and _OPTIONS[
|
||||
}
|
||||
end
|
||||
|
||||
if _OPTIONS["SDL_INI_PATH"]~=nil then
|
||||
defines {
|
||||
"'INI_PATH=\"" .. _OPTIONS["SDL_INI_PATH"] .. "\"'",
|
||||
}
|
||||
end
|
||||
|
||||
if _OPTIONS["NO_X11"]=="1" then
|
||||
defines {
|
||||
@ -130,7 +125,7 @@ elseif _OPTIONS["targetos"]=="linux" then
|
||||
}
|
||||
else
|
||||
buildoptions {
|
||||
backtick("pkg-config --cflags QtGui"),
|
||||
backtick("pkg-config --cflags Qt5Widgets"),
|
||||
}
|
||||
end
|
||||
elseif _OPTIONS["targetos"]=="macosx" then
|
||||
|
@ -8,9 +8,7 @@
|
||||
//
|
||||
//============================================================
|
||||
|
||||
#if (!defined(NO_MEM_TRACKING))
|
||||
#define NO_MEM_TRACKING
|
||||
#endif
|
||||
|
||||
#include "debug_module.h"
|
||||
#include "modules/osdmodule.h"
|
||||
@ -19,8 +17,7 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
#include <QtGui/QApplication>
|
||||
#include <QtWidgets/QApplication>
|
||||
|
||||
#include "emu.h"
|
||||
#include "config.h"
|
||||
|
@ -2,6 +2,12 @@
|
||||
// copyright-holders:Andrew Gardner
|
||||
#define NO_MEM_TRACKING
|
||||
|
||||
#include <QtWidgets/QActionGroup>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QMenu>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
|
||||
#include "breakpointswindow.h"
|
||||
|
||||
#include "debug/debugcon.h"
|
||||
@ -54,7 +60,7 @@ BreakpointsWindow::BreakpointsWindow(running_machine* machine, QWidget* parent)
|
||||
typeBreak->setShortcut(QKeySequence("Ctrl+1"));
|
||||
typeWatch->setShortcut(QKeySequence("Ctrl+2"));
|
||||
typeBreak->setChecked(true);
|
||||
connect(typeGroup, SIGNAL(triggered(QAction*)), this, SLOT(typeChanged(QAction*)));
|
||||
connect(typeGroup, &QActionGroup::triggered, this, &BreakpointsWindow::typeChanged);
|
||||
|
||||
// Assemble the options menu
|
||||
QMenu* optionsMenu = menuBar()->addMenu("&Options");
|
||||
|
@ -3,8 +3,6 @@
|
||||
#ifndef __DEBUG_QT_BREAK_POINTS_WINDOW_H__
|
||||
#define __DEBUG_QT_BREAK_POINTS_WINDOW_H__
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
#include "debuggerview.h"
|
||||
#include "windowqt.h"
|
||||
|
||||
|
@ -2,6 +2,12 @@
|
||||
// copyright-holders:Andrew Gardner
|
||||
#define NO_MEM_TRACKING
|
||||
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QtWidgets/QMenu>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
|
||||
#include "dasmwindow.h"
|
||||
|
||||
#include "debug/debugcon.h"
|
||||
@ -30,17 +36,17 @@ DasmWindow::DasmWindow(running_machine* machine, QWidget* parent) :
|
||||
|
||||
// The input edit
|
||||
m_inputEdit = new QLineEdit(topSubFrame);
|
||||
connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(expressionSubmitted()));
|
||||
connect(m_inputEdit, &QLineEdit::returnPressed, this, &DasmWindow::expressionSubmitted);
|
||||
|
||||
// The cpu combo box
|
||||
m_cpuComboBox = new QComboBox(topSubFrame);
|
||||
m_cpuComboBox->setObjectName("cpu");
|
||||
m_cpuComboBox->setMinimumWidth(300);
|
||||
connect(m_cpuComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(cpuChanged(int)));
|
||||
connect(m_cpuComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &DasmWindow::cpuChanged);
|
||||
|
||||
// The main disasm window
|
||||
m_dasmView = new DebuggerView(DVT_DISASSEMBLY, m_machine, this);
|
||||
connect(m_dasmView, SIGNAL(updated()), this, SLOT(dasmViewUpdated()));
|
||||
connect(m_dasmView, &DebuggerView::updated, this, &DasmWindow::dasmViewUpdated);
|
||||
|
||||
// Force a recompute of the disassembly region
|
||||
downcast<debug_view_disasm*>(m_dasmView->view())->set_expression("curpc");
|
||||
@ -77,9 +83,9 @@ DasmWindow::DasmWindow(running_machine* machine, QWidget* parent) :
|
||||
m_breakpointToggleAct->setShortcut(Qt::Key_F9);
|
||||
m_breakpointEnableAct->setShortcut(Qt::SHIFT + Qt::Key_F9);
|
||||
m_runToCursorAct->setShortcut(Qt::Key_F4);
|
||||
connect(m_breakpointToggleAct, SIGNAL(triggered(bool)), this, SLOT(toggleBreakpointAtCursor(bool)));
|
||||
connect(m_breakpointEnableAct, SIGNAL(triggered(bool)), this, SLOT(enableBreakpointAtCursor(bool)));
|
||||
connect(m_runToCursorAct, SIGNAL(triggered(bool)), this, SLOT(runToCursor(bool)));
|
||||
connect(m_breakpointToggleAct, &QAction::triggered, this, &DasmWindow::toggleBreakpointAtCursor);
|
||||
connect(m_breakpointEnableAct, &QAction::triggered, this, &DasmWindow::enableBreakpointAtCursor);
|
||||
connect(m_runToCursorAct, &QAction::triggered, this, &DasmWindow::runToCursor);
|
||||
|
||||
// Right bar options
|
||||
QActionGroup* rightBarGroup = new QActionGroup(this);
|
||||
@ -97,7 +103,7 @@ DasmWindow::DasmWindow(running_machine* machine, QWidget* parent) :
|
||||
rightActEncrypted->setShortcut(QKeySequence("Ctrl+E"));
|
||||
rightActComments->setShortcut(QKeySequence("Ctrl+C"));
|
||||
rightActRaw->setChecked(true);
|
||||
connect(rightBarGroup, SIGNAL(triggered(QAction*)), this, SLOT(rightBarChanged(QAction*)));
|
||||
connect(rightBarGroup, &QActionGroup::triggered, this, &DasmWindow::rightBarChanged);
|
||||
|
||||
// Assemble the options menu
|
||||
QMenu* optionsMenu = menuBar()->addMenu("&Options");
|
||||
|
@ -3,7 +3,8 @@
|
||||
#ifndef __DEBUG_QT_DASM_WINDOW_H__
|
||||
#define __DEBUG_QT_DASM_WINDOW_H__
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QtWidgets/QComboBox>
|
||||
|
||||
#include "debuggerview.h"
|
||||
#include "windowqt.h"
|
||||
|
@ -2,6 +2,11 @@
|
||||
// copyright-holders:Andrew Gardner
|
||||
#define NO_MEM_TRACKING
|
||||
|
||||
#include <QtWidgets/QScrollBar>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtGui/QPainter>
|
||||
#include <QtGui/QKeyEvent>
|
||||
|
||||
#include "debuggerview.h"
|
||||
|
||||
#include "modules/lib/osdobj_common.h"
|
||||
@ -28,10 +33,10 @@ DebuggerView::DebuggerView(const debug_view_type& type,
|
||||
DebuggerView::debuggerViewUpdate,
|
||||
this);
|
||||
|
||||
connect(verticalScrollBar(), SIGNAL(valueChanged(int)),
|
||||
this, SLOT(verticalScrollSlot(int)));
|
||||
connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),
|
||||
this, SLOT(horizontalScrollSlot(int)));
|
||||
connect(verticalScrollBar(), &QScrollBar::valueChanged,
|
||||
this, &DebuggerView::verticalScrollSlot);
|
||||
connect(horizontalScrollBar(), &QScrollBar::valueChanged,
|
||||
this, &DebuggerView::horizontalScrollSlot);
|
||||
}
|
||||
|
||||
|
||||
@ -41,127 +46,12 @@ DebuggerView::~DebuggerView()
|
||||
m_machine->debug_view().free_view(*m_view);
|
||||
}
|
||||
|
||||
// TODO: remove this version no later than January 1, 2015
|
||||
#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
|
||||
void DebuggerView::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
// Tell the MAME debug view how much real estate is available
|
||||
QFontMetrics actualFont = fontMetrics();
|
||||
const int fontWidth = MAX(1, actualFont.width('_'));
|
||||
const int fontHeight = MAX(1, actualFont.height());
|
||||
m_view->set_visible_size(debug_view_xy(width()/fontWidth, height()/fontHeight));
|
||||
|
||||
|
||||
// Handle the scroll bars
|
||||
const int horizontalScrollCharDiff = m_view->total_size().x - m_view->visible_size().x;
|
||||
const int horizontalScrollSize = horizontalScrollCharDiff < 0 ? 0 : horizontalScrollCharDiff;
|
||||
horizontalScrollBar()->setRange(0, horizontalScrollSize);
|
||||
|
||||
// If the horizontal scroll bar appears, make sure to adjust the vertical scrollbar accordingly
|
||||
const int verticalScrollAdjust = horizontalScrollSize > 0 ? 1 : 0;
|
||||
|
||||
const int verticalScrollCharDiff = m_view->total_size().y - m_view->visible_size().y;
|
||||
const int verticalScrollSize = verticalScrollCharDiff < 0 ? 0 : verticalScrollCharDiff+verticalScrollAdjust;
|
||||
bool atEnd = false;
|
||||
if (verticalScrollBar()->value() == verticalScrollBar()->maximum())
|
||||
{
|
||||
atEnd = true;
|
||||
}
|
||||
verticalScrollBar()->setRange(0, verticalScrollSize);
|
||||
if (m_preferBottom && atEnd)
|
||||
{
|
||||
verticalScrollBar()->setValue(verticalScrollSize);
|
||||
}
|
||||
|
||||
|
||||
// Draw the viewport widget
|
||||
QPainter painter(viewport());
|
||||
painter.fillRect(0, 0, width(), height(), QBrush(Qt::white));
|
||||
painter.setBackgroundMode(Qt::OpaqueMode);
|
||||
painter.setBackground(QColor(255,255,255));
|
||||
|
||||
// Background control
|
||||
QBrush bgBrush;
|
||||
bgBrush.setStyle(Qt::SolidPattern);
|
||||
painter.setPen(QPen(QColor(0,0,0)));
|
||||
|
||||
size_t viewDataOffset = 0;
|
||||
const debug_view_xy& visibleCharDims = m_view->visible_size();
|
||||
for (int y = 0; y < visibleCharDims.y; y++)
|
||||
{
|
||||
for (int x = 0; x < visibleCharDims.x; x++)
|
||||
{
|
||||
const unsigned char textAttr = m_view->viewdata()[viewDataOffset].attrib;
|
||||
|
||||
if (x == 0 || textAttr != m_view->viewdata()[viewDataOffset-1].attrib)
|
||||
{
|
||||
// Text color handling
|
||||
QColor fgColor(0,0,0);
|
||||
QColor bgColor(255,255,255);
|
||||
|
||||
if(textAttr & DCA_VISITED)
|
||||
{
|
||||
bgColor.setRgb(0xc6, 0xe2, 0xff);
|
||||
}
|
||||
if(textAttr & DCA_ANCILLARY)
|
||||
{
|
||||
bgColor.setRgb(0xe0, 0xe0, 0xe0);
|
||||
}
|
||||
if(textAttr & DCA_SELECTED)
|
||||
{
|
||||
bgColor.setRgb(0xff, 0x80, 0x80);
|
||||
}
|
||||
if(textAttr & DCA_CURRENT)
|
||||
{
|
||||
bgColor.setRgb(0xff, 0xff, 0x00);
|
||||
}
|
||||
if ((textAttr & DCA_SELECTED) && (textAttr & DCA_CURRENT))
|
||||
{
|
||||
bgColor.setRgb(0xff,0xc0,0x80);
|
||||
}
|
||||
if(textAttr & DCA_CHANGED)
|
||||
{
|
||||
fgColor.setRgb(0xff, 0x00, 0x00);
|
||||
}
|
||||
if(textAttr & DCA_INVALID)
|
||||
{
|
||||
fgColor.setRgb(0x00, 0x00, 0xff);
|
||||
}
|
||||
if(textAttr & DCA_DISABLED)
|
||||
{
|
||||
fgColor.setRgb((fgColor.red() + bgColor.red()) >> 1,
|
||||
(fgColor.green() + bgColor.green()) >> 1,
|
||||
(fgColor.blue() + bgColor.blue()) >> 1);
|
||||
}
|
||||
if(textAttr & DCA_COMMENT)
|
||||
{
|
||||
fgColor.setRgb(0x00, 0x80, 0x00);
|
||||
}
|
||||
|
||||
bgBrush.setColor(bgColor);
|
||||
painter.setBackground(bgBrush);
|
||||
painter.setPen(QPen(fgColor));
|
||||
}
|
||||
|
||||
// Your character is not guaranteed to take up the entire fontWidth x fontHeight, so fill before.
|
||||
painter.fillRect(x*fontWidth, y*fontHeight, fontWidth, fontHeight, bgBrush);
|
||||
|
||||
// There is a touchy interplay between font height, drawing difference, visible position, etc
|
||||
// Fonts don't get drawn "down and to the left" like boxes, so some wiggling is needed.
|
||||
painter.drawText(x*fontWidth,
|
||||
(y*fontHeight + (fontHeight*0.80)),
|
||||
QString(m_view->viewdata()[viewDataOffset].byte));
|
||||
viewDataOffset++;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
void DebuggerView::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
// Tell the MAME debug view how much real estate is available
|
||||
QFontMetrics actualFont = fontMetrics();
|
||||
const double fontWidth = actualFont.width(QString(100, '_')) / 100.;
|
||||
const int fontHeight = MAX(1, actualFont.height());
|
||||
const int fontHeight = MAX(1, actualFont.lineSpacing());
|
||||
m_view->set_visible_size(debug_view_xy(width()/fontWidth, height()/fontHeight));
|
||||
|
||||
|
||||
@ -272,7 +162,6 @@ void DebuggerView::paintEvent(QPaintEvent* event)
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void DebuggerView::keyPressEvent(QKeyEvent* event)
|
||||
{
|
||||
|
@ -3,7 +3,7 @@
|
||||
#ifndef __DEBUG_QT_DEBUGGER_VIEW_H__
|
||||
#define __DEBUG_QT_DEBUGGER_VIEW_H__
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
#include <QtWidgets/QAbstractScrollArea>
|
||||
|
||||
#include "debug/debugvw.h"
|
||||
|
||||
|
@ -2,6 +2,10 @@
|
||||
// copyright-holders:Andrew Gardner
|
||||
#define NO_MEM_TRACKING
|
||||
|
||||
#include <QtWidgets/QFrame>
|
||||
#include <QtWidgets/QLabel>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
|
||||
#include "deviceinformationwindow.h"
|
||||
|
||||
|
||||
|
@ -3,8 +3,6 @@
|
||||
#ifndef __DEBUG_QT_DEVICE_INFORMATION_WINDOW_H__
|
||||
#define __DEBUG_QT_DEVICE_INFORMATION_WINDOW_H__
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
#include "windowqt.h"
|
||||
|
||||
//============================================================
|
||||
|
@ -128,8 +128,8 @@ DevicesWindow::DevicesWindow(running_machine* machine, QWidget* parent) :
|
||||
m_devices_view->setModel(&m_devices_model);
|
||||
m_devices_view->expandAll();
|
||||
m_devices_view->resizeColumnToContents(0);
|
||||
connect(m_devices_view->selectionModel(), SIGNAL(currentRowChanged(const QModelIndex &,const QModelIndex &)), this, SLOT(currentRowChanged(const QModelIndex &,const QModelIndex &)));
|
||||
connect(m_devices_view, SIGNAL(activated(const QModelIndex &)), this, SLOT(activated(const QModelIndex &)));
|
||||
connect(m_devices_view->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &DevicesWindow::currentRowChanged);
|
||||
connect(m_devices_view, &QTreeView::activated, this, &DevicesWindow::activated);
|
||||
setCentralWidget(m_devices_view);
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
#ifndef __DEBUG_QT_DEVICES_WINDOW_H__
|
||||
#define __DEBUG_QT_DEVICES_WINDOW_H__
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
#include <QtWidgets/QTreeView>
|
||||
|
||||
#include "windowqt.h"
|
||||
|
||||
|
@ -2,6 +2,8 @@
|
||||
// copyright-holders:Andrew Gardner
|
||||
#define NO_MEM_TRACKING
|
||||
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
|
||||
#include "logwindow.h"
|
||||
|
||||
#include "debug/debugcon.h"
|
||||
|
@ -3,8 +3,6 @@
|
||||
#ifndef __DEBUG_QT_LOG_WINDOW_H__
|
||||
#define __DEBUG_QT_LOG_WINDOW_H__
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
|
||||
#include "debuggerview.h"
|
||||
#include "windowqt.h"
|
||||
|
||||
|
@ -2,6 +2,14 @@
|
||||
// copyright-holders:Andrew Gardner
|
||||
#define NO_MEM_TRACKING
|
||||
|
||||
#include <QtWidgets/QAction>
|
||||
#include <QtWidgets/QMenu>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
#include <QtWidgets/QDockWidget>
|
||||
#include <QtWidgets/QScrollBar>
|
||||
#include <QtWidgets/QFileDialog>
|
||||
#include <QtGui/QCloseEvent>
|
||||
|
||||
#include "mainwindow.h"
|
||||
|
||||
#include "debug/debugcon.h"
|
||||
@ -23,7 +31,7 @@ MainWindow::MainWindow(running_machine* machine, QWidget* parent) :
|
||||
|
||||
// The input line
|
||||
m_inputEdit = new QLineEdit(mainWindowFrame);
|
||||
connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(executeCommand()));
|
||||
connect(m_inputEdit, &QLineEdit::returnPressed, this, &MainWindow::executeCommandSlot);
|
||||
m_inputEdit->installEventFilter(this);
|
||||
|
||||
|
||||
@ -52,9 +60,9 @@ MainWindow::MainWindow(running_machine* machine, QWidget* parent) :
|
||||
m_breakpointToggleAct->setShortcut(Qt::Key_F9);
|
||||
m_breakpointEnableAct->setShortcut(Qt::SHIFT + Qt::Key_F9);
|
||||
m_runToCursorAct->setShortcut(Qt::Key_F4);
|
||||
connect(m_breakpointToggleAct, SIGNAL(triggered(bool)), this, SLOT(toggleBreakpointAtCursor(bool)));
|
||||
connect(m_breakpointEnableAct, SIGNAL(triggered(bool)), this, SLOT(enableBreakpointAtCursor(bool)));
|
||||
connect(m_runToCursorAct, SIGNAL(triggered(bool)), this, SLOT(runToCursor(bool)));
|
||||
connect(m_breakpointToggleAct, &QAction::triggered, this, &MainWindow::toggleBreakpointAtCursor);
|
||||
connect(m_breakpointEnableAct, &QAction::triggered, this, &MainWindow::enableBreakpointAtCursor);
|
||||
connect(m_runToCursorAct, &QAction::triggered, this, &MainWindow::runToCursor);
|
||||
|
||||
// Right bar options
|
||||
QActionGroup* rightBarGroup = new QActionGroup(this);
|
||||
@ -72,7 +80,7 @@ MainWindow::MainWindow(running_machine* machine, QWidget* parent) :
|
||||
rightActEncrypted->setShortcut(QKeySequence("Ctrl+E"));
|
||||
rightActComments->setShortcut(QKeySequence("Ctrl+C"));
|
||||
rightActRaw->setChecked(true);
|
||||
connect(rightBarGroup, SIGNAL(triggered(QAction*)), this, SLOT(rightBarChanged(QAction*)));
|
||||
connect(rightBarGroup, &QActionGroup::triggered, this, &MainWindow::rightBarChanged);
|
||||
|
||||
// Assemble the options menu
|
||||
QMenu* optionsMenu = menuBar()->addMenu("&Options");
|
||||
@ -115,7 +123,7 @@ MainWindow::MainWindow(running_machine* machine, QWidget* parent) :
|
||||
dasmDock->setAllowedAreas(Qt::TopDockWidgetArea);
|
||||
m_dasmFrame = new DasmDockWidget(m_machine, dasmDock);
|
||||
dasmDock->setWidget(m_dasmFrame);
|
||||
connect(m_dasmFrame->view(), SIGNAL(updated()), this, SLOT(dasmViewUpdated()));
|
||||
connect(m_dasmFrame->view(), &DebuggerView::updated, this, &MainWindow::dasmViewUpdated);
|
||||
|
||||
addDockWidget(Qt::TopDockWidgetArea, dasmDock);
|
||||
dockMenu->addAction(dasmDock->toggleViewAction());
|
||||
@ -300,6 +308,10 @@ void MainWindow::rightBarChanged(QAction* changedTo)
|
||||
m_dasmFrame->view()->viewport()->update();
|
||||
}
|
||||
|
||||
void MainWindow::executeCommandSlot()
|
||||
{
|
||||
executeCommand(true);
|
||||
}
|
||||
|
||||
void MainWindow::executeCommand(bool withClear)
|
||||
{
|
||||
@ -477,8 +489,8 @@ void MainWindow::createImagesMenu()
|
||||
mountAct->setData(QVariant(interfaceIndex));
|
||||
unmountAct->setObjectName("unmount");
|
||||
unmountAct->setData(QVariant(interfaceIndex));
|
||||
connect(mountAct, SIGNAL(triggered(bool)), this, SLOT(mountImage(bool)));
|
||||
connect(unmountAct, SIGNAL(triggered(bool)), this, SLOT(unmountImage(bool)));
|
||||
connect(mountAct, &QAction::triggered, this, &MainWindow::mountImage);
|
||||
connect(unmountAct, &QAction::triggered, this, &MainWindow::unmountImage);
|
||||
|
||||
if (!img->exists())
|
||||
unmountAct->setEnabled(false);
|
||||
|
@ -3,9 +3,12 @@
|
||||
#ifndef __DEBUG_QT_MAIN_WINDOW_H__
|
||||
#define __DEBUG_QT_MAIN_WINDOW_H__
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
#include <vector>
|
||||
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
#include <QtWidgets/QComboBox>
|
||||
|
||||
#include "debug/dvdisasm.h"
|
||||
|
||||
#include "debuggerview.h"
|
||||
@ -43,7 +46,7 @@ private slots:
|
||||
void runToCursor(bool changedTo);
|
||||
void rightBarChanged(QAction* changedTo);
|
||||
|
||||
void executeCommand(bool withClear=true);
|
||||
void executeCommandSlot();
|
||||
|
||||
void mountImage(bool changedTo);
|
||||
void unmountImage(bool changedTo);
|
||||
@ -72,6 +75,7 @@ private:
|
||||
int m_historyIndex;
|
||||
std::vector<QString> m_inputHistory;
|
||||
void addToHistory(const QString& command);
|
||||
void executeCommand(bool withClear);
|
||||
};
|
||||
|
||||
|
||||
|
@ -2,6 +2,17 @@
|
||||
// copyright-holders:Andrew Gardner
|
||||
#define NO_MEM_TRACKING
|
||||
|
||||
#include <QtGui/QClipboard>
|
||||
#include <QtGui/QMouseEvent>
|
||||
#include <QtWidgets/QActionGroup>
|
||||
#include <QtWidgets/QApplication>
|
||||
#include <QtWidgets/QHBoxLayout>
|
||||
#include <QtWidgets/QMenu>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
#include <QtWidgets/QScrollBar>
|
||||
#include <QtWidgets/QToolTip>
|
||||
#include <QtWidgets/QVBoxLayout>
|
||||
|
||||
#include "memorywindow.h"
|
||||
|
||||
#include "debug/dvmemory.h"
|
||||
@ -30,13 +41,13 @@ MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) :
|
||||
|
||||
// The input edit
|
||||
m_inputEdit = new QLineEdit(topSubFrame);
|
||||
connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(expressionSubmitted()));
|
||||
connect(m_inputEdit, &QLineEdit::returnPressed, this, &MemoryWindow::expressionSubmitted);
|
||||
|
||||
// The memory space combo box
|
||||
m_memoryComboBox = new QComboBox(topSubFrame);
|
||||
m_memoryComboBox->setObjectName("memoryregion");
|
||||
m_memoryComboBox->setMinimumWidth(300);
|
||||
connect(m_memoryComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(memoryRegionChanged(int)));
|
||||
connect(m_memoryComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &MemoryWindow::memoryRegionChanged);
|
||||
|
||||
// The main memory window
|
||||
m_memTable = new DebuggerMemView(DVT_MEMORY, m_machine, this);
|
||||
@ -78,7 +89,7 @@ MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) :
|
||||
chunkActTwo->setShortcut(QKeySequence("Ctrl+2"));
|
||||
chunkActFour->setShortcut(QKeySequence("Ctrl+4"));
|
||||
chunkActOne->setChecked(true);
|
||||
connect(chunkGroup, SIGNAL(triggered(QAction*)), this, SLOT(chunkChanged(QAction*)));
|
||||
connect(chunkGroup, &QActionGroup::triggered, this, &MemoryWindow::chunkChanged);
|
||||
|
||||
// Create a address display group
|
||||
QActionGroup* addressGroup = new QActionGroup(this);
|
||||
@ -92,22 +103,22 @@ MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) :
|
||||
addressActLogical->setShortcut(QKeySequence("Ctrl+G"));
|
||||
addressActPhysical->setShortcut(QKeySequence("Ctrl+Y"));
|
||||
addressActLogical->setChecked(true);
|
||||
connect(addressGroup, SIGNAL(triggered(QAction*)), this, SLOT(addressChanged(QAction*)));
|
||||
connect(addressGroup, &QActionGroup::triggered, this, &MemoryWindow::addressChanged);
|
||||
|
||||
// Create a reverse view radio
|
||||
QAction* reverseAct = new QAction("Reverse View", this);
|
||||
reverseAct->setObjectName("reverse");
|
||||
reverseAct->setCheckable(true);
|
||||
reverseAct->setShortcut(QKeySequence("Ctrl+R"));
|
||||
connect(reverseAct, SIGNAL(toggled(bool)), this, SLOT(reverseChanged(bool)));
|
||||
connect(reverseAct, &QAction::toggled, this, &MemoryWindow::reverseChanged);
|
||||
|
||||
// Create increase and decrease bytes-per-line actions
|
||||
QAction* increaseBplAct = new QAction("Increase Bytes Per Line", this);
|
||||
QAction* decreaseBplAct = new QAction("Decrease Bytes Per Line", this);
|
||||
increaseBplAct->setShortcut(QKeySequence("Ctrl+P"));
|
||||
decreaseBplAct->setShortcut(QKeySequence("Ctrl+O"));
|
||||
connect(increaseBplAct, SIGNAL(triggered(bool)), this, SLOT(increaseBytesPerLine(bool)));
|
||||
connect(decreaseBplAct, SIGNAL(triggered(bool)), this, SLOT(decreaseBytesPerLine(bool)));
|
||||
connect(increaseBplAct, &QAction::triggered, this, &MemoryWindow::increaseBytesPerLine);
|
||||
connect(decreaseBplAct, &QAction::triggered, this, &MemoryWindow::decreaseBytesPerLine);
|
||||
|
||||
// Assemble the options menu
|
||||
QMenu* optionsMenu = menuBar()->addMenu("&Options");
|
||||
|
@ -3,7 +3,8 @@
|
||||
#ifndef __DEBUG_QT_MEMORY_WINDOW_H__
|
||||
#define __DEBUG_QT_MEMORY_WINDOW_H__
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
#include <QtWidgets/QLineEdit>
|
||||
#include <QtWidgets/QComboBox>
|
||||
|
||||
#include "debuggerview.h"
|
||||
#include "windowqt.h"
|
||||
|
@ -2,6 +2,9 @@
|
||||
// copyright-holders:Andrew Gardner
|
||||
#define NO_MEM_TRACKING
|
||||
|
||||
#include <QtWidgets/QMenu>
|
||||
#include <QtWidgets/QMenuBar>
|
||||
|
||||
#include "windowqt.h"
|
||||
#include "logwindow.h"
|
||||
#include "dasmwindow.h"
|
||||
@ -27,71 +30,71 @@ WindowQt::WindowQt(running_machine* machine, QWidget* parent) :
|
||||
// The Debug menu bar
|
||||
QAction* debugActOpenMemory = new QAction("New &Memory Window", this);
|
||||
debugActOpenMemory->setShortcut(QKeySequence("Ctrl+M"));
|
||||
connect(debugActOpenMemory, SIGNAL(triggered()), this, SLOT(debugActOpenMemory()));
|
||||
connect(debugActOpenMemory, &QAction::triggered, this, &WindowQt::debugActOpenMemory);
|
||||
|
||||
QAction* debugActOpenDasm = new QAction("New &Dasm Window", this);
|
||||
debugActOpenDasm->setShortcut(QKeySequence("Ctrl+D"));
|
||||
connect(debugActOpenDasm, SIGNAL(triggered()), this, SLOT(debugActOpenDasm()));
|
||||
connect(debugActOpenDasm, &QAction::triggered, this, &WindowQt::debugActOpenDasm);
|
||||
|
||||
QAction* debugActOpenLog = new QAction("New &Log Window", this);
|
||||
debugActOpenLog->setShortcut(QKeySequence("Ctrl+L"));
|
||||
connect(debugActOpenLog, SIGNAL(triggered()), this, SLOT(debugActOpenLog()));
|
||||
connect(debugActOpenLog, &QAction::triggered, this, &WindowQt::debugActOpenLog);
|
||||
|
||||
QAction* debugActOpenPoints = new QAction("New &Break|Watchpoints Window", this);
|
||||
debugActOpenPoints->setShortcut(QKeySequence("Ctrl+B"));
|
||||
connect(debugActOpenPoints, SIGNAL(triggered()), this, SLOT(debugActOpenPoints()));
|
||||
connect(debugActOpenPoints, &QAction::triggered, this, &WindowQt::debugActOpenPoints);
|
||||
|
||||
QAction* debugActOpenDevices = new QAction("New D&evices Window", this);
|
||||
debugActOpenDevices->setShortcut(QKeySequence("Shift+Ctrl+D"));
|
||||
connect(debugActOpenDevices, SIGNAL(triggered()), this, SLOT(debugActOpenDevices()));
|
||||
connect(debugActOpenDevices, &QAction::triggered, this, &WindowQt::debugActOpenDevices);
|
||||
|
||||
QAction* dbgActRun = new QAction("Run", this);
|
||||
dbgActRun->setShortcut(Qt::Key_F5);
|
||||
connect(dbgActRun, SIGNAL(triggered()), this, SLOT(debugActRun()));
|
||||
connect(dbgActRun, &QAction::triggered, this, &WindowQt::debugActRun);
|
||||
|
||||
QAction* dbgActRunAndHide = new QAction("Run And Hide Debugger", this);
|
||||
dbgActRunAndHide->setShortcut(Qt::Key_F12);
|
||||
connect(dbgActRunAndHide, SIGNAL(triggered()), this, SLOT(debugActRunAndHide()));
|
||||
connect(dbgActRunAndHide, &QAction::triggered, this, &WindowQt::debugActRunAndHide);
|
||||
|
||||
QAction* dbgActRunToNextCpu = new QAction("Run to Next CPU", this);
|
||||
dbgActRunToNextCpu->setShortcut(Qt::Key_F6);
|
||||
connect(dbgActRunToNextCpu, SIGNAL(triggered()), this, SLOT(debugActRunToNextCpu()));
|
||||
connect(dbgActRunToNextCpu, &QAction::triggered, this, &WindowQt::debugActRunToNextCpu);
|
||||
|
||||
QAction* dbgActRunNextInt = new QAction("Run to Next Interrupt on This CPU", this);
|
||||
dbgActRunNextInt->setShortcut(Qt::Key_F7);
|
||||
connect(dbgActRunNextInt, SIGNAL(triggered()), this, SLOT(debugActRunNextInt()));
|
||||
connect(dbgActRunNextInt, &QAction::triggered, this, &WindowQt::debugActRunNextInt);
|
||||
|
||||
QAction* dbgActRunNextVBlank = new QAction("Run to Next VBlank", this);
|
||||
dbgActRunNextVBlank->setShortcut(Qt::Key_F8);
|
||||
connect(dbgActRunNextVBlank, SIGNAL(triggered()), this, SLOT(debugActRunNextVBlank()));
|
||||
connect(dbgActRunNextVBlank, &QAction::triggered, this, &WindowQt::debugActRunNextVBlank);
|
||||
|
||||
QAction* dbgActStepInto = new QAction("Step Into", this);
|
||||
dbgActStepInto->setShortcut(Qt::Key_F11);
|
||||
connect(dbgActStepInto, SIGNAL(triggered()), this, SLOT(debugActStepInto()));
|
||||
connect(dbgActStepInto, &QAction::triggered, this, &WindowQt::debugActStepInto);
|
||||
|
||||
QAction* dbgActStepOver = new QAction("Step Over", this);
|
||||
dbgActStepOver->setShortcut(Qt::Key_F10);
|
||||
connect(dbgActStepOver, SIGNAL(triggered()), this, SLOT(debugActStepOver()));
|
||||
connect(dbgActStepOver, &QAction::triggered, this, &WindowQt::debugActStepOver);
|
||||
|
||||
QAction* dbgActStepOut = new QAction("Step Out", this);
|
||||
dbgActStepOut->setShortcut(QKeySequence("Shift+F11"));
|
||||
connect(dbgActStepOut, SIGNAL(triggered()), this, SLOT(debugActStepOut()));
|
||||
connect(dbgActStepOut, &QAction::triggered, this, &WindowQt::debugActStepOut);
|
||||
|
||||
QAction* dbgActSoftReset = new QAction("Soft Reset", this);
|
||||
dbgActSoftReset->setShortcut(Qt::Key_F3);
|
||||
connect(dbgActSoftReset, SIGNAL(triggered()), this, SLOT(debugActSoftReset()));
|
||||
connect(dbgActSoftReset, &QAction::triggered, this, &WindowQt::debugActSoftReset);
|
||||
|
||||
QAction* dbgActHardReset = new QAction("Hard Reset", this);
|
||||
dbgActHardReset->setShortcut(QKeySequence("Shift+F3"));
|
||||
connect(dbgActHardReset, SIGNAL(triggered()), this, SLOT(debugActHardReset()));
|
||||
connect(dbgActHardReset, &QAction::triggered, this, &WindowQt::debugActHardReset);
|
||||
|
||||
QAction* dbgActClose = new QAction("Close &Window", this);
|
||||
dbgActClose->setShortcut(QKeySequence::Close);
|
||||
connect(dbgActClose, SIGNAL(triggered()), this, SLOT(debugActClose()));
|
||||
connect(dbgActClose, &QAction::triggered, this, &WindowQt::debugActClose);
|
||||
|
||||
QAction* dbgActQuit = new QAction("&Quit", this);
|
||||
dbgActQuit->setShortcut(QKeySequence::Quit);
|
||||
connect(dbgActQuit, SIGNAL(triggered()), this, SLOT(debugActQuit()));
|
||||
connect(dbgActQuit, &QAction::triggered, this, &WindowQt::debugActQuit);
|
||||
|
||||
// Construct the menu
|
||||
QMenu* debugMenu = menuBar()->addMenu("&Debug");
|
||||
|
@ -3,7 +3,7 @@
|
||||
#ifndef __DEBUG_QT_WINDOW_QT_H__
|
||||
#define __DEBUG_QT_WINDOW_QT_H__
|
||||
|
||||
#include <QtGui/QtGui>
|
||||
#include <QtWidgets/QMainWindow>
|
||||
|
||||
#include "emu.h"
|
||||
#include "config.h"
|
||||
|
Loading…
Reference in New Issue
Block a user