1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00
vcmi/launcher/startGame/StartGameTab.cpp

33 lines
575 B
C++
Raw Normal View History

2024-11-24 19:33:25 +02:00
#include "StartGameTab.h"
#include "ui_StartGameTab.h"
#include "../mainwindow_moc.h"
#include "../main.h"
StartGameTab::StartGameTab(QWidget * parent)
: QWidget(parent)
, ui(new Ui::StartGameTab)
{
ui->setupUi(this);
}
StartGameTab::~StartGameTab()
{
delete ui;
}
MainWindow * StartGameTab::getMainWindow()
{
foreach(QWidget *w, qApp->allWidgets())
if(QMainWindow* mainWin = qobject_cast<QMainWindow*>(w))
return dynamic_cast<MainWindow *>(mainWin);
return nullptr;
}
void StartGameTab::on_buttonPlay_clicked()
{
getMainWindow()->hide();
startGame({});
}