Freeciv21
Develop your civilization from humble roots to a global empire
turn_done_button.h
Go to the documentation of this file.
1
/*
2
* SPDX-FileCopyrightText: 2022 Louis Moureaux <m_louis30@yahoo.com>
3
*
4
* SPDX-License-Identifier: GPL-3.0-or-later
5
*/
6
#pragma once
7
8
#include <QPushButton>
9
13
class
turn_done_button
:
public
QPushButton {
14
Q_OBJECT
15
16
public
:
17
explicit
turn_done_button
(QWidget *parent =
nullptr
);
18
20
virtual
~turn_done_button
() =
default
;
21
22
void
update_timeout_label
();
23
24
QSize
sizeHint
()
const override
;
25
26
protected
:
27
void
paintEvent
(QPaintEvent *
event
)
override
;
28
29
private
:
30
QString
m_timeout_label
;
31
};
32
33
QString
format_simple_duration
(
int
seconds);
turn_done_button
The "Turn Done" button in the main view.
Definition:
turn_done_button.h:13
turn_done_button::paintEvent
void paintEvent(QPaintEvent *event) override
Paints the widget.
Definition:
turn_done_button.cpp:83
turn_done_button::sizeHint
QSize sizeHint() const override
Returns the size hint for this widget.
Definition:
turn_done_button.cpp:65
turn_done_button::update_timeout_label
void update_timeout_label()
Updates the timeout text according to the current state of the game.
Definition:
turn_done_button.cpp:198
turn_done_button::~turn_done_button
virtual ~turn_done_button()=default
Destructor.
turn_done_button::m_timeout_label
QString m_timeout_label
Definition:
turn_done_button.h:30
turn_done_button::turn_done_button
turn_done_button(QWidget *parent=nullptr)
Constructor.
Definition:
turn_done_button.cpp:40
event
enum event_type event
Definition:
events.cpp:68
format_simple_duration
QString format_simple_duration(int seconds)
Formats a duration without switching to "until hh::mm" when more than one hour in the future.
Definition:
turn_done_button.cpp:135
client
turn_done_button.h
Generated by
1.9.1