-
Notifications
You must be signed in to change notification settings - Fork 0
/
qtbeerwantermaindialog.cpp
52 lines (44 loc) · 1.25 KB
/
qtbeerwantermaindialog.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include "qtbeerwantermaindialog.h"
#include <iostream>
#include "beerwantermaindialog.h"
#include "qtbeerwanterwidget.h"
#include "ui_qtbeerwantermaindialog.h"
ribi::QtBeerWanterMainDialog::QtBeerWanterMainDialog(QWidget *parent)
: QtHideAndShowDialog(parent),
ui(new Ui::QtBeerWanterMainDialog),
m_widget(new QtBeerWanterWidget)
{
ui->setupUi(this);
ui->beerwanter_layout->addWidget(m_widget.get());
this->setGeometry(
m_widget->GetBeerWanter()->GetWindowX(),
m_widget->GetBeerWanter()->GetWindowY(),
m_widget->GetBeerWanter()->GetWindowWidth(),
m_widget->GetBeerWanter()->GetWindowHeight()
);
QObject::connect(
m_widget.get(),
SIGNAL(LevelUp(const std::string&)),
this,
SLOT(ChangeTitle(const std::string&))
);
QObject::connect(
m_widget.get(),
SIGNAL(DoShake(const int,const int)),
this,
SLOT(OnShake(const int, const int))
);
}
ribi::QtBeerWanterMainDialog::~QtBeerWanterMainDialog() noexcept
{
delete ui;
}
void ribi::QtBeerWanterMainDialog::ChangeTitle(const std::string& title) noexcept
{
this->setWindowTitle(title.c_str());
}
void ribi::QtBeerWanterMainDialog::OnShake(const int x, const int y) noexcept
{
this->setGeometry(x, y, this->width(), this->height());
this->repaint();
}