Previous 199869 Revisions Next

r40042 Wednesday 29th July, 2015 at 09:19:43 UTC by Olivier Galibert
debugqt: Port to Qt5 [O. Galibert]
[scripts/src/osd]modules.lua sdl_cfg.lua
[src/osd/modules/debugger]debugqt.c
[src/osd/modules/debugger/qt]breakpointswindow.c breakpointswindow.h dasmwindow.c dasmwindow.h debuggerview.c debuggerview.h deviceinformationwindow.c deviceinformationwindow.h deviceswindow.c deviceswindow.h logwindow.c logwindow.h mainwindow.c mainwindow.h memorywindow.c memorywindow.h windowqt.c windowqt.h

trunk/scripts/src/osd/modules.lua
r248553r248554
142142            end   
143143            MOC = _OPTIONS["QT_HOME"] .. "/bin/moc"
144144         else
145            MOCTST = backtick("which moc-qt4 2>/dev/null")         
145            MOCTST = backtick("which moc-qt5 2>/dev/null")
146146            if (MOCTST=='') then
147147               MOCTST = backtick("which moc 2>/dev/null")
148148            end
r248553r248554
185185            }
186186         else
187187            buildoptions {
188               backtick("pkg-config --cflags QtGui"),
188               backtick("pkg-config --cflags Qt5Widgets"),
189189            }
190190         end
191191      end
r248553r248554
237237         }
238238         links {
239239            "qtmain",
240            "QtGui4",
241            "QtCore4",
240            "Qt5Core",
241            "Qt5Gui",
242            "Qt5Widgets",
242243         }
243244      elseif _OPTIONS["targetos"]=="macosx" then
244245         linkoptions {
245246            "-F" .. backtick("qmake -query QT_INSTALL_LIBS"),
246247         }
247248         links {
248            "QtCore.framework",
249            "QtGui.framework",
249            "Qt5Core.framework",
250            "Qt5Gui.framework",
251            "Qt5Widgets.framework",
250252         }
251253      else
252254         if _OPTIONS["QT_HOME"]~=nil then
r248553r248554
254256               "-L" .. backtick(_OPTIONS["QT_HOME"] .. "/bin/qmake -query QT_INSTALL_LIBS"),
255257            }
256258            links {
257               "QtGui",
258               "QtCore",
259               "Qt5Core",
260               "Qt5Gui",
261               "Qt5Widgets",
259262            }
260263         else
261            local str = backtick("pkg-config --libs QtGui")
264            local str = backtick("pkg-config --libs Qt5Widgets")
262265            addlibfromstring(str)
263266            addoptionsfromstring(str)
264267         end
trunk/scripts/src/osd/sdl_cfg.lua
r248553r248554
1818   }
1919end
2020
21if _OPTIONS["SDL_INI_PATH"]~=nil then
22    defines {
23        "'INI_PATH=\"" .. _OPTIONS["SDL_INI_PATH"] .. "\"'",
24    }
25end
2621
2722if _OPTIONS["NO_X11"]=="1" then
2823   defines {
r248553r248554
130125      }
131126   else
132127      buildoptions {
133         backtick("pkg-config --cflags QtGui"),
128         backtick("pkg-config --cflags Qt5Widgets"),
134129      }
135130   end
136131elseif _OPTIONS["targetos"]=="macosx" then
trunk/src/osd/modules/debugger/debugqt.c
r248553r248554
88//
99//============================================================
1010
11#if (!defined(NO_MEM_TRACKING))
1211#define NO_MEM_TRACKING
13#endif
1412
1513#include "debug_module.h"
1614#include "modules/osdmodule.h"
r248553r248554
1917
2018#include <vector>
2119
22#include <QtGui/QtGui>
23#include <QtGui/QApplication>
20#include <QtWidgets/QApplication>
2421
2522#include "emu.h"
2623#include "config.h"
trunk/src/osd/modules/debugger/qt/breakpointswindow.c
r248553r248554
22// copyright-holders:Andrew Gardner
33#define NO_MEM_TRACKING
44
5#include <QtWidgets/QActionGroup>
6#include <QtWidgets/QHBoxLayout>
7#include <QtWidgets/QMenu>
8#include <QtWidgets/QMenuBar>
9#include <QtWidgets/QVBoxLayout>
10
511#include "breakpointswindow.h"
612
713#include "debug/debugcon.h"
r248553r248554
5460   typeBreak->setShortcut(QKeySequence("Ctrl+1"));
5561   typeWatch->setShortcut(QKeySequence("Ctrl+2"));
5662   typeBreak->setChecked(true);
57   connect(typeGroup, SIGNAL(triggered(QAction*)), this, SLOT(typeChanged(QAction*)));
63   connect(typeGroup, &QActionGroup::triggered, this, &BreakpointsWindow::typeChanged);
5864
5965   // Assemble the options menu
6066   QMenu* optionsMenu = menuBar()->addMenu("&Options");
trunk/src/osd/modules/debugger/qt/breakpointswindow.h
r248553r248554
33#ifndef __DEBUG_QT_BREAK_POINTS_WINDOW_H__
44#define __DEBUG_QT_BREAK_POINTS_WINDOW_H__
55
6#include <QtGui/QtGui>
7
86#include "debuggerview.h"
97#include "windowqt.h"
108
trunk/src/osd/modules/debugger/qt/dasmwindow.c
r248553r248554
22// copyright-holders:Andrew Gardner
33#define NO_MEM_TRACKING
44
5#include <QtWidgets/QHBoxLayout>
6#include <QtWidgets/QVBoxLayout>
7#include <QtWidgets/QAction>
8#include <QtWidgets/QMenu>
9#include <QtWidgets/QMenuBar>
10
511#include "dasmwindow.h"
612
713#include "debug/debugcon.h"
r248553r248554
3036
3137   // The input edit
3238   m_inputEdit = new QLineEdit(topSubFrame);
33   connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(expressionSubmitted()));
39   connect(m_inputEdit, &QLineEdit::returnPressed, this, &DasmWindow::expressionSubmitted);
3440
3541   // The cpu combo box
3642   m_cpuComboBox = new QComboBox(topSubFrame);
3743   m_cpuComboBox->setObjectName("cpu");
3844   m_cpuComboBox->setMinimumWidth(300);
39   connect(m_cpuComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(cpuChanged(int)));
45   connect(m_cpuComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &DasmWindow::cpuChanged);
4046
4147   // The main disasm window
4248   m_dasmView = new DebuggerView(DVT_DISASSEMBLY, m_machine, this);
43   connect(m_dasmView, SIGNAL(updated()), this, SLOT(dasmViewUpdated()));
49   connect(m_dasmView, &DebuggerView::updated, this, &DasmWindow::dasmViewUpdated);
4450
4551   // Force a recompute of the disassembly region
4652   downcast<debug_view_disasm*>(m_dasmView->view())->set_expression("curpc");
r248553r248554
7783   m_breakpointToggleAct->setShortcut(Qt::Key_F9);
7884   m_breakpointEnableAct->setShortcut(Qt::SHIFT + Qt::Key_F9);
7985   m_runToCursorAct->setShortcut(Qt::Key_F4);
80   connect(m_breakpointToggleAct, SIGNAL(triggered(bool)), this, SLOT(toggleBreakpointAtCursor(bool)));
81   connect(m_breakpointEnableAct, SIGNAL(triggered(bool)), this, SLOT(enableBreakpointAtCursor(bool)));
82   connect(m_runToCursorAct, SIGNAL(triggered(bool)), this, SLOT(runToCursor(bool)));
86   connect(m_breakpointToggleAct, &QAction::triggered, this, &DasmWindow::toggleBreakpointAtCursor);
87   connect(m_breakpointEnableAct, &QAction::triggered, this, &DasmWindow::enableBreakpointAtCursor);
88   connect(m_runToCursorAct, &QAction::triggered, this, &DasmWindow::runToCursor);
8389
8490   // Right bar options
8591   QActionGroup* rightBarGroup = new QActionGroup(this);
r248553r248554
97103   rightActEncrypted->setShortcut(QKeySequence("Ctrl+E"));
98104   rightActComments->setShortcut(QKeySequence("Ctrl+C"));
99105   rightActRaw->setChecked(true);
100   connect(rightBarGroup, SIGNAL(triggered(QAction*)), this, SLOT(rightBarChanged(QAction*)));
106   connect(rightBarGroup, &QActionGroup::triggered, this, &DasmWindow::rightBarChanged);
101107
102108   // Assemble the options menu
103109   QMenu* optionsMenu = menuBar()->addMenu("&Options");
trunk/src/osd/modules/debugger/qt/dasmwindow.h
r248553r248554
33#ifndef __DEBUG_QT_DASM_WINDOW_H__
44#define __DEBUG_QT_DASM_WINDOW_H__
55
6#include <QtGui/QtGui>
6#include <QtWidgets/QLineEdit>
7#include <QtWidgets/QComboBox>
78
89#include "debuggerview.h"
910#include "windowqt.h"
trunk/src/osd/modules/debugger/qt/debuggerview.c
r248553r248554
22// copyright-holders:Andrew Gardner
33#define NO_MEM_TRACKING
44
5#include <QtWidgets/QScrollBar>
6#include <QtWidgets/QApplication>
7#include <QtGui/QPainter>
8#include <QtGui/QKeyEvent>
9
510#include "debuggerview.h"
611
712#include "modules/lib/osdobj_common.h"
r248553r248554
2833                                    DebuggerView::debuggerViewUpdate,
2934                                    this);
3035
31   connect(verticalScrollBar(), SIGNAL(valueChanged(int)),
32         this, SLOT(verticalScrollSlot(int)));
33   connect(horizontalScrollBar(), SIGNAL(valueChanged(int)),
34         this, SLOT(horizontalScrollSlot(int)));
36   connect(verticalScrollBar(), &QScrollBar::valueChanged,
37         this, &DebuggerView::verticalScrollSlot);
38   connect(horizontalScrollBar(), &QScrollBar::valueChanged,
39         this, &DebuggerView::horizontalScrollSlot);
3540}
3641
3742
r248553r248554
4146      m_machine->debug_view().free_view(*m_view);
4247}
4348
44// TODO: remove this version no later than January 1, 2015
45#if QT_VERSION < QT_VERSION_CHECK(4, 7, 0)
4649void DebuggerView::paintEvent(QPaintEvent* event)
4750{
4851   // Tell the MAME debug view how much real estate is available
4952   QFontMetrics actualFont = fontMetrics();
50   const int fontWidth = MAX(1, actualFont.width('_'));
51   const int fontHeight = MAX(1, actualFont.height());
52   m_view->set_visible_size(debug_view_xy(width()/fontWidth, height()/fontHeight));
53
54
55   // Handle the scroll bars
56   const int horizontalScrollCharDiff = m_view->total_size().x - m_view->visible_size().x;
57   const int horizontalScrollSize = horizontalScrollCharDiff < 0 ? 0 : horizontalScrollCharDiff;
58   horizontalScrollBar()->setRange(0, horizontalScrollSize);
59
60   // If the horizontal scroll bar appears, make sure to adjust the vertical scrollbar accordingly
61   const int verticalScrollAdjust = horizontalScrollSize > 0 ? 1 : 0;
62
63   const int verticalScrollCharDiff = m_view->total_size().y - m_view->visible_size().y;
64   const int verticalScrollSize = verticalScrollCharDiff < 0 ? 0 : verticalScrollCharDiff+verticalScrollAdjust;
65   bool atEnd = false;
66   if (verticalScrollBar()->value() == verticalScrollBar()->maximum())
67   {
68      atEnd = true;
69   }
70   verticalScrollBar()->setRange(0, verticalScrollSize);
71   if (m_preferBottom && atEnd)
72   {
73      verticalScrollBar()->setValue(verticalScrollSize);
74   }
75
76
77   // Draw the viewport widget
78   QPainter painter(viewport());
79   painter.fillRect(0, 0, width(), height(), QBrush(Qt::white));
80   painter.setBackgroundMode(Qt::OpaqueMode);
81   painter.setBackground(QColor(255,255,255));
82
83   // Background control
84   QBrush bgBrush;
85   bgBrush.setStyle(Qt::SolidPattern);
86   painter.setPen(QPen(QColor(0,0,0)));
87
88   size_t viewDataOffset = 0;
89   const debug_view_xy& visibleCharDims = m_view->visible_size();
90   for (int y = 0; y < visibleCharDims.y; y++)
91   {
92      for (int x = 0; x < visibleCharDims.x; x++)
93      {
94         const unsigned char textAttr = m_view->viewdata()[viewDataOffset].attrib;
95
96         if (x == 0 || textAttr != m_view->viewdata()[viewDataOffset-1].attrib)
97         {
98            // Text color handling
99            QColor fgColor(0,0,0);
100            QColor bgColor(255,255,255);
101
102            if(textAttr & DCA_VISITED)
103            {
104               bgColor.setRgb(0xc6, 0xe2, 0xff);
105            }
106            if(textAttr & DCA_ANCILLARY)
107            {
108               bgColor.setRgb(0xe0, 0xe0, 0xe0);
109            }
110            if(textAttr & DCA_SELECTED)
111            {
112               bgColor.setRgb(0xff, 0x80, 0x80);
113            }
114            if(textAttr & DCA_CURRENT)
115            {
116               bgColor.setRgb(0xff, 0xff, 0x00);
117            }
118            if ((textAttr & DCA_SELECTED) && (textAttr & DCA_CURRENT))
119            {
120               bgColor.setRgb(0xff,0xc0,0x80);
121            }
122            if(textAttr & DCA_CHANGED)
123            {
124               fgColor.setRgb(0xff, 0x00, 0x00);
125            }
126            if(textAttr & DCA_INVALID)
127            {
128               fgColor.setRgb(0x00, 0x00, 0xff);
129            }
130            if(textAttr & DCA_DISABLED)
131            {
132               fgColor.setRgb((fgColor.red()   + bgColor.red())   >> 1,
133                           (fgColor.green() + bgColor.green()) >> 1,
134                           (fgColor.blue()  + bgColor.blue())  >> 1);
135            }
136            if(textAttr & DCA_COMMENT)
137            {
138               fgColor.setRgb(0x00, 0x80, 0x00);
139            }
140
141            bgBrush.setColor(bgColor);
142            painter.setBackground(bgBrush);
143            painter.setPen(QPen(fgColor));
144         }
145
146         // Your character is not guaranteed to take up the entire fontWidth x fontHeight, so fill before.
147         painter.fillRect(x*fontWidth, y*fontHeight, fontWidth, fontHeight, bgBrush);
148
149         // There is a touchy interplay between font height, drawing difference, visible position, etc
150         // Fonts don't get drawn "down and to the left" like boxes, so some wiggling is needed.
151         painter.drawText(x*fontWidth,
152                        (y*fontHeight + (fontHeight*0.80)),
153                        QString(m_view->viewdata()[viewDataOffset].byte));
154         viewDataOffset++;
155      }
156   }
157}
158#else
159void DebuggerView::paintEvent(QPaintEvent* event)
160{
161   // Tell the MAME debug view how much real estate is available
162   QFontMetrics actualFont = fontMetrics();
16353   const double fontWidth = actualFont.width(QString(100, '_')) / 100.;
164   const int fontHeight = MAX(1, actualFont.height());
54   const int fontHeight = MAX(1, actualFont.lineSpacing());
16555   m_view->set_visible_size(debug_view_xy(width()/fontWidth, height()/fontHeight));
16656
16757
r248553r248554
272162      }
273163   }
274164}
275#endif
276165
277166void DebuggerView::keyPressEvent(QKeyEvent* event)
278167{
trunk/src/osd/modules/debugger/qt/debuggerview.h
r248553r248554
33#ifndef __DEBUG_QT_DEBUGGER_VIEW_H__
44#define __DEBUG_QT_DEBUGGER_VIEW_H__
55
6#include <QtGui/QtGui>
6#include <QtWidgets/QAbstractScrollArea>
77
88#include "debug/debugvw.h"
99
trunk/src/osd/modules/debugger/qt/deviceinformationwindow.c
r248553r248554
22// copyright-holders:Andrew Gardner
33#define NO_MEM_TRACKING
44
5#include <QtWidgets/QFrame>
6#include <QtWidgets/QLabel>
7#include <QtWidgets/QVBoxLayout>
8
59#include "deviceinformationwindow.h"
610
711
trunk/src/osd/modules/debugger/qt/deviceinformationwindow.h
r248553r248554
33#ifndef __DEBUG_QT_DEVICE_INFORMATION_WINDOW_H__
44#define __DEBUG_QT_DEVICE_INFORMATION_WINDOW_H__
55
6#include <QtGui/QtGui>
7
86#include "windowqt.h"
97
108//============================================================
trunk/src/osd/modules/debugger/qt/deviceswindow.c
r248553r248554
128128   m_devices_view->setModel(&m_devices_model);
129129   m_devices_view->expandAll();
130130   m_devices_view->resizeColumnToContents(0);
131   connect(m_devices_view->selectionModel(), SIGNAL(currentRowChanged(const QModelIndex &,const QModelIndex &)), this, SLOT(currentRowChanged(const QModelIndex &,const QModelIndex &)));
132   connect(m_devices_view, SIGNAL(activated(const QModelIndex &)), this, SLOT(activated(const QModelIndex &)));
131   connect(m_devices_view->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &DevicesWindow::currentRowChanged);
132   connect(m_devices_view, &QTreeView::activated, this, &DevicesWindow::activated);
133133   setCentralWidget(m_devices_view);
134134}
135135
trunk/src/osd/modules/debugger/qt/deviceswindow.h
r248553r248554
33#ifndef __DEBUG_QT_DEVICES_WINDOW_H__
44#define __DEBUG_QT_DEVICES_WINDOW_H__
55
6#include <QtGui/QtGui>
6#include <QtWidgets/QTreeView>
77
88#include "windowqt.h"
99
trunk/src/osd/modules/debugger/qt/logwindow.c
r248553r248554
22// copyright-holders:Andrew Gardner
33#define NO_MEM_TRACKING
44
5#include <QtWidgets/QVBoxLayout>
6
57#include "logwindow.h"
68
79#include "debug/debugcon.h"
trunk/src/osd/modules/debugger/qt/logwindow.h
r248553r248554
33#ifndef __DEBUG_QT_LOG_WINDOW_H__
44#define __DEBUG_QT_LOG_WINDOW_H__
55
6#include <QtGui/QtGui>
7
86#include "debuggerview.h"
97#include "windowqt.h"
108
trunk/src/osd/modules/debugger/qt/mainwindow.c
r248553r248554
22// copyright-holders:Andrew Gardner
33#define NO_MEM_TRACKING
44
5#include <QtWidgets/QAction>
6#include <QtWidgets/QMenu>
7#include <QtWidgets/QMenuBar>
8#include <QtWidgets/QDockWidget>
9#include <QtWidgets/QScrollBar>
10#include <QtWidgets/QFileDialog>
11#include <QtGui/QCloseEvent>
12
513#include "mainwindow.h"
614
715#include "debug/debugcon.h"
r248553r248554
2331
2432   // The input line
2533   m_inputEdit = new QLineEdit(mainWindowFrame);
26   connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(executeCommand()));
34   connect(m_inputEdit, &QLineEdit::returnPressed, this, &MainWindow::executeCommandSlot);
2735   m_inputEdit->installEventFilter(this);
2836
2937
r248553r248554
5260   m_breakpointToggleAct->setShortcut(Qt::Key_F9);
5361   m_breakpointEnableAct->setShortcut(Qt::SHIFT + Qt::Key_F9);
5462   m_runToCursorAct->setShortcut(Qt::Key_F4);
55   connect(m_breakpointToggleAct, SIGNAL(triggered(bool)), this, SLOT(toggleBreakpointAtCursor(bool)));
56   connect(m_breakpointEnableAct, SIGNAL(triggered(bool)), this, SLOT(enableBreakpointAtCursor(bool)));
57   connect(m_runToCursorAct, SIGNAL(triggered(bool)), this, SLOT(runToCursor(bool)));
63   connect(m_breakpointToggleAct, &QAction::triggered, this, &MainWindow::toggleBreakpointAtCursor);
64   connect(m_breakpointEnableAct, &QAction::triggered, this, &MainWindow::enableBreakpointAtCursor);
65   connect(m_runToCursorAct, &QAction::triggered, this, &MainWindow::runToCursor);
5866
5967   // Right bar options
6068   QActionGroup* rightBarGroup = new QActionGroup(this);
r248553r248554
7280   rightActEncrypted->setShortcut(QKeySequence("Ctrl+E"));
7381   rightActComments->setShortcut(QKeySequence("Ctrl+C"));
7482   rightActRaw->setChecked(true);
75   connect(rightBarGroup, SIGNAL(triggered(QAction*)), this, SLOT(rightBarChanged(QAction*)));
83   connect(rightBarGroup, &QActionGroup::triggered, this, &MainWindow::rightBarChanged);
7684
7785   // Assemble the options menu
7886   QMenu* optionsMenu = menuBar()->addMenu("&Options");
r248553r248554
115123   dasmDock->setAllowedAreas(Qt::TopDockWidgetArea);
116124   m_dasmFrame = new DasmDockWidget(m_machine, dasmDock);
117125   dasmDock->setWidget(m_dasmFrame);
118   connect(m_dasmFrame->view(), SIGNAL(updated()), this, SLOT(dasmViewUpdated()));
126   connect(m_dasmFrame->view(), &DebuggerView::updated, this, &MainWindow::dasmViewUpdated);
119127
120128   addDockWidget(Qt::TopDockWidgetArea, dasmDock);
121129   dockMenu->addAction(dasmDock->toggleViewAction());
r248553r248554
300308   m_dasmFrame->view()->viewport()->update();
301309}
302310
311void MainWindow::executeCommandSlot()
312{
313   executeCommand(true);
314}
303315
304316void MainWindow::executeCommand(bool withClear)
305317{
r248553r248554
477489      mountAct->setData(QVariant(interfaceIndex));
478490      unmountAct->setObjectName("unmount");
479491      unmountAct->setData(QVariant(interfaceIndex));
480      connect(mountAct, SIGNAL(triggered(bool)), this, SLOT(mountImage(bool)));
481      connect(unmountAct, SIGNAL(triggered(bool)), this, SLOT(unmountImage(bool)));
492      connect(mountAct, &QAction::triggered, this, &MainWindow::mountImage);
493      connect(unmountAct, &QAction::triggered, this, &MainWindow::unmountImage);
482494
483495      if (!img->exists())
484496         unmountAct->setEnabled(false);
trunk/src/osd/modules/debugger/qt/mainwindow.h
r248553r248554
33#ifndef __DEBUG_QT_MAIN_WINDOW_H__
44#define __DEBUG_QT_MAIN_WINDOW_H__
55
6#include <QtGui/QtGui>
76#include <vector>
87
8#include <QtWidgets/QLineEdit>
9#include <QtWidgets/QVBoxLayout>
10#include <QtWidgets/QComboBox>
11
912#include "debug/dvdisasm.h"
1013
1114#include "debuggerview.h"
r248553r248554
4346   void runToCursor(bool changedTo);
4447   void rightBarChanged(QAction* changedTo);
4548
46   void executeCommand(bool withClear=true);
49   void executeCommandSlot();
4750
4851   void mountImage(bool changedTo);
4952   void unmountImage(bool changedTo);
r248553r248554
7275   int m_historyIndex;
7376   std::vector<QString> m_inputHistory;
7477   void addToHistory(const QString& command);
78   void executeCommand(bool withClear);
7579};
7680
7781
trunk/src/osd/modules/debugger/qt/memorywindow.c
r248553r248554
22// copyright-holders:Andrew Gardner
33#define NO_MEM_TRACKING
44
5#include <QtGui/QClipboard>
6#include <QtGui/QMouseEvent>
7#include <QtWidgets/QActionGroup>
8#include <QtWidgets/QApplication>
9#include <QtWidgets/QHBoxLayout>
10#include <QtWidgets/QMenu>
11#include <QtWidgets/QMenuBar>
12#include <QtWidgets/QScrollBar>
13#include <QtWidgets/QToolTip>
14#include <QtWidgets/QVBoxLayout>
15
516#include "memorywindow.h"
617
718#include "debug/dvmemory.h"
r248553r248554
3041
3142   // The input edit
3243   m_inputEdit = new QLineEdit(topSubFrame);
33   connect(m_inputEdit, SIGNAL(returnPressed()), this, SLOT(expressionSubmitted()));
44   connect(m_inputEdit, &QLineEdit::returnPressed, this, &MemoryWindow::expressionSubmitted);
3445
3546   // The memory space combo box
3647   m_memoryComboBox = new QComboBox(topSubFrame);
3748   m_memoryComboBox->setObjectName("memoryregion");
3849   m_memoryComboBox->setMinimumWidth(300);
39   connect(m_memoryComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(memoryRegionChanged(int)));
50   connect(m_memoryComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &MemoryWindow::memoryRegionChanged);
4051
4152   // The main memory window
4253   m_memTable = new DebuggerMemView(DVT_MEMORY, m_machine, this);
r248553r248554
7889   chunkActTwo->setShortcut(QKeySequence("Ctrl+2"));
7990   chunkActFour->setShortcut(QKeySequence("Ctrl+4"));
8091   chunkActOne->setChecked(true);
81   connect(chunkGroup, SIGNAL(triggered(QAction*)), this, SLOT(chunkChanged(QAction*)));
92   connect(chunkGroup, &QActionGroup::triggered, this, &MemoryWindow::chunkChanged);
8293
8394   // Create a address display group
8495   QActionGroup* addressGroup = new QActionGroup(this);
r248553r248554
92103   addressActLogical->setShortcut(QKeySequence("Ctrl+G"));
93104   addressActPhysical->setShortcut(QKeySequence("Ctrl+Y"));
94105   addressActLogical->setChecked(true);
95   connect(addressGroup, SIGNAL(triggered(QAction*)), this, SLOT(addressChanged(QAction*)));
106   connect(addressGroup, &QActionGroup::triggered, this, &MemoryWindow::addressChanged);
96107
97108   // Create a reverse view radio
98109   QAction* reverseAct = new QAction("Reverse View", this);
99110   reverseAct->setObjectName("reverse");
100111   reverseAct->setCheckable(true);
101112   reverseAct->setShortcut(QKeySequence("Ctrl+R"));
102   connect(reverseAct, SIGNAL(toggled(bool)), this, SLOT(reverseChanged(bool)));
113   connect(reverseAct, &QAction::toggled, this, &MemoryWindow::reverseChanged);
103114
104115   // Create increase and decrease bytes-per-line actions
105116   QAction* increaseBplAct = new QAction("Increase Bytes Per Line", this);
106117   QAction* decreaseBplAct = new QAction("Decrease Bytes Per Line", this);
107118   increaseBplAct->setShortcut(QKeySequence("Ctrl+P"));
108119   decreaseBplAct->setShortcut(QKeySequence("Ctrl+O"));
109   connect(increaseBplAct, SIGNAL(triggered(bool)), this, SLOT(increaseBytesPerLine(bool)));
110   connect(decreaseBplAct, SIGNAL(triggered(bool)), this, SLOT(decreaseBytesPerLine(bool)));
120   connect(increaseBplAct, &QAction::triggered, this, &MemoryWindow::increaseBytesPerLine);
121   connect(decreaseBplAct, &QAction::triggered, this, &MemoryWindow::decreaseBytesPerLine);
111122
112123   // Assemble the options menu
113124   QMenu* optionsMenu = menuBar()->addMenu("&Options");
trunk/src/osd/modules/debugger/qt/memorywindow.h
r248553r248554
33#ifndef __DEBUG_QT_MEMORY_WINDOW_H__
44#define __DEBUG_QT_MEMORY_WINDOW_H__
55
6#include <QtGui/QtGui>
6#include <QtWidgets/QLineEdit>
7#include <QtWidgets/QComboBox>
78
89#include "debuggerview.h"
910#include "windowqt.h"
trunk/src/osd/modules/debugger/qt/windowqt.c
r248553r248554
22// copyright-holders:Andrew Gardner
33#define NO_MEM_TRACKING
44
5#include <QtWidgets/QMenu>
6#include <QtWidgets/QMenuBar>
7
58#include "windowqt.h"
69#include "logwindow.h"
710#include "dasmwindow.h"
r248553r248554
2730   // The Debug menu bar
2831   QAction* debugActOpenMemory = new QAction("New &Memory Window", this);
2932   debugActOpenMemory->setShortcut(QKeySequence("Ctrl+M"));
30   connect(debugActOpenMemory, SIGNAL(triggered()), this, SLOT(debugActOpenMemory()));
33   connect(debugActOpenMemory, &QAction::triggered, this, &WindowQt::debugActOpenMemory);
3134
3235   QAction* debugActOpenDasm = new QAction("New &Dasm Window", this);
3336   debugActOpenDasm->setShortcut(QKeySequence("Ctrl+D"));
34   connect(debugActOpenDasm, SIGNAL(triggered()), this, SLOT(debugActOpenDasm()));
37   connect(debugActOpenDasm, &QAction::triggered, this, &WindowQt::debugActOpenDasm);
3538
3639   QAction* debugActOpenLog = new QAction("New &Log Window", this);
3740   debugActOpenLog->setShortcut(QKeySequence("Ctrl+L"));
38   connect(debugActOpenLog, SIGNAL(triggered()), this, SLOT(debugActOpenLog()));
41   connect(debugActOpenLog, &QAction::triggered, this, &WindowQt::debugActOpenLog);
3942
4043   QAction* debugActOpenPoints = new QAction("New &Break|Watchpoints Window", this);
4144   debugActOpenPoints->setShortcut(QKeySequence("Ctrl+B"));
42   connect(debugActOpenPoints, SIGNAL(triggered()), this, SLOT(debugActOpenPoints()));
45   connect(debugActOpenPoints, &QAction::triggered, this, &WindowQt::debugActOpenPoints);
4346
4447   QAction* debugActOpenDevices = new QAction("New D&evices Window", this);
4548   debugActOpenDevices->setShortcut(QKeySequence("Shift+Ctrl+D"));
46   connect(debugActOpenDevices, SIGNAL(triggered()), this, SLOT(debugActOpenDevices()));
49   connect(debugActOpenDevices, &QAction::triggered, this, &WindowQt::debugActOpenDevices);
4750
4851   QAction* dbgActRun = new QAction("Run", this);
4952   dbgActRun->setShortcut(Qt::Key_F5);
50   connect(dbgActRun, SIGNAL(triggered()), this, SLOT(debugActRun()));
53   connect(dbgActRun, &QAction::triggered, this, &WindowQt::debugActRun);
5154
5255   QAction* dbgActRunAndHide = new QAction("Run And Hide Debugger", this);
5356   dbgActRunAndHide->setShortcut(Qt::Key_F12);
54   connect(dbgActRunAndHide, SIGNAL(triggered()), this, SLOT(debugActRunAndHide()));
57   connect(dbgActRunAndHide, &QAction::triggered, this, &WindowQt::debugActRunAndHide);
5558
5659   QAction* dbgActRunToNextCpu = new QAction("Run to Next CPU", this);
5760   dbgActRunToNextCpu->setShortcut(Qt::Key_F6);
58   connect(dbgActRunToNextCpu, SIGNAL(triggered()), this, SLOT(debugActRunToNextCpu()));
61   connect(dbgActRunToNextCpu, &QAction::triggered, this, &WindowQt::debugActRunToNextCpu);
5962
6063   QAction* dbgActRunNextInt = new QAction("Run to Next Interrupt on This CPU", this);
6164   dbgActRunNextInt->setShortcut(Qt::Key_F7);
62   connect(dbgActRunNextInt, SIGNAL(triggered()), this, SLOT(debugActRunNextInt()));
65   connect(dbgActRunNextInt, &QAction::triggered, this, &WindowQt::debugActRunNextInt);
6366
6467   QAction* dbgActRunNextVBlank = new QAction("Run to Next VBlank", this);
6568   dbgActRunNextVBlank->setShortcut(Qt::Key_F8);
66   connect(dbgActRunNextVBlank, SIGNAL(triggered()), this, SLOT(debugActRunNextVBlank()));
69   connect(dbgActRunNextVBlank, &QAction::triggered, this, &WindowQt::debugActRunNextVBlank);
6770
6871   QAction* dbgActStepInto = new QAction("Step Into", this);
6972   dbgActStepInto->setShortcut(Qt::Key_F11);
70   connect(dbgActStepInto, SIGNAL(triggered()), this, SLOT(debugActStepInto()));
73   connect(dbgActStepInto, &QAction::triggered, this, &WindowQt::debugActStepInto);
7174
7275   QAction* dbgActStepOver = new QAction("Step Over", this);
7376   dbgActStepOver->setShortcut(Qt::Key_F10);
74   connect(dbgActStepOver, SIGNAL(triggered()), this, SLOT(debugActStepOver()));
77   connect(dbgActStepOver, &QAction::triggered, this, &WindowQt::debugActStepOver);
7578
7679   QAction* dbgActStepOut = new QAction("Step Out", this);
7780   dbgActStepOut->setShortcut(QKeySequence("Shift+F11"));
78   connect(dbgActStepOut, SIGNAL(triggered()), this, SLOT(debugActStepOut()));
81   connect(dbgActStepOut, &QAction::triggered, this, &WindowQt::debugActStepOut);
7982
8083   QAction* dbgActSoftReset = new QAction("Soft Reset", this);
8184   dbgActSoftReset->setShortcut(Qt::Key_F3);
82   connect(dbgActSoftReset, SIGNAL(triggered()), this, SLOT(debugActSoftReset()));
85   connect(dbgActSoftReset, &QAction::triggered, this, &WindowQt::debugActSoftReset);
8386
8487   QAction* dbgActHardReset = new QAction("Hard Reset", this);
8588   dbgActHardReset->setShortcut(QKeySequence("Shift+F3"));
86   connect(dbgActHardReset, SIGNAL(triggered()), this, SLOT(debugActHardReset()));
89   connect(dbgActHardReset, &QAction::triggered, this, &WindowQt::debugActHardReset);
8790
8891   QAction* dbgActClose = new QAction("Close &Window", this);
8992   dbgActClose->setShortcut(QKeySequence::Close);
90   connect(dbgActClose, SIGNAL(triggered()), this, SLOT(debugActClose()));
93   connect(dbgActClose, &QAction::triggered, this, &WindowQt::debugActClose);
9194
9295   QAction* dbgActQuit = new QAction("&Quit", this);
9396   dbgActQuit->setShortcut(QKeySequence::Quit);
94   connect(dbgActQuit, SIGNAL(triggered()), this, SLOT(debugActQuit()));
97   connect(dbgActQuit, &QAction::triggered, this, &WindowQt::debugActQuit);
9598
9699   // Construct the menu
97100   QMenu* debugMenu = menuBar()->addMenu("&Debug");
trunk/src/osd/modules/debugger/qt/windowqt.h
r248553r248554
33#ifndef __DEBUG_QT_WINDOW_QT_H__
44#define __DEBUG_QT_WINDOW_QT_H__
55
6#include <QtGui/QtGui>
6#include <QtWidgets/QMainWindow>
77
88#include "emu.h"
99#include "config.h"


Previous 199869 Revisions Next


© 1997-2024 The MAME Team