• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

MapCanvas Class Reference

Used in LocationDialog for displaying a map of the Earth. More...

#include <mapcanvas.h>

Inheritance diagram for MapCanvas:

Inheritance graph
[legend]

List of all members.


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.

Author:
Jason Harris
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 (  ) 

Destructor (empty).

Definition at line 40 of file mapcanvas.cpp.


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 widget y the y-position of the widget w the width of the widget h 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:
  • mapcanvas.h
  • mapcanvas.cpp

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal