Freeciv21
Develop your civilization from humble roots to a global empire
voteinfo_bar.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  part of Freeciv21. Freeciv21 is free software: you can redistribute it
4  and/or modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation, either version 3 of the
6  License, or (at your option) any later version. You should have received
7  a copy of the GNU General Public License along with Freeciv21. If not,
8  see https://www.gnu.org/licenses/.
9 **************************************************************************/
10 #pragma once
11 
12 // Qt
13 #include <QWidget>
14 // client
15 #include "voteinfo_bar_g.h"
16 
17 class QGridLayout;
18 class QLabel;
19 class QPushButton;
20 
21 /***************************************************************************
22  pregamevote class used for displaying vote bar in PAGE START
23 ***************************************************************************/
24 class pregamevote : public QWidget {
25  Q_OBJECT
26 
27 public:
28  explicit pregamevote(QWidget *parent = nullptr);
29  ~pregamevote() override;
30  void update_vote();
31  QLabel *label_text;
32  QLabel *label_vote_text;
33  QPushButton *vote_yes;
34  QPushButton *vote_no;
35  QPushButton *vote_abstain;
36  QLabel *lab_yes;
37  QLabel *lab_no;
38  QLabel *lab_abstain;
39  QLabel *voters;
40  QGridLayout *layout;
41 public slots:
42  void v_yes();
43  void v_no();
44  void v_abstain();
45 };
46 
47 /***************************************************************************
48  xvote class used for displaying vote bar in PAGE GAME
49 ***************************************************************************/
50 class xvote : public pregamevote {
51  Q_OBJECT
52 
53 public:
54  xvote(QWidget *parent);
55 
56 protected:
57  void paint(QPainter *painter, QPaintEvent *event);
58  void paintEvent(QPaintEvent *event) override;
59 };
QPushButton * vote_yes
Definition: voteinfo_bar.h:33
QGridLayout * layout
Definition: voteinfo_bar.h:40
QLabel * label_vote_text
Definition: voteinfo_bar.h:32
void v_yes()
Slot vote yes.
QLabel * voters
Definition: voteinfo_bar.h:39
QPushButton * vote_abstain
Definition: voteinfo_bar.h:35
void v_no()
Slot vote no.
pregamevote(QWidget *parent=nullptr)
Constructor for pregamevote.
QLabel * lab_abstain
Definition: voteinfo_bar.h:38
void v_abstain()
Slot vote abstain.
QLabel * lab_yes
Definition: voteinfo_bar.h:36
void update_vote()
Updates text on vote.
QLabel * label_text
Definition: voteinfo_bar.h:31
QPushButton * vote_no
Definition: voteinfo_bar.h:34
~pregamevote() override
Destructor for pregamevote.
QLabel * lab_no
Definition: voteinfo_bar.h:37
void paint(QPainter *painter, QPaintEvent *event)
Paints frames for xvote.
xvote(QWidget *parent)
pregamevote class used for displaying vote bar in PAGE START
void paintEvent(QPaintEvent *event) override
Paint event for xvote.
enum event_type event
Definition: events.cpp:68