• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kstars

Public Slots | Public Member Functions | Protected Member Functions | List of all members
MapCanvas Class Reference

#include <mapcanvas.h>

Inheritance diagram for MapCanvas:
Inheritance graph
[legend]

Public Slots

virtual void setGeometry (int x, int y, int w, int h)
 
virtual void setGeometry (const QRect &r)
 

Public Member Functions

 MapCanvas (QWidget *parent)
 
 ~MapCanvas ()
 
void setLocationDialog (LocationDialog *loc)
 

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)
explicit

Default constructor.

Initialize the widget: create pixmaps, load the world map image

Parameters
parentpointer to the parent LocationDialog

Definition at line 32 of file mapcanvas.cpp.

MapCanvas::~MapCanvas ( )

Destructor (empty)

Definition at line 45 of file mapcanvas.cpp.

Member Function Documentation

void MapCanvas::mousePressEvent ( QMouseEvent *  e)
protectedvirtual

Trim the list of cities so that only those within 2 degrees of the mouse click are shown in the list.

See also
LocationDialog

Definition at line 61 of file mapcanvas.cpp.

void MapCanvas::paintEvent ( QPaintEvent *  e)
protectedvirtual

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

Definition at line 70 of file mapcanvas.cpp.

void MapCanvas::setGeometry ( int  x,
int  y,
int  w,
int  h 
)
virtualslot

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

Definition at line 49 of file mapcanvas.cpp.

void MapCanvas::setGeometry ( const QRect &  r)
virtualslot

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

Definition at line 55 of file mapcanvas.cpp.

void MapCanvas::setLocationDialog ( LocationDialog *  loc)
inline

Set location dialog.

Definition at line 53 of file mapcanvas.h.


The documentation for this class was generated from the following files:
  • mapcanvas.h
  • mapcanvas.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:22 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kstars

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

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal