MainWidget::MainWidget(Settings *settings, QWidget *parent) : QWidget(parent) , m_settings(settings) , m_scene(-105, -175, 808, 533) , m_centralWidgetRect(355, 176, 808, 533) , gameField(new Game(m_centralWidgetRect, &m_scene)) , about(new aboutWidget(m_centralWidgetRect)) , menu(new mainMenu(m_centralWidgetRect)) , manage(new manageWidget(m_centralWidgetRect)) , st(new QStackedWidget(this)) , recordsView(new recordsWidget(m_centralWidgetRect)) , m_settingsWidget(new SettingsWidget(m_centralWidgetRect, settings)) , settings(new QSettings("karama", "WolfAndEggs", this)) , isUpdated(false) { loadSettings(); recordsView->printRecords(gameField->getRecords()); setWindowFlags(Qt::FramelessWindowHint); initStackedWidget(); initButtons(); showMaximized(); QObject::connect(this,SIGNAL(pauseGame()),gameField,SLOT(pauseGame())); QObject::connect(recordsView->newBut,SIGNAL(clicked()),this,SLOT(newGameStart())); }
RSettingsWin::RSettingsWin(QWidget * parent, Qt::WFlags flags) : QDialog(parent, flags) { setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); setModal(false); initStackedWidget(); connect(listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(setNewPage(int))); connect(applyButton, SIGNAL(clicked( bool )), this, SLOT( saveChanges()) ); }
RSettingsWin::RSettingsWin(QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowCloseButtonHint) { setupUi(this); setAttribute(Qt::WA_DeleteOnClose, true); setModal(false); initStackedWidget(); connect(listWidget, SIGNAL(currentRowChanged(int)), this, SLOT(setNewPage(int))); connect(buttonBox, SIGNAL(accepted()), this, SLOT(saveChanges())); connect(buttonBox, SIGNAL(rejected()), this, SLOT(close())); connect(this, SIGNAL(finished(int)), this, SLOT(dialogFinished(int))); }