mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
33 lines
575 B
C++
33 lines
575 B
C++
|
#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({});
|
||
|
}
|
||
|
|