Skip to content
This repository was archived by the owner on Mar 1, 2021. It is now read-only.

Commit 72b7acf

Browse files
committed
Forward parent object when applicable
1 parent a6d3098 commit 72b7acf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

source/Button/Button.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,10 @@ SOFTWARE.
2828
#include "Scene/Scene.h"
2929
#include "Sound/Sound.h"
3030

31-
void ButtonFuncs::about(Game *)
31+
void ButtonFuncs::about(Game *game_instance)
3232
{
33-
QMessageBox::about(0, "About...", QString("Flappy Bird Qt by fuzun\nVersion: v%1\n\ngithub.com/fuzun/Flappy-Bird-Qt").arg(QCoreApplication::applicationVersion()));
33+
QWidget *gameQObject = dynamic_cast<QWidget *>(game_instance);
34+
QMessageBox::about(gameQObject, "About...", QString("Flappy Bird Qt by fuzun\nVersion: v%1\n\ngithub.com/fuzun/Flappy-Bird-Qt").arg(QCoreApplication::applicationVersion()));
3435
}
3536

3637
void ButtonFuncs::play(Game *game_instance)

source/Button/Button.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class Game;
3131
class ButtonFuncs
3232
{
3333
public:
34-
static void about(Game *);
34+
static void about(Game *game_instance);
3535
static void play(Game *game_instance);
3636
static void soundEnable(Game *game_instance);
3737
static void soundDisable(Game *game_instance);

0 commit comments

Comments
 (0)