Freeciv-3.3
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes
hud_text Class Reference

#include <hudwidget.h>

+ Inheritance diagram for hud_text:

Public Member Functions

 hud_text (QString s, int time_secs, QWidget *parent)
 
 ~hud_text ()
 
void show_me ()
 

Protected Member Functions

void paintEvent (QPaintEvent *event)
 
void timerEvent (QTimerEvent *event)
 

Private Member Functions

void center_me ()
 

Private Attributes

QRect bound_rect
 
int timeout
 
int m_animate_step
 
QString text
 
QElapsedTimer m_timer
 
QFontMetricsfm_text
 
QFont f_text
 
QFont f_title
 

Detailed Description

Definition at line 85 of file hudwidget.h.

Constructor & Destructor Documentation

◆ hud_text()

hud_text::hud_text ( QString  s,
int  time_secs,
QWidget *  parent 
)

Hud text constructor takes text to display and time

Definition at line 240 of file hudwidget.cpp.

◆ ~hud_text()

hud_text::~hud_text ( )

Destructor for hud text

Definition at line 298 of file hudwidget.cpp.

Member Function Documentation

◆ center_me()

void hud_text::center_me ( )
private

Moves to top center parent widget and sets size new size

Definition at line 281 of file hudwidget.cpp.

Referenced by paintEvent(), and show_me().

◆ paintEvent()

void hud_text::paintEvent ( QPaintEvent event)
protected

Paint event for custom hud_text

Definition at line 319 of file hudwidget.cpp.

◆ show_me()

void hud_text::show_me ( )

Shows hud text

Definition at line 272 of file hudwidget.cpp.

◆ timerEvent()

void hud_text::timerEvent ( QTimerEvent event)
protected

Timer event, closes widget after timeout

Definition at line 306 of file hudwidget.cpp.

Field Documentation

◆ bound_rect

QRect hud_text::bound_rect
private

Definition at line 97 of file hudwidget.h.

Referenced by center_me(), and paintEvent().

◆ f_text

QFont hud_text::f_text
private

Definition at line 103 of file hudwidget.h.

Referenced by hud_text(), and paintEvent().

◆ f_title

QFont hud_text::f_title
private

Definition at line 104 of file hudwidget.h.

◆ fm_text

QFontMetrics* hud_text::fm_text
private

Definition at line 102 of file hudwidget.h.

Referenced by hud_text(), and ~hud_text().

◆ m_animate_step

int hud_text::m_animate_step
private

Definition at line 99 of file hudwidget.h.

Referenced by hud_text(), and timerEvent().

◆ m_timer

QElapsedTimer hud_text::m_timer
private

Definition at line 101 of file hudwidget.h.

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

◆ text

QString hud_text::text
private

Definition at line 100 of file hudwidget.h.

Referenced by hud_text(), and paintEvent().

◆ timeout

int hud_text::timeout
private

Definition at line 98 of file hudwidget.h.

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