Commit 17b25472 authored by Julian Helfferich's avatar Julian Helfferich 💬
Browse files

Do not call setupGui() in KBlocksWin constructor

This function makes it more difficult to build unit tests for
KBlocksWin. A better way is to make this a public member and call it
explicitely after the KBlocksWin object has been created.
parent 13fc0e56
......@@ -72,8 +72,6 @@ KBlocksWin::KBlocksWin(
connect(mpGameView, &KBlocksView::focusEvent, this, &KBlocksWin::focusEvent);
setAutoSaveSettings();
setupGUILayout();
}
KBlocksWin::~KBlocksWin()
......
......@@ -48,6 +48,8 @@ public:
void addScore(int gameIndex, int lineCount);
void setupGUILayout();
protected slots:
void stopGame();
......@@ -68,9 +70,6 @@ private slots:
void levelChanged();
void setSoundsEnabled(bool enabled);
private:
void setupGUILayout();
protected:
void closeEvent(QCloseEvent *event) override;
......
......@@ -89,6 +89,8 @@ int gameDesktopMode(const QApplication &app)
2,
1
);
mpKBlocksWindow->setupGUILayout();
mpKBlocksWindow->setUpdateInterval(50);
mpKBlocksWindow->setGamesPerLine(4);
mpKBlocksWindow->setGameAnimEnabled(true);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment