refactor the window name to not imply a Model/View relationship
This commit is contained in:
parent
f11536e152
commit
798affa3fb
|
@ -30,9 +30,9 @@ target_sources(${PROJECT_NAME}
|
|||
sacnexplorer.cpp
|
||||
universemodel.cpp
|
||||
universemodel.h
|
||||
universeview.h
|
||||
universeview.cpp
|
||||
universeview.ui
|
||||
universewindow.h
|
||||
universewindow.cpp
|
||||
universewindow.ui
|
||||
)
|
||||
|
||||
target_link_libraries(${PROJECT_NAME}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#include "multiverseview.h"
|
||||
#include "multiversemodel.h"
|
||||
#include "ui_multiverseview.h"
|
||||
#include "universeview.h"
|
||||
#include "universewindow.h"
|
||||
#include <QActionGroup>
|
||||
|
||||
/**
|
||||
|
@ -216,7 +216,7 @@ void MultiverseView::createEditor(const QModelIndex &index)
|
|||
foreach (const auto & inspector, mInspectors)
|
||||
if (inspector->universe() == univ)
|
||||
return inspector->show();
|
||||
auto view = new UniverseView(this, univ);
|
||||
auto view = new UniverseInspector(this, univ);
|
||||
mInspectors.insert(view);
|
||||
connect(view, &QObject::destroyed, this, [this, view](){mInspectors.remove(view);});
|
||||
connect(univ, &QObject::destroyed, view, &QMainWindow::close);
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
|
||||
#include "multiversemodel.h"
|
||||
#include "qsacnnode.h"
|
||||
#include "universeview.h"
|
||||
#include "universewindow.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QSortFilterProxyModel>
|
||||
|
@ -62,5 +62,5 @@ private:
|
|||
QSacnNode * node;
|
||||
MultiverseModel * model;
|
||||
QSortFilterProxyModel *sortProxy;
|
||||
QSet<UniverseView*> mInspectors;
|
||||
QSet<UniverseInspector*> mInspectors;
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "universeview.h"
|
||||
#include "ui_universeview.h"
|
||||
#include "universewindow.h"
|
||||
#include "ui_universewindow.h"
|
||||
#include "universemodel.h"
|
||||
|
||||
#include <QComboBox>
|
||||
|
@ -10,9 +10,9 @@
|
|||
* @brief UniverseView::UniverseView
|
||||
* @param parent
|
||||
*/
|
||||
UniverseView::UniverseView(QWidget *parent, QSacnUniverse *universe)
|
||||
UniverseInspector::UniverseInspector(QWidget *parent, QSacnUniverse *universe)
|
||||
: QMainWindow(parent)
|
||||
, ui(new Ui::UniverseView())
|
||||
, ui(new Ui::UniverseInspector())
|
||||
, mUniverse(universe)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
@ -24,7 +24,7 @@ UniverseView::UniverseView(QWidget *parent, QSacnUniverse *universe)
|
|||
|
||||
// update the status bar whenever the universe refreshes
|
||||
connect(model, &UniverseModel::recievedUpdate,
|
||||
this, &UniverseView::updateStatus);
|
||||
this, &UniverseInspector::updateStatus);
|
||||
|
||||
// add data format combobox to toolbar
|
||||
auto formatLabel = new QLabel(this);
|
||||
|
@ -65,7 +65,7 @@ UniverseView::UniverseView(QWidget *parent, QSacnUniverse *universe)
|
|||
/**
|
||||
* @brief UniverseView::~UniverseView
|
||||
*/
|
||||
UniverseView::~UniverseView()
|
||||
UniverseInspector::~UniverseInspector()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
@ -75,7 +75,7 @@ UniverseView::~UniverseView()
|
|||
* @brief UniverseView::updateStatusBar
|
||||
* @param universe
|
||||
*/
|
||||
void UniverseView::updateStatus(QSacnUniverse* universe)
|
||||
void UniverseInspector::updateStatus(QSacnUniverse* universe)
|
||||
{
|
||||
// window title
|
||||
this->setWindowTitle(QString("%1 '%2' : "+tr("Universe")+" %3").arg(
|
|
@ -7,19 +7,19 @@
|
|||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui {
|
||||
class UniverseView;
|
||||
class UniverseInspector;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class UniverseView
|
||||
class UniverseInspector
|
||||
: public QMainWindow
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit UniverseView(QWidget *parent = nullptr,
|
||||
explicit UniverseInspector(QWidget *parent = nullptr,
|
||||
QSacnUniverse* universe = nullptr);
|
||||
virtual ~UniverseView();
|
||||
virtual ~UniverseInspector();
|
||||
|
||||
/**
|
||||
* @brief universe
|
||||
|
@ -31,7 +31,7 @@ public slots:
|
|||
void updateStatus(QSacnUniverse *);
|
||||
|
||||
private:
|
||||
Ui::UniverseView *ui;
|
||||
Ui::UniverseInspector *ui;
|
||||
QSpinBox *prioritySpinBox;
|
||||
QSacnUniverse *mUniverse;
|
||||
};
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>UniverseView</class>
|
||||
<widget class="QMainWindow" name="UniverseView">
|
||||
<class>UniverseInspector</class>
|
||||
<widget class="QMainWindow" name="UniverseInspector">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
|
@ -39,7 +39,16 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar"/>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>25</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QStatusBar" name="statusbar"/>
|
||||
<widget class="QToolBar" name="toolBar">
|
||||
<attribute name="toolBarArea">
|
Loading…
Reference in New Issue