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

#include <view_research.h>

+ Inheritance diagram for science_report:
+ Collaboration diagram for science_report:

Public Member Functions

 science_report ()
 Consctructor for science_report. More...
 
 ~science_report () override
 Destructor for science report Removes "SCI" string marking it as closed And frees given index on list marking it as ready for new widget. More...
 
void update_report ()
 Updates all important widgets on science_report. More...
 
void init (bool raise)
 Updates science_report and marks it as opened It has to be called soon after constructor. More...
 
void redraw ()
 Schedules paint event in some qt queue. More...
 
void reset_tree ()
 Recalculates research diagram again and updates science report. More...
 

Private Slots

void current_tech_changed (int index)
 Slot used when combo box with current tech changes. More...
 
void goal_tech_changed (int index)
 Slot used when combo box with goal have been changed. More...
 
void push_research ()
 Push (redo) research when qty bulbs researched is greater than the number needed. More...
 
void locate_researching ()
 Locate the currently researched technology in tree and scroll so that it is visible. More...
 
void locate_goal ()
 Locate technology goal in tree and scroll so that it is visible. More...
 

Private Member Functions

void update_reqtree ()
 Calls update for research_diagram. More...
 
void scroll_reqtree_to_tech (Tech_type_id id)
 Scroll the science tree to display the technology identified by tech id. More...
 

Private Attributes

QScrollArea * scroll
 
QComboBox * goal_combo
 
QComboBox * researching_combo
 
QPushButton * refresh_but
 
QToolButton * locate_researching_but
 
QToolButton * locate_goal_but
 
progress_barprogress
 
QLabel * info_label
 
QLabel * progress_label
 
QList< qlist_item > * curr_list {nullptr}
 
QList< qlist_item > * goal_list {nullptr}
 
research_diagramres_diag
 
int index {0}
 

Detailed Description

Definition at line 73 of file view_research.h.

Constructor & Destructor Documentation

◆ science_report()

science_report::science_report ( )

Consctructor for science_report.

Definition at line 277 of file view_research.cpp.

◆ ~science_report()

science_report::~science_report ( )
override

Destructor for science report Removes "SCI" string marking it as closed And frees given index on list marking it as ready for new widget.

Definition at line 367 of file view_research.cpp.

Member Function Documentation

◆ current_tech_changed

void science_report::current_tech_changed ( int  index)
privateslot

Slot used when combo box with current tech changes.

Definition at line 589 of file view_research.cpp.

Referenced by science_report().

◆ goal_tech_changed

void science_report::goal_tech_changed ( int  index)
privateslot

Slot used when combo box with goal have been changed.

Definition at line 605 of file view_research.cpp.

Referenced by science_report().

◆ init()

void science_report::init ( bool  raise)

Updates science_report and marks it as opened It has to be called soon after constructor.

It could be in constructor but compiler will yell about not used variable

Definition at line 379 of file view_research.cpp.

Referenced by science_report_dialog_popup(), and top_bar_left_click_science().

◆ locate_goal

void science_report::locate_goal ( )
privateslot

Locate technology goal in tree and scroll so that it is visible.

Definition at line 633 of file view_research.cpp.

Referenced by science_report().

◆ locate_researching

void science_report::locate_researching ( )
privateslot

Locate the currently researched technology in tree and scroll so that it is visible.

Definition at line 647 of file view_research.cpp.

Referenced by science_report().

◆ push_research

void science_report::push_research ( )
privateslot

Push (redo) research when qty bulbs researched is greater than the number needed.

Definition at line 622 of file view_research.cpp.

Referenced by science_report().

◆ redraw()

void science_report::redraw ( )

Schedules paint event in some qt queue.

Definition at line 391 of file view_research.cpp.

Referenced by science_report_dialog_popup(), and science_report_dialog_redraw().

◆ reset_tree()

void science_report::reset_tree ( )

Recalculates research diagram again and updates science report.

Definition at line 396 of file view_research.cpp.

Referenced by tileset_changed().

◆ scroll_reqtree_to_tech()

void science_report::scroll_reqtree_to_tech ( Tech_type_id  id)
private

Scroll the science tree to display the technology identified by tech id.

Definition at line 578 of file view_research.cpp.

Referenced by locate_goal(), and locate_researching().

◆ update_report()

void science_report::update_report ( )

Updates all important widgets on science_report.

Collect all techs which are reachable in the next step.

Collect all techs which are reachable in next 10 steps.

sort both lists

fill combo boxes

set current tech and goal

Definition at line 408 of file view_research.cpp.

Referenced by init(), real_science_report_dialog_update(), and tileset_changed().

◆ update_reqtree()

void science_report::update_reqtree ( )
private

Calls update for research_diagram.

Definition at line 573 of file view_research.cpp.

Referenced by update_report().

Member Data Documentation

◆ curr_list

QList<qlist_item>* science_report::curr_list {nullptr}
private

Definition at line 85 of file view_research.h.

Referenced by update_report(), and ~science_report().

◆ goal_combo

QComboBox* science_report::goal_combo
private

Definition at line 77 of file view_research.h.

Referenced by goal_tech_changed(), science_report(), and update_report().

◆ goal_list

QList<qlist_item>* science_report::goal_list {nullptr}
private

Definition at line 86 of file view_research.h.

Referenced by update_report(), and ~science_report().

◆ index

int science_report::index {0}
private

Definition at line 99 of file view_research.h.

Referenced by init().

◆ info_label

QLabel* science_report::info_label
private

Definition at line 83 of file view_research.h.

Referenced by science_report(), and update_report().

◆ locate_goal_but

QToolButton* science_report::locate_goal_but
private

Definition at line 81 of file view_research.h.

Referenced by science_report(), and update_report().

◆ locate_researching_but

QToolButton* science_report::locate_researching_but
private

Definition at line 80 of file view_research.h.

Referenced by science_report(), and update_report().

◆ progress

progress_bar* science_report::progress
private

Definition at line 82 of file view_research.h.

Referenced by science_report(), and update_report().

◆ progress_label

QLabel* science_report::progress_label
private

Definition at line 84 of file view_research.h.

Referenced by science_report(), and update_report().

◆ refresh_but

QPushButton* science_report::refresh_but
private

Definition at line 79 of file view_research.h.

Referenced by science_report(), and update_report().

◆ res_diag

research_diagram* science_report::res_diag
private

◆ researching_combo

QComboBox* science_report::researching_combo
private

Definition at line 78 of file view_research.h.

Referenced by current_tech_changed(), science_report(), and update_report().

◆ scroll

QScrollArea* science_report::scroll
private

Definition at line 76 of file view_research.h.

Referenced by science_report(), and scroll_reqtree_to_tech().