Freeciv-3.1: map_view Class Reference

Freeciv-3.1

Loading...
Searching...
No Matches
Public Member Functions | Data Fields | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes
map_view Class Reference

`#include <mapview.h>`

Inheritance diagram for map_view:

## Public Member Functions

| map_view ()
void | paint (QPainter *painter, QPaintEvent *event)
void | find_place (int pos_x, int pos_y, int &w, int &h, int wdth, int hght, int recursive_nr)
void | resume_searching (int pos_x, int pos_y, int &w, int &h, int wdth, int hght, int recursive_nr)
void | update_cursor (enum cursor_type)

## Data Fields

bool | menu_click

## Protected Member Functions

void | paintEvent (QPaintEvent *event)
void | keyPressEvent (QKeyEvent *event)
void | mousePressEvent (QMouseEvent *event)
void | mouseReleaseEvent (QMouseEvent *event)
void | mouseMoveEvent (QMouseEvent *event)
void | focusOutEvent (QFocusEvent *event)
void | leaveEvent (QEvent *event)

## Private Slots

void | timer_event ()

## Private Member Functions

void | shortcut_pressed (int key)
void | shortcut_released (Qt::MouseButton mb)
void | update_font (const QString &name, const QFont &font)

## Private Attributes

bool | stored_autocenter
int | cursor_frame
int | cursor

## Detailed Description

Definition at line 79 of file mapview.h.

## Constructor & Destructor Documentation

## ◆ map_view()

map_view::map_view | ( |  | ) |

Constructor for map

Definition at line 195 of file mapview.cpp.

## Member Function Documentation

## ◆ find_place()

void map_view::find_place | ( | int | pos_x,
|  | int | pos_y,
|  | int & | w,
|  | int & | h,
|  | int | wdth,
|  | int | hght,
|  | int | recursive_nr
| ) |  |

Searches place for widget with size w and height h Starts looking from position pos_x, pos_y, going clockwork Returns position as (w,h) Along with resume_searching its recursive function.

give up searching position

try position pos_x, pos_y, check middle and borders if aren't above other widget

Definition at line 327 of file mapview.cpp.

Referenced by resume_searching().

## ◆ focusOutEvent()

void map_view::focusOutEvent | ( | QFocusEvent * | event | ) |

protected

Focus lost event

Definition at line 262 of file mapview.cpp.

## ◆ keyPressEvent()

void map_view::keyPressEvent | ( | QKeyEvent * | event | ) |

protected

Keyboard handler for map_view

Definition at line 119 of file mapctrl.cpp.

## ◆ leaveEvent()

void map_view::leaveEvent | ( | QEvent * | event | ) |

protected

Leave event

Definition at line 270 of file mapview.cpp.

## ◆ mouseMoveEvent()

void map_view::mouseMoveEvent | ( | QMouseEvent * | event | ) |

protected

Mouse movement handler for map_view

Definition at line 537 of file mapctrl.cpp.

## ◆ mousePressEvent()

void map_view::mousePressEvent | ( | QMouseEvent * | event | ) |

protected

Mouse buttons handler for map_view

Definition at line 521 of file mapctrl.cpp.

## ◆ mouseReleaseEvent()

void map_view::mouseReleaseEvent | ( | QMouseEvent * | event | ) |

protected

Mouse release event for map_view

Definition at line 529 of file mapctrl.cpp.

## ◆ paint()

void map_view::paint | ( | QPainter * | painter,
|  | QPaintEvent * | event
| ) |  |

Redraws given rectangle on map

Definition at line 290 of file mapview.cpp.

Referenced by paintEvent().

## ◆ paintEvent()

void map_view::paintEvent | ( | QPaintEvent * | event | ) |

protected

Slot inherited from QPixamp

Definition at line 278 of file mapview.cpp.

## ◆ resume_searching()

void map_view::resume_searching | ( | int | pos_x,
|  | int | pos_y,
|  | int & | w,
|  | int & | h,
|  | int | wdth,
|  | int | hght,
|  | int | recursive_nr
| ) |  |

Sets new point for new search

Definition at line 300 of file mapview.cpp.

Referenced by find_place().

## ◆ shortcut_pressed()

void map_view::shortcut_pressed | ( | int | key | ) |

private

Pressed mouse or keyboard

Definition at line 214 of file mapctrl.cpp.

Referenced by keyPressEvent(), and mousePressEvent().

## ◆ shortcut_released()

void map_view::shortcut_released | ( | Qt::MouseButton | bt | ) |

private

Released mouse buttons

Definition at line 483 of file mapctrl.cpp.

Referenced by mouseReleaseEvent().

## ◆ timer_event

void map_view::timer_event | ( |  | ) |

privateslot

Timer for cursor

Definition at line 230 of file mapview.cpp.

Referenced by map_view().

## ◆ update_cursor()

void map_view::update_cursor | ( | enum cursor_type | ct | ) |

Updates cursor

Definition at line 212 of file mapview.cpp.

Referenced by focusOutEvent(), leaveEvent(), and timer_event().

## ◆ update_font()

void map_view::update_font | ( | const QString & | name,
|  | const QFont & | font
| ) |  |

private

Updates fonts

Definition at line 251 of file mapview.cpp.

## Field Documentation

## ◆ cursor

int map_view::cursor

private

Definition at line 109 of file mapview.h.

Referenced by map_view(), timer_event(), and update_cursor().

## ◆ cursor_frame

int map_view::cursor_frame

private

Definition at line 108 of file mapview.h.

Referenced by timer_event(), and update_cursor().

## ◆ menu_click

bool map_view::menu_click

Definition at line 92 of file mapview.h.

Referenced by map_view(), and shortcut_released().

## ◆ stored_autocenter

bool map_view::stored_autocenter

private

Definition at line 107 of file mapview.h.

Referenced by map_view(), shortcut_pressed(), and shortcut_released().