Freeciv21
Develop your civilization from humble roots to a global empire
hud_input_box Class Reference

#include <hudwidget.h>

+ Inheritance diagram for hud_input_box:
+ Collaboration diagram for hud_input_box:

Public Member Functions

 hud_input_box (QWidget *parent)
 Custom input box constructor. More...
 
 ~hud_input_box () override
 Custom input box destructor. More...
 
void set_text_title_definput (const QString &s1, const QString &s2, const QString &def_input)
 Sets text, title and default text and shows input box. More...
 

Public Attributes

QLineEdit input_edit
 

Protected Member Functions

void paintEvent (QPaintEvent *event) override
 Paint event for custom input box. More...
 
void timerEvent (QTimerEvent *event) override
 Timer event used to animate input box. More...
 

Private Attributes

QElapsedTimer m_timer
 
int m_animate_step
 
QString text
 
QString title
 
QFontMetrics * fm_text
 
QFontMetrics * fm_title
 
QFont f_text
 
QString cs1
 
QString cs2
 
QFont f_title
 
int top
 
int mult
 

Detailed Description

Definition at line 109 of file hudwidget.h.

Constructor & Destructor Documentation

◆ hud_input_box()

hud_input_box::hud_input_box ( QWidget *  parent)

Custom input box constructor.

Definition at line 331 of file hudwidget.cpp.

◆ ~hud_input_box()

hud_input_box::~hud_input_box ( )
override

Custom input box destructor.

Definition at line 363 of file hudwidget.cpp.

Member Function Documentation

◆ paintEvent()

void hud_input_box::paintEvent ( QPaintEvent *  event)
overrideprotected

Paint event for custom input box.

Definition at line 441 of file hudwidget.cpp.

◆ set_text_title_definput()

void hud_input_box::set_text_title_definput ( const QString &  s1,
const QString &  s2,
const QString &  def_input 
)

Sets text, title and default text and shows input box.

Definition at line 372 of file hudwidget.cpp.

Referenced by city_dialog::city_rename(), popup_newcity_dialog(), city_dialog::save_cma(), and city_dialog::save_worklist().

◆ timerEvent()

void hud_input_box::timerEvent ( QTimerEvent *  event)
overrideprotected

Timer event used to animate input box.

Definition at line 432 of file hudwidget.cpp.

Member Data Documentation

◆ cs1

QString hud_input_box::cs1
private

Definition at line 131 of file hudwidget.h.

Referenced by paintEvent(), and set_text_title_definput().

◆ cs2

QString hud_input_box::cs2
private

Definition at line 131 of file hudwidget.h.

Referenced by paintEvent(), and set_text_title_definput().

◆ f_text

QFont hud_input_box::f_text
private

Definition at line 130 of file hudwidget.h.

Referenced by hud_input_box(), paintEvent(), and set_text_title_definput().

◆ f_title

QFont hud_input_box::f_title
private

Definition at line 132 of file hudwidget.h.

Referenced by hud_input_box(), and paintEvent().

◆ fm_text

QFontMetrics* hud_input_box::fm_text
private

Definition at line 128 of file hudwidget.h.

Referenced by hud_input_box(), paintEvent(), set_text_title_definput(), and ~hud_input_box().

◆ fm_title

QFontMetrics* hud_input_box::fm_title
private

Definition at line 129 of file hudwidget.h.

Referenced by hud_input_box(), paintEvent(), set_text_title_definput(), and ~hud_input_box().

◆ input_edit

QLineEdit hud_input_box::input_edit

◆ m_animate_step

int hud_input_box::m_animate_step
private

Definition at line 125 of file hudwidget.h.

Referenced by hud_input_box(), paintEvent(), and timerEvent().

◆ m_timer

QElapsedTimer hud_input_box::m_timer
private

Definition at line 111 of file hudwidget.h.

Referenced by set_text_title_definput(), and timerEvent().

◆ mult

int hud_input_box::mult
private

Definition at line 134 of file hudwidget.h.

Referenced by hud_input_box(), paintEvent(), and set_text_title_definput().

◆ text

QString hud_input_box::text
private

Definition at line 126 of file hudwidget.h.

Referenced by paintEvent(), and set_text_title_definput().

◆ title

QString hud_input_box::title
private

Definition at line 127 of file hudwidget.h.

Referenced by paintEvent(), and set_text_title_definput().

◆ top

int hud_input_box::top
private

Definition at line 133 of file hudwidget.h.

Referenced by hud_input_box(), paintEvent(), and set_text_title_definput().