diff options
Diffstat (limited to 'src/osd/modules/debugger/qt/deviceswindow.h')
-rw-r--r-- | src/osd/modules/debugger/qt/deviceswindow.h | 50 |
1 files changed, 17 insertions, 33 deletions
diff --git a/src/osd/modules/debugger/qt/deviceswindow.h b/src/osd/modules/debugger/qt/deviceswindow.h index 87e710a001b..d337817fac0 100644 --- a/src/osd/modules/debugger/qt/deviceswindow.h +++ b/src/osd/modules/debugger/qt/deviceswindow.h @@ -1,12 +1,16 @@ // license:BSD-3-Clause // copyright-holders:Andrew Gardner -#ifndef __DEBUG_QT_DEVICES_WINDOW_H__ -#define __DEBUG_QT_DEVICES_WINDOW_H__ +#ifndef MAME_DEBUGGER_QT_DEVICESWINDOW_H +#define MAME_DEBUGGER_QT_DEVICESWINDOW_H -#include <QtWidgets/QTreeView> +#pragma once #include "windowqt.h" +#include <QtWidgets/QTreeView> + + +namespace osd::debugger::qt { //============================================================ // The model for the treeview @@ -17,21 +21,19 @@ class DevicesWindowModel : public QAbstractItemModel Q_OBJECT public: - explicit DevicesWindowModel(running_machine *machine, QObject *parent = 0); + explicit DevicesWindowModel(running_machine &machine, QObject *parent = nullptr); ~DevicesWindowModel(); QVariant data(const QModelIndex &index, int role) const; Qt::ItemFlags flags(const QModelIndex &index) const; - QVariant headerData(int section, Qt::Orientation orientation, - int role = Qt::DisplayRole) const; - QModelIndex index(int row, int column, - const QModelIndex &parent = QModelIndex()) const; + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QModelIndex parent(const QModelIndex &index) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; private: - running_machine *m_machine; + running_machine &m_machine; }; //============================================================ @@ -42,40 +44,22 @@ class DevicesWindow : public WindowQt Q_OBJECT public: - DevicesWindow(running_machine* machine, QWidget* parent=nullptr); + DevicesWindow(DebuggerQt &debugger, QWidget *parent = nullptr); virtual ~DevicesWindow(); public slots: void currentRowChanged(const QModelIndex ¤t, const QModelIndex &previous); void activated(const QModelIndex &index); +protected: + virtual void saveConfigurationToNode(util::xml::data_node &node) override; + private: QTreeView *m_devices_view; DevicesWindowModel m_devices_model; device_t *m_selected_device; }; +} // namespace osd::debugger::qt - - -//========================================================================= -// A way to store the configuration of a window long enough to read/write. -//========================================================================= -class DevicesWindowQtConfig : public WindowQtConfig -{ -public: - DevicesWindowQtConfig() : - WindowQtConfig(WIN_TYPE_DEVICES) - { - } - - ~DevicesWindowQtConfig() {} - - void buildFromQWidget(QWidget* widget); - void applyToQWidget(QWidget* widget); - void addToXmlDataNode(util::xml::data_node &node) const; - void recoverFromXmlNode(util::xml::data_node const &node); -}; - - -#endif +#endif // MAME_DEBUGGER_QT_DEVICESWINDOW_H |