kstars
MapCanvas Class Reference
Used in LocationDialog for displaying a map of the Earth. More...
#include <mapcanvas.h>

Public Slots | |
virtual void | setGeometry (const QRect &r) |
virtual void | setGeometry (int x, int y, int w, int h) |
Public Member Functions | |
MapCanvas (QWidget *parent=0, const char *name=0) | |
~MapCanvas () | |
Protected Member Functions | |
virtual void | mousePressEvent (QMouseEvent *e) |
virtual void | paintEvent (QPaintEvent *e) |
Detailed Description
Used in LocationDialog for displaying a map of the Earth.In addition, cities in the database are drawn as grey or white dots. Also, the widget processes mouse clicks, to trim the list of cities to those near the mouse click. Widget used in the LocationDialog for displaying the world map.
- Version:
- 1.0
Definition at line 39 of file mapcanvas.h.
Constructor & Destructor Documentation
MapCanvas::MapCanvas | ( | QWidget * | parent = 0 , |
|
const char * | name = 0 | |||
) |
Default constructor.
Initialize the widget: create pixmaps, load the world map bitmap, set pointers to the main window and the LocationDialog parent.
Definition at line 28 of file mapcanvas.cpp.
MapCanvas::~MapCanvas | ( | ) |
Member Function Documentation
void MapCanvas::mousePressEvent | ( | QMouseEvent * | e | ) | [protected, virtual] |
Trim the list of cities so that only those within 2 degrees of the mouse click are shown in the list.
- See also:
- LocationDialog
Reimplemented from QWidget.
Definition at line 59 of file mapcanvas.cpp.
void MapCanvas::paintEvent | ( | QPaintEvent * | e | ) | [protected, virtual] |
Draw the map.
Draw grey dots on the locations of all cities, and highlight the cities which match the current filters as white dits. Also draw a red crosshairs on the currently-selected city.
- See also:
- LocationDialog
Reimplemented from QWidget.
Definition at line 69 of file mapcanvas.cpp.
void MapCanvas::setGeometry | ( | const QRect & | r | ) | [virtual, slot] |
Set the geometry of the map widget (overloaded from QWidget).
Resizes the size of the map pixmap to match the widget, and resets the Origin QPoint so it remains at the center of the widget. This function behaves just like the above function. It differs only in the data type of its argument.
- Note:
- this is called automatically by resize events.
r
QRect describing geometry
Reimplemented from QWidget.
Definition at line 52 of file mapcanvas.cpp.
void MapCanvas::setGeometry | ( | int | x, | |
int | y, | |||
int | w, | |||
int | h | |||
) | [virtual, slot] |
Set the geometry of the map widget (overloaded from QWidget).
Resizes the size of the map pixmap to match the widget, and resets the Origin QPoint so it remains at the center of the widget.
- Note:
- this is called automatically by resize events.
x
the x-position of the widgety
the y-position of the widgetw
the width of the widgeth
the height of the widget
Reimplemented from QWidget.
Definition at line 45 of file mapcanvas.cpp.
The documentation for this class was generated from the following files: