From 9485ca9d43dcab732325e4ba16194153ea293d4b Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Sat, 1 Aug 2015 20:41:27 +0200 Subject: [PATCH] Revert "debugqt: Port to Qt5 [O. Galibert]" Experience shows it's too early for that. I'll keep that in a corner and we'll see again later. --- .travis.yml | 12 +- scripts/src/osd/modules.lua | 21 ++- scripts/src/osd/sdl_cfg.lua | 7 +- src/osd/modules/debugger/debugqt.c | 5 +- .../modules/debugger/qt/breakpointswindow.c | 8 +- .../modules/debugger/qt/breakpointswindow.h | 2 + src/osd/modules/debugger/qt/dasmwindow.c | 20 +-- src/osd/modules/debugger/qt/dasmwindow.h | 3 +- src/osd/modules/debugger/qt/debuggerview.c | 131 ++++++++++++++++-- src/osd/modules/debugger/qt/debuggerview.h | 2 +- .../debugger/qt/deviceinformationwindow.c | 4 - .../debugger/qt/deviceinformationwindow.h | 2 + src/osd/modules/debugger/qt/deviceswindow.c | 4 +- src/osd/modules/debugger/qt/deviceswindow.h | 2 +- src/osd/modules/debugger/qt/logwindow.c | 2 - src/osd/modules/debugger/qt/logwindow.h | 2 + src/osd/modules/debugger/qt/mainwindow.c | 28 ++-- src/osd/modules/debugger/qt/mainwindow.h | 8 +- src/osd/modules/debugger/qt/memorywindow.c | 25 +--- src/osd/modules/debugger/qt/memorywindow.h | 3 +- src/osd/modules/debugger/qt/windowqt.c | 37 +++-- src/osd/modules/debugger/qt/windowqt.h | 2 +- 22 files changed, 201 insertions(+), 129 deletions(-) diff --git a/.travis.yml b/.travis.yml index 5594528efc0..80e3b739633 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,16 +6,16 @@ env: - SUBTARGET=arcade MAME=mamearcade64 - SUBTARGET=mess MAME=mess64 script: - - source /opt/qt55/bin/qt55-env.sh - if [ $CC == 'clang' ]; - then make -j2 linux_x64_clang OPT_FLAGS="-fPIC" && ./$MAME -validate; - else make -j2 OPTIMIZE=0 OPT_FLAGS="-fPIC" && ./$MAME -validate; + then make -j2 linux_x64_clang && ./$MAME -validate; + else make -j2 OPTIMIZE=0 && ./$MAME -validate; fi sudo: required before_install: - sudo add-apt-repository ppa:zoogie/sdl2-snapshots -y - - sudo apt-add-repository ppa:beineri/opt-qt55 -y + - sudo add-apt-repository ppa:shahar-evron/qt-backports -y - sudo apt-get update -qq - - sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libasound2-dev qt55base qt55tools + - sudo apt-get install -y libsdl2-dev libsdl2-ttf-dev libasound2-dev libqt4-dev libqt4-dev-bin notifications: - email: false + email: + - secure: "sK8JJcn1A0yLnbDJ/7vmJgESuXmP6D4QlvQvsYLp1xAx5eTVSJ5Z+GSXLBJ9CnoeJ5AlPVPX4rXdRV93UyxYlTh1O97x8VZZQtYBNPRjk/VCflsOOg7C+jcJKX/knMu/QG2MVEDE5G2b8mHSAgWljG/7Z2N0rYZlWppwklYafOkyW4uE0E7PU5XpmKim4ra6Y1eDSbap+XJiDwgUm9moDZrgAv7eom9NIWGNMRIozSRyR2IkYimlWE92FOy5PzLJtFGK02iumbYN+39mTux59v/h/m6HD6cD7Wf10Lco9+Fnmi9Bs+VvIReJIP9pDABRvJ3MkUV4I9BjUT9xk48lzxqjGtdfUwOMDOTABd4Pb/5cmNtyNUQIosy5oiplR6USBnqD7/gmJw+mfn3A+jdQHGne+akypwzUjSM6XrezjTiZLlDDG+QpA0kwAnxSXw8H2SpVyynMSn4nu0iZmOiOZMtFY0jKlt/W7OFC5wTuJFrky+bBGlVIv3KGOTJNJNgasXV4u0NXOjHyeBFpFYCIf0FZLfYyf7ITu94JxUzXGcVi5D0lBwvKY9HfJ4yJxciyfH6V7yU1+o23E/Meqe/tjt6dTW8DM5xIokrnusfzE5b0zw5GFyg54nbpazXpcPnrMdxhp+t2C7xKrxcZXhBECRYegj+Z86D9BJP/yum1YrQ=" diff --git a/scripts/src/osd/modules.lua b/scripts/src/osd/modules.lua index a356986bbab..bf6897a2585 100644 --- a/scripts/src/osd/modules.lua +++ b/scripts/src/osd/modules.lua @@ -142,7 +142,7 @@ function osdmodulesbuild() end MOC = _OPTIONS["QT_HOME"] .. "/bin/moc" else - MOCTST = backtick("which moc-qt5 2>/dev/null") + MOCTST = backtick("which moc-qt4 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 Qt5Widgets"), + backtick("pkg-config --cflags QtGui"), } end end @@ -237,18 +237,16 @@ function osdmodulestargetconf() } links { "qtmain", - "Qt5Core", - "Qt5Gui", - "Qt5Widgets", + "QtGui4", + "QtCore4", } elseif _OPTIONS["targetos"]=="macosx" then linkoptions { "-F" .. backtick("qmake -query QT_INSTALL_LIBS"), } links { - "Qt5Core.framework", - "Qt5Gui.framework", - "Qt5Widgets.framework", + "QtCore.framework", + "QtGui.framework", } else if _OPTIONS["QT_HOME"]~=nil then @@ -256,12 +254,11 @@ function osdmodulestargetconf() "-L" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"), } links { - "Qt5Core", - "Qt5Gui", - "Qt5Widgets", + "QtGui", + "QtCore", } else - local str = backtick("pkg-config --libs Qt5Widgets") + local str = backtick("pkg-config --libs QtGui") addlibfromstring(str) addoptionsfromstring(str) end diff --git a/scripts/src/osd/sdl_cfg.lua b/scripts/src/osd/sdl_cfg.lua index f97548d06c2..a204201d6f5 100644 --- a/scripts/src/osd/sdl_cfg.lua +++ b/scripts/src/osd/sdl_cfg.lua @@ -18,6 +18,11 @@ 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 { @@ -125,7 +130,7 @@ elseif _OPTIONS["targetos"]=="linux" then } else buildoptions { - backtick("pkg-config --cflags Qt5Widgets"), + backtick("pkg-config --cflags QtGui"), } end elseif _OPTIONS["targetos"]=="macosx" then diff --git a/src/osd/modules/debugger/debugqt.c b/src/osd/modules/debugger/debugqt.c index 1819eaa24dd..692e58d6551 100644 --- a/src/osd/modules/debugger/debugqt.c +++ b/src/osd/modules/debugger/debugqt.c @@ -8,7 +8,9 @@ // //============================================================ +#if (!defined(NO_MEM_TRACKING)) #define NO_MEM_TRACKING +#endif #include "debug_module.h" #include "modules/osdmodule.h" @@ -17,7 +19,8 @@ #include -#include +#include +#include #include "emu.h" #include "config.h" diff --git a/src/osd/modules/debugger/qt/breakpointswindow.c b/src/osd/modules/debugger/qt/breakpointswindow.c index e1d90146b18..d1aea9fbd46 100644 --- a/src/osd/modules/debugger/qt/breakpointswindow.c +++ b/src/osd/modules/debugger/qt/breakpointswindow.c @@ -2,12 +2,6 @@ // copyright-holders:Andrew Gardner #define NO_MEM_TRACKING -#include -#include -#include -#include -#include - #include "breakpointswindow.h" #include "debug/debugcon.h" @@ -60,7 +54,7 @@ BreakpointsWindow::BreakpointsWindow(running_machine* machine, QWidget* parent) typeBreak->setShortcut(QKeySequence("Ctrl+1")); typeWatch->setShortcut(QKeySequence("Ctrl+2")); typeBreak->setChecked(true); - connect(typeGroup, &QActionGroup::triggered, this, &BreakpointsWindow::typeChanged); + connect(typeGroup, SIGNAL(triggered(QAction*)), this, SLOT(typeChanged(QAction*))); // Assemble the options menu QMenu* optionsMenu = menuBar()->addMenu("&Options"); diff --git a/src/osd/modules/debugger/qt/breakpointswindow.h b/src/osd/modules/debugger/qt/breakpointswindow.h index 6c4335e334c..9a041f8de07 100644 --- a/src/osd/modules/debugger/qt/breakpointswindow.h +++ b/src/osd/modules/debugger/qt/breakpointswindow.h @@ -3,6 +3,8 @@ #ifndef __DEBUG_QT_BREAK_POINTS_WINDOW_H__ #define __DEBUG_QT_BREAK_POINTS_WINDOW_H__ +#include + #include "debuggerview.h" #include "windowqt.h" diff --git a/src/osd/modules/debugger/qt/dasmwindow.c b/src/osd/modules/debugger/qt/dasmwindow.c index 71b92c59ce4..14de9080876 100644 --- a/src/osd/modules/debugger/qt/dasmwindow.c +++ b/src/osd/modules/debugger/qt/dasmwindow.c @@ -2,12 +2,6 @@ // copyright-holders:Andrew Gardner #define NO_MEM_TRACKING -#include -#include -#include -#include -#include - #include "dasmwindow.h" #include "debug/debugcon.h" @@ -36,17 +30,17 @@ DasmWindow::DasmWindow(running_machine* machine, QWidget* parent) : // The input edit m_inputEdit = new QLineEdit(topSubFrame); - connect(m_inputEdit, &QLineEdit::returnPressed, this, &DasmWindow::expressionSubmitted); + connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(expressionSubmitted())); // The cpu combo box m_cpuComboBox = new QComboBox(topSubFrame); m_cpuComboBox->setObjectName("cpu"); m_cpuComboBox->setMinimumWidth(300); - connect(m_cpuComboBox, static_cast(&QComboBox::currentIndexChanged), this, &DasmWindow::cpuChanged); + connect(m_cpuComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(cpuChanged(int))); // The main disasm window m_dasmView = new DebuggerView(DVT_DISASSEMBLY, m_machine, this); - connect(m_dasmView, &DebuggerView::updated, this, &DasmWindow::dasmViewUpdated); + connect(m_dasmView, SIGNAL(updated()), this, SLOT(dasmViewUpdated())); // Force a recompute of the disassembly region downcast(m_dasmView->view())->set_expression("curpc"); @@ -83,9 +77,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, &QAction::triggered, this, &DasmWindow::toggleBreakpointAtCursor); - connect(m_breakpointEnableAct, &QAction::triggered, this, &DasmWindow::enableBreakpointAtCursor); - connect(m_runToCursorAct, &QAction::triggered, this, &DasmWindow::runToCursor); + 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))); // Right bar options QActionGroup* rightBarGroup = new QActionGroup(this); @@ -103,7 +97,7 @@ DasmWindow::DasmWindow(running_machine* machine, QWidget* parent) : rightActEncrypted->setShortcut(QKeySequence("Ctrl+E")); rightActComments->setShortcut(QKeySequence("Ctrl+C")); rightActRaw->setChecked(true); - connect(rightBarGroup, &QActionGroup::triggered, this, &DasmWindow::rightBarChanged); + connect(rightBarGroup, SIGNAL(triggered(QAction*)), this, SLOT(rightBarChanged(QAction*))); // Assemble the options menu QMenu* optionsMenu = menuBar()->addMenu("&Options"); diff --git a/src/osd/modules/debugger/qt/dasmwindow.h b/src/osd/modules/debugger/qt/dasmwindow.h index 44368c4e11f..9912841603a 100644 --- a/src/osd/modules/debugger/qt/dasmwindow.h +++ b/src/osd/modules/debugger/qt/dasmwindow.h @@ -3,8 +3,7 @@ #ifndef __DEBUG_QT_DASM_WINDOW_H__ #define __DEBUG_QT_DASM_WINDOW_H__ -#include -#include +#include #include "debuggerview.h" #include "windowqt.h" diff --git a/src/osd/modules/debugger/qt/debuggerview.c b/src/osd/modules/debugger/qt/debuggerview.c index c0cefdda759..d1be4815288 100644 --- a/src/osd/modules/debugger/qt/debuggerview.c +++ b/src/osd/modules/debugger/qt/debuggerview.c @@ -2,11 +2,6 @@ // copyright-holders:Andrew Gardner #define NO_MEM_TRACKING -#include -#include -#include -#include - #include "debuggerview.h" #include "modules/lib/osdobj_common.h" @@ -33,10 +28,10 @@ DebuggerView::DebuggerView(const debug_view_type& type, DebuggerView::debuggerViewUpdate, this); - connect(verticalScrollBar(), &QScrollBar::valueChanged, - this, &DebuggerView::verticalScrollSlot); - connect(horizontalScrollBar(), &QScrollBar::valueChanged, - this, &DebuggerView::horizontalScrollSlot); + connect(verticalScrollBar(), SIGNAL(valueChanged(int)), + this, SLOT(verticalScrollSlot(int))); + connect(horizontalScrollBar(), SIGNAL(valueChanged(int)), + this, SLOT(horizontalScrollSlot(int))); } @@ -46,12 +41,127 @@ 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.lineSpacing()); + const int fontHeight = MAX(1, actualFont.height()); m_view->set_visible_size(debug_view_xy(width()/fontWidth, height()/fontHeight)); @@ -162,6 +272,7 @@ void DebuggerView::paintEvent(QPaintEvent* event) } } } +#endif void DebuggerView::keyPressEvent(QKeyEvent* event) { diff --git a/src/osd/modules/debugger/qt/debuggerview.h b/src/osd/modules/debugger/qt/debuggerview.h index 7b1aed6fd2c..e064b86e9c1 100644 --- a/src/osd/modules/debugger/qt/debuggerview.h +++ b/src/osd/modules/debugger/qt/debuggerview.h @@ -3,7 +3,7 @@ #ifndef __DEBUG_QT_DEBUGGER_VIEW_H__ #define __DEBUG_QT_DEBUGGER_VIEW_H__ -#include +#include #include "debug/debugvw.h" diff --git a/src/osd/modules/debugger/qt/deviceinformationwindow.c b/src/osd/modules/debugger/qt/deviceinformationwindow.c index ca6913f0b06..303dc650b70 100644 --- a/src/osd/modules/debugger/qt/deviceinformationwindow.c +++ b/src/osd/modules/debugger/qt/deviceinformationwindow.c @@ -2,10 +2,6 @@ // copyright-holders:Andrew Gardner #define NO_MEM_TRACKING -#include -#include -#include - #include "deviceinformationwindow.h" diff --git a/src/osd/modules/debugger/qt/deviceinformationwindow.h b/src/osd/modules/debugger/qt/deviceinformationwindow.h index b0d9898488a..6ea38de60c3 100644 --- a/src/osd/modules/debugger/qt/deviceinformationwindow.h +++ b/src/osd/modules/debugger/qt/deviceinformationwindow.h @@ -3,6 +3,8 @@ #ifndef __DEBUG_QT_DEVICE_INFORMATION_WINDOW_H__ #define __DEBUG_QT_DEVICE_INFORMATION_WINDOW_H__ +#include + #include "windowqt.h" //============================================================ diff --git a/src/osd/modules/debugger/qt/deviceswindow.c b/src/osd/modules/debugger/qt/deviceswindow.c index 75d84f4bc7e..0a71fd8fbdf 100644 --- a/src/osd/modules/debugger/qt/deviceswindow.c +++ b/src/osd/modules/debugger/qt/deviceswindow.c @@ -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(), &QItemSelectionModel::currentRowChanged, this, &DevicesWindow::currentRowChanged); - connect(m_devices_view, &QTreeView::activated, this, &DevicesWindow::activated); + 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 &))); setCentralWidget(m_devices_view); } diff --git a/src/osd/modules/debugger/qt/deviceswindow.h b/src/osd/modules/debugger/qt/deviceswindow.h index 13965b9dce5..614dd11edde 100644 --- a/src/osd/modules/debugger/qt/deviceswindow.h +++ b/src/osd/modules/debugger/qt/deviceswindow.h @@ -3,7 +3,7 @@ #ifndef __DEBUG_QT_DEVICES_WINDOW_H__ #define __DEBUG_QT_DEVICES_WINDOW_H__ -#include +#include #include "windowqt.h" diff --git a/src/osd/modules/debugger/qt/logwindow.c b/src/osd/modules/debugger/qt/logwindow.c index 38cb33d0f0b..95b379f9c28 100644 --- a/src/osd/modules/debugger/qt/logwindow.c +++ b/src/osd/modules/debugger/qt/logwindow.c @@ -2,8 +2,6 @@ // copyright-holders:Andrew Gardner #define NO_MEM_TRACKING -#include - #include "logwindow.h" #include "debug/debugcon.h" diff --git a/src/osd/modules/debugger/qt/logwindow.h b/src/osd/modules/debugger/qt/logwindow.h index a406cfb8eb3..97aa81c41a1 100644 --- a/src/osd/modules/debugger/qt/logwindow.h +++ b/src/osd/modules/debugger/qt/logwindow.h @@ -3,6 +3,8 @@ #ifndef __DEBUG_QT_LOG_WINDOW_H__ #define __DEBUG_QT_LOG_WINDOW_H__ +#include + #include "debuggerview.h" #include "windowqt.h" diff --git a/src/osd/modules/debugger/qt/mainwindow.c b/src/osd/modules/debugger/qt/mainwindow.c index 12b6a09dd77..bb4db219912 100644 --- a/src/osd/modules/debugger/qt/mainwindow.c +++ b/src/osd/modules/debugger/qt/mainwindow.c @@ -2,14 +2,6 @@ // copyright-holders:Andrew Gardner #define NO_MEM_TRACKING -#include -#include -#include -#include -#include -#include -#include - #include "mainwindow.h" #include "debug/debugcon.h" @@ -31,7 +23,7 @@ MainWindow::MainWindow(running_machine* machine, QWidget* parent) : // The input line m_inputEdit = new QLineEdit(mainWindowFrame); - connect(m_inputEdit, &QLineEdit::returnPressed, this, &MainWindow::executeCommandSlot); + connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(executeCommand())); m_inputEdit->installEventFilter(this); @@ -60,9 +52,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, &QAction::triggered, this, &MainWindow::toggleBreakpointAtCursor); - connect(m_breakpointEnableAct, &QAction::triggered, this, &MainWindow::enableBreakpointAtCursor); - connect(m_runToCursorAct, &QAction::triggered, this, &MainWindow::runToCursor); + 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))); // Right bar options QActionGroup* rightBarGroup = new QActionGroup(this); @@ -80,7 +72,7 @@ MainWindow::MainWindow(running_machine* machine, QWidget* parent) : rightActEncrypted->setShortcut(QKeySequence("Ctrl+E")); rightActComments->setShortcut(QKeySequence("Ctrl+C")); rightActRaw->setChecked(true); - connect(rightBarGroup, &QActionGroup::triggered, this, &MainWindow::rightBarChanged); + connect(rightBarGroup, SIGNAL(triggered(QAction*)), this, SLOT(rightBarChanged(QAction*))); // Assemble the options menu QMenu* optionsMenu = menuBar()->addMenu("&Options"); @@ -123,7 +115,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(), &DebuggerView::updated, this, &MainWindow::dasmViewUpdated); + connect(m_dasmFrame->view(), SIGNAL(updated()), this, SLOT(dasmViewUpdated())); addDockWidget(Qt::TopDockWidgetArea, dasmDock); dockMenu->addAction(dasmDock->toggleViewAction()); @@ -308,10 +300,6 @@ void MainWindow::rightBarChanged(QAction* changedTo) m_dasmFrame->view()->viewport()->update(); } -void MainWindow::executeCommandSlot() -{ - executeCommand(true); -} void MainWindow::executeCommand(bool withClear) { @@ -489,8 +477,8 @@ void MainWindow::createImagesMenu() mountAct->setData(QVariant(interfaceIndex)); unmountAct->setObjectName("unmount"); unmountAct->setData(QVariant(interfaceIndex)); - connect(mountAct, &QAction::triggered, this, &MainWindow::mountImage); - connect(unmountAct, &QAction::triggered, this, &MainWindow::unmountImage); + connect(mountAct, SIGNAL(triggered(bool)), this, SLOT(mountImage(bool))); + connect(unmountAct, SIGNAL(triggered(bool)), this, SLOT(unmountImage(bool))); if (!img->exists()) unmountAct->setEnabled(false); diff --git a/src/osd/modules/debugger/qt/mainwindow.h b/src/osd/modules/debugger/qt/mainwindow.h index 4a93608772f..53a9969baa2 100644 --- a/src/osd/modules/debugger/qt/mainwindow.h +++ b/src/osd/modules/debugger/qt/mainwindow.h @@ -3,12 +3,9 @@ #ifndef __DEBUG_QT_MAIN_WINDOW_H__ #define __DEBUG_QT_MAIN_WINDOW_H__ +#include #include -#include -#include -#include - #include "debug/dvdisasm.h" #include "debuggerview.h" @@ -46,7 +43,7 @@ private slots: void runToCursor(bool changedTo); void rightBarChanged(QAction* changedTo); - void executeCommandSlot(); + void executeCommand(bool withClear=true); void mountImage(bool changedTo); void unmountImage(bool changedTo); @@ -75,7 +72,6 @@ private: int m_historyIndex; std::vector m_inputHistory; void addToHistory(const QString& command); - void executeCommand(bool withClear); }; diff --git a/src/osd/modules/debugger/qt/memorywindow.c b/src/osd/modules/debugger/qt/memorywindow.c index 90b7f703472..3aee20a0cd0 100644 --- a/src/osd/modules/debugger/qt/memorywindow.c +++ b/src/osd/modules/debugger/qt/memorywindow.c @@ -2,17 +2,6 @@ // copyright-holders:Andrew Gardner #define NO_MEM_TRACKING -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - #include "memorywindow.h" #include "debug/dvmemory.h" @@ -41,13 +30,13 @@ MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) : // The input edit m_inputEdit = new QLineEdit(topSubFrame); - connect(m_inputEdit, &QLineEdit::returnPressed, this, &MemoryWindow::expressionSubmitted); + connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(expressionSubmitted())); // The memory space combo box m_memoryComboBox = new QComboBox(topSubFrame); m_memoryComboBox->setObjectName("memoryregion"); m_memoryComboBox->setMinimumWidth(300); - connect(m_memoryComboBox, static_cast(&QComboBox::currentIndexChanged), this, &MemoryWindow::memoryRegionChanged); + connect(m_memoryComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(memoryRegionChanged(int))); // The main memory window m_memTable = new DebuggerMemView(DVT_MEMORY, m_machine, this); @@ -89,7 +78,7 @@ MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) : chunkActTwo->setShortcut(QKeySequence("Ctrl+2")); chunkActFour->setShortcut(QKeySequence("Ctrl+4")); chunkActOne->setChecked(true); - connect(chunkGroup, &QActionGroup::triggered, this, &MemoryWindow::chunkChanged); + connect(chunkGroup, SIGNAL(triggered(QAction*)), this, SLOT(chunkChanged(QAction*))); // Create a address display group QActionGroup* addressGroup = new QActionGroup(this); @@ -103,22 +92,22 @@ MemoryWindow::MemoryWindow(running_machine* machine, QWidget* parent) : addressActLogical->setShortcut(QKeySequence("Ctrl+G")); addressActPhysical->setShortcut(QKeySequence("Ctrl+Y")); addressActLogical->setChecked(true); - connect(addressGroup, &QActionGroup::triggered, this, &MemoryWindow::addressChanged); + connect(addressGroup, SIGNAL(triggered(QAction*)), this, SLOT(addressChanged(QAction*))); // 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, &QAction::toggled, this, &MemoryWindow::reverseChanged); + connect(reverseAct, SIGNAL(toggled(bool)), this, SLOT(reverseChanged(bool))); // 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, &QAction::triggered, this, &MemoryWindow::increaseBytesPerLine); - connect(decreaseBplAct, &QAction::triggered, this, &MemoryWindow::decreaseBytesPerLine); + connect(increaseBplAct, SIGNAL(triggered(bool)), this, SLOT(increaseBytesPerLine(bool))); + connect(decreaseBplAct, SIGNAL(triggered(bool)), this, SLOT(decreaseBytesPerLine(bool))); // Assemble the options menu QMenu* optionsMenu = menuBar()->addMenu("&Options"); diff --git a/src/osd/modules/debugger/qt/memorywindow.h b/src/osd/modules/debugger/qt/memorywindow.h index f8c18d0fb32..5233c619d19 100644 --- a/src/osd/modules/debugger/qt/memorywindow.h +++ b/src/osd/modules/debugger/qt/memorywindow.h @@ -3,8 +3,7 @@ #ifndef __DEBUG_QT_MEMORY_WINDOW_H__ #define __DEBUG_QT_MEMORY_WINDOW_H__ -#include -#include +#include #include "debuggerview.h" #include "windowqt.h" diff --git a/src/osd/modules/debugger/qt/windowqt.c b/src/osd/modules/debugger/qt/windowqt.c index 01b4983ec06..e455e586b00 100644 --- a/src/osd/modules/debugger/qt/windowqt.c +++ b/src/osd/modules/debugger/qt/windowqt.c @@ -2,9 +2,6 @@ // copyright-holders:Andrew Gardner #define NO_MEM_TRACKING -#include -#include - #include "windowqt.h" #include "logwindow.h" #include "dasmwindow.h" @@ -30,71 +27,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, &QAction::triggered, this, &WindowQt::debugActOpenMemory); + connect(debugActOpenMemory, SIGNAL(triggered()), this, SLOT(debugActOpenMemory())); QAction* debugActOpenDasm = new QAction("New &Dasm Window", this); debugActOpenDasm->setShortcut(QKeySequence("Ctrl+D")); - connect(debugActOpenDasm, &QAction::triggered, this, &WindowQt::debugActOpenDasm); + connect(debugActOpenDasm, SIGNAL(triggered()), this, SLOT(debugActOpenDasm())); QAction* debugActOpenLog = new QAction("New &Log Window", this); debugActOpenLog->setShortcut(QKeySequence("Ctrl+L")); - connect(debugActOpenLog, &QAction::triggered, this, &WindowQt::debugActOpenLog); + connect(debugActOpenLog, SIGNAL(triggered()), this, SLOT(debugActOpenLog())); QAction* debugActOpenPoints = new QAction("New &Break|Watchpoints Window", this); debugActOpenPoints->setShortcut(QKeySequence("Ctrl+B")); - connect(debugActOpenPoints, &QAction::triggered, this, &WindowQt::debugActOpenPoints); + connect(debugActOpenPoints, SIGNAL(triggered()), this, SLOT(debugActOpenPoints())); QAction* debugActOpenDevices = new QAction("New D&evices Window", this); debugActOpenDevices->setShortcut(QKeySequence("Shift+Ctrl+D")); - connect(debugActOpenDevices, &QAction::triggered, this, &WindowQt::debugActOpenDevices); + connect(debugActOpenDevices, SIGNAL(triggered()), this, SLOT(debugActOpenDevices())); QAction* dbgActRun = new QAction("Run", this); dbgActRun->setShortcut(Qt::Key_F5); - connect(dbgActRun, &QAction::triggered, this, &WindowQt::debugActRun); + connect(dbgActRun, SIGNAL(triggered()), this, SLOT(debugActRun())); QAction* dbgActRunAndHide = new QAction("Run And Hide Debugger", this); dbgActRunAndHide->setShortcut(Qt::Key_F12); - connect(dbgActRunAndHide, &QAction::triggered, this, &WindowQt::debugActRunAndHide); + connect(dbgActRunAndHide, SIGNAL(triggered()), this, SLOT(debugActRunAndHide())); QAction* dbgActRunToNextCpu = new QAction("Run to Next CPU", this); dbgActRunToNextCpu->setShortcut(Qt::Key_F6); - connect(dbgActRunToNextCpu, &QAction::triggered, this, &WindowQt::debugActRunToNextCpu); + connect(dbgActRunToNextCpu, SIGNAL(triggered()), this, SLOT(debugActRunToNextCpu())); QAction* dbgActRunNextInt = new QAction("Run to Next Interrupt on This CPU", this); dbgActRunNextInt->setShortcut(Qt::Key_F7); - connect(dbgActRunNextInt, &QAction::triggered, this, &WindowQt::debugActRunNextInt); + connect(dbgActRunNextInt, SIGNAL(triggered()), this, SLOT(debugActRunNextInt())); QAction* dbgActRunNextVBlank = new QAction("Run to Next VBlank", this); dbgActRunNextVBlank->setShortcut(Qt::Key_F8); - connect(dbgActRunNextVBlank, &QAction::triggered, this, &WindowQt::debugActRunNextVBlank); + connect(dbgActRunNextVBlank, SIGNAL(triggered()), this, SLOT(debugActRunNextVBlank())); QAction* dbgActStepInto = new QAction("Step Into", this); dbgActStepInto->setShortcut(Qt::Key_F11); - connect(dbgActStepInto, &QAction::triggered, this, &WindowQt::debugActStepInto); + connect(dbgActStepInto, SIGNAL(triggered()), this, SLOT(debugActStepInto())); QAction* dbgActStepOver = new QAction("Step Over", this); dbgActStepOver->setShortcut(Qt::Key_F10); - connect(dbgActStepOver, &QAction::triggered, this, &WindowQt::debugActStepOver); + connect(dbgActStepOver, SIGNAL(triggered()), this, SLOT(debugActStepOver())); QAction* dbgActStepOut = new QAction("Step Out", this); dbgActStepOut->setShortcut(QKeySequence("Shift+F11")); - connect(dbgActStepOut, &QAction::triggered, this, &WindowQt::debugActStepOut); + connect(dbgActStepOut, SIGNAL(triggered()), this, SLOT(debugActStepOut())); QAction* dbgActSoftReset = new QAction("Soft Reset", this); dbgActSoftReset->setShortcut(Qt::Key_F3); - connect(dbgActSoftReset, &QAction::triggered, this, &WindowQt::debugActSoftReset); + connect(dbgActSoftReset, SIGNAL(triggered()), this, SLOT(debugActSoftReset())); QAction* dbgActHardReset = new QAction("Hard Reset", this); dbgActHardReset->setShortcut(QKeySequence("Shift+F3")); - connect(dbgActHardReset, &QAction::triggered, this, &WindowQt::debugActHardReset); + connect(dbgActHardReset, SIGNAL(triggered()), this, SLOT(debugActHardReset())); QAction* dbgActClose = new QAction("Close &Window", this); dbgActClose->setShortcut(QKeySequence::Close); - connect(dbgActClose, &QAction::triggered, this, &WindowQt::debugActClose); + connect(dbgActClose, SIGNAL(triggered()), this, SLOT(debugActClose())); QAction* dbgActQuit = new QAction("&Quit", this); dbgActQuit->setShortcut(QKeySequence::Quit); - connect(dbgActQuit, &QAction::triggered, this, &WindowQt::debugActQuit); + connect(dbgActQuit, SIGNAL(triggered()), this, SLOT(debugActQuit())); // Construct the menu QMenu* debugMenu = menuBar()->addMenu("&Debug"); diff --git a/src/osd/modules/debugger/qt/windowqt.h b/src/osd/modules/debugger/qt/windowqt.h index e2e334792b2..5b16b47463f 100644 --- a/src/osd/modules/debugger/qt/windowqt.h +++ b/src/osd/modules/debugger/qt/windowqt.h @@ -3,7 +3,7 @@ #ifndef __DEBUG_QT_WINDOW_QT_H__ #define __DEBUG_QT_WINDOW_QT_H__ -#include +#include #include "emu.h" #include "config.h"