BCESolve
bcepushbutton.hpp
1
// This file is part of the BCESolve library for games of incomplete
2
// information
3
// Copyright (C) 2022 Benjamin A. Brooks
4
//
5
// BCESolve free software: you can redistribute it and/or modify it
6
// under the terms of the GNU General Public License as published by
7
// the Free Software Foundation, either version 3 of the License, or
8
// (at your option) any later version.
9
//
10
// BCESolve is distributed in the hope that it will be useful, but
11
// WITHOUT ANY WARRANTY; without even the implied warranty of
12
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
// General Public License for more details.
14
//
15
// You should have received a copy of the GNU General Public License
16
// along with this program. If not, see
17
// <http://www.gnu.org/licenses/>.
18
//
19
// Benjamin A. Brooks
20
// ben@benjaminbrooks.net
21
// Chicago, IL
22
23
#ifndef BCEPUSHBUTTON_HPP
24
#define BCEPUSHBUTTON_HPP
25
26
#include <QtWidgets>
27
29
35
class
BCEPushButton
:
public
QPushButton {
36
Q_OBJECT;
37
38
private
:
40
int
player
;
41
42
public
:
43
45
BCEPushButton
(
int
_player, QString _label, QWidget *parent):
46
QPushButton(_label),
player
(_player)
47
{
48
connect(
this
,SIGNAL(clicked()),
49
this
,SLOT(
bceClick
()));
50
setParent(parent);
51
}
52
53
signals:
55
void
clickedForPlayer
(
int
player
);
56
57
public
slots:
58
60
void
bceClick
() {
61
emit(
clickedForPlayer
(
player
));
62
}
63
64
65
};
66
67
#endif
BCEPushButton
QPushButton that emits the player when clicked.
Definition:
bcepushbutton.hpp:35
BCEPushButton::player
int player
Associated player.
Definition:
bcepushbutton.hpp:36
BCEPushButton::clickedForPlayer
void clickedForPlayer(int player)
Signals the player associated with a BCEPushButton.
BCEPushButton::BCEPushButton
BCEPushButton(int _player, QString _label, QWidget *parent)
Constructor.
Definition:
bcepushbutton.hpp:45
BCEPushButton::bceClick
void bceClick()
Emits the clickedForPlayer(_) signal.
Definition:
bcepushbutton.hpp:60
viewer
hpp
bcepushbutton.hpp
Generated by
1.9.3