switch to using own event system
This commit is contained in:
@@ -3,8 +3,13 @@
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
|
||||
ArenaWidget::ArenaWidget(const std::string& arenaName, QWidget* parent)
|
||||
#include "ArenaInspectRequestedEvent.h"
|
||||
#include "ArenaStartRequestedEvent.h"
|
||||
#include "EventManager.h"
|
||||
|
||||
ArenaWidget::ArenaWidget(int arenaIndex, const std::string& arenaName, QWidget* parent)
|
||||
: QFrame(parent)
|
||||
, m_arenaIndex(arenaIndex)
|
||||
, m_running(false)
|
||||
, m_wasFinished(false)
|
||||
{
|
||||
@@ -31,11 +36,17 @@ void ArenaWidget::buildLayout(const std::string& arenaName)
|
||||
titleRow->addStretch();
|
||||
|
||||
m_inspectButton = new QPushButton(tr("Inspect"), this);
|
||||
connect(m_inspectButton, &QPushButton::clicked, this, &ArenaWidget::inspectRequested);
|
||||
connect(m_inspectButton, &QPushButton::clicked, this, [this]() {
|
||||
EventManager::getInstance()->sendEventImmediately(
|
||||
std::make_shared<ArenaInspectRequestedEvent>(m_arenaIndex));
|
||||
});
|
||||
titleRow->addWidget(m_inspectButton);
|
||||
|
||||
m_startButton = new QPushButton(tr("Start"), this);
|
||||
connect(m_startButton, &QPushButton::clicked, this, &ArenaWidget::startRequested);
|
||||
connect(m_startButton, &QPushButton::clicked, this, [this]() {
|
||||
EventManager::getInstance()->sendEventImmediately(
|
||||
std::make_shared<ArenaStartRequestedEvent>(m_arenaIndex));
|
||||
});
|
||||
titleRow->addWidget(m_startButton);
|
||||
|
||||
outerLayout->addLayout(titleRow);
|
||||
|
||||
Reference in New Issue
Block a user