Freeciv21
Develop your civilization from humble roots to a global empire
freeciv::report_widget Class Reference

Widget used to display the demographics, top 5 cities, and travelers' reports. More...

#include <report_widget.h>

+ Inheritance diagram for freeciv::report_widget:
+ Collaboration diagram for freeciv::report_widget:

Public Member Functions

 report_widget (const QString &caption, const QString &headline, const QString &lines, QWidget *parent=nullptr)
 Creates a report widget displaying the provided text. More...
 
 ~report_widget () override=default
 
QString caption () const
 Returns back the caption passed to the constructor. More...
 
QString headline () const
 Returns back the headline passed to the constructor. More...
 
void update_menu () override
 Called when the close button is pressed. More...
 
- Public Member Functions inherited from fcwidget
 fcwidget (QWidget *parent=nullptr)
 Constructor. More...
 

Protected Member Functions

void mousePressEvent (QMouseEvent *event) override
 Reimplemented to let the user drag the widget. More...
 
void mouseMoveEvent (QMouseEvent *event) override
 Reimplemented to let the user drag the widget. More...
 
void mouseReleaseEvent (QMouseEvent *event) override
 Reimplemented to let the user drag the widget. More...
 
bool event (QEvent *event) override
 Overridden to handle font changes. More...
 

Private Attributes

QString m_caption
 
QString m_headline
 
QPoint m_cursor
 
QLabel * m_contents
 

Detailed Description

Widget used to display the demographics, top 5 cities, and travelers' reports.

Definition at line 20 of file report_widget.h.

Constructor & Destructor Documentation

◆ report_widget()

freeciv::report_widget::report_widget ( const QString &  caption,
const QString &  headline,
const QString &  lines,
QWidget *  parent = nullptr 
)

Creates a report widget displaying the provided text.

Definition at line 31 of file report_widget.cpp.

◆ ~report_widget()

freeciv::report_widget::~report_widget ( )
overridedefault

Member Function Documentation

◆ caption()

QString freeciv::report_widget::caption ( ) const
inline

Returns back the caption passed to the constructor.

Definition at line 29 of file report_widget.h.

Referenced by report_widget().

◆ event()

bool freeciv::report_widget::event ( QEvent *  event)
overrideprotected

Overridden to handle font changes.

Definition at line 87 of file report_widget.cpp.

Referenced by mouseMoveEvent(), and mouseReleaseEvent().

◆ headline()

QString freeciv::report_widget::headline ( ) const
inline

Returns back the headline passed to the constructor.

Definition at line 32 of file report_widget.h.

Referenced by report_widget().

◆ mouseMoveEvent()

void freeciv::report_widget::mouseMoveEvent ( QMouseEvent *  event)
overrideprotected

Reimplemented to let the user drag the widget.

Definition at line 69 of file report_widget.cpp.

◆ mousePressEvent()

void freeciv::report_widget::mousePressEvent ( QMouseEvent *  event)
overrideprotected

Reimplemented to let the user drag the widget.

Definition at line 61 of file report_widget.cpp.

◆ mouseReleaseEvent()

void freeciv::report_widget::mouseReleaseEvent ( QMouseEvent *  event)
overrideprotected

Reimplemented to let the user drag the widget.

Definition at line 78 of file report_widget.cpp.

◆ update_menu()

void freeciv::report_widget::update_menu ( )
overridevirtual

Called when the close button is pressed.

Implements fcwidget.

Definition at line 102 of file report_widget.cpp.

Member Data Documentation

◆ m_caption

QString freeciv::report_widget::m_caption
private

Definition at line 43 of file report_widget.h.

Referenced by caption().

◆ m_contents

QLabel* freeciv::report_widget::m_contents
private

Definition at line 45 of file report_widget.h.

Referenced by event(), and report_widget().

◆ m_cursor

QPoint freeciv::report_widget::m_cursor
private

Definition at line 44 of file report_widget.h.

Referenced by mouseMoveEvent(), and mousePressEvent().

◆ m_headline

QString freeciv::report_widget::m_headline
private

Definition at line 43 of file report_widget.h.

Referenced by headline().