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);
The "Turn Done" button in the main view.
void paintEvent(QPaintEvent *event) override
Paints the widget.
QSize sizeHint() const override
Returns the size hint for this widget.
void update_timeout_label()
Updates the timeout text according to the current state of the game.
virtual ~turn_done_button()=default
Destructor.
turn_done_button(QWidget *parent=nullptr)
Constructor.
enum event_type event
Definition: events.cpp:68
QString format_simple_duration(int seconds)
Formats a duration without switching to "until hh::mm" when more than one hour in the future.