• 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 | List of all members
LocationDialog Class Reference

#include <locationdialog.h>

Inheritance diagram for LocationDialog:
Inheritance graph
[legend]

Public Slots

bool addCity ()
 
void changeCity ()
 
void clearFields ()
 
void dataChanged ()
 
void enqueueFilterCity ()
 
void filterCity ()
 
void nameChanged ()
 
void showTZRules ()
 
void slotOk ()
 

Public Member Functions

 LocationDialog (QWidget *parent)
 
 ~LocationDialog ()
 
bool addCityEnabled ()
 
QList< GeoLocation * > filteredList ()
 
void findCitiesNear (int longitude, int latitude)
 
void initCityList (void)
 
GeoLocation * selectedCity () const
 
QString selectedCityName (void) const
 
QString selectedCountryName (void) const
 
QString selectedProvinceName (void) const
 

Detailed Description

Dialog for changing the geographic location of the observer.

The dialog is divided into two sections.

The top section allows the location to be selected from a database of 2000 cities. It contains a MapCanvas (showing map of the globe with cities overlaid, with a handler for mouse clicks), a QListBox containing the names of cities in the database, and three KLineEdit widgets, which allow the user to filter the List by the name of the City, Province, and Country. In addition, the List can be filtered by location, by clicking anywhere in the MapCanvas. Doing so will display cities within 2 degrees of the clicked position.

The bottom section allows the location to be specified manually. The Longitude, Latitude, City name, Province/State name, and Country name are entered into KLineEdits. There is also a QPushButton for adding the location to the custom Cities database. If the user selects "Add" without filling in all of the manual entry fields, an error message is displayed. Geographic Location dialog

Author
Jason Harris
Version
1.0

Definition at line 57 of file locationdialog.h.

Constructor & Destructor Documentation

LocationDialog::LocationDialog ( QWidget *  parent)
explicit

Constructor.

Create all widgets, and pack them into QLayouts. Connect Signals to Slots. Run initCityList().

Definition at line 33 of file locationdialog.cpp.

LocationDialog::~LocationDialog ( )

Destructor (empty)

Definition at line 89 of file locationdialog.cpp.

Member Function Documentation

bool LocationDialog::addCity ( )
slot

When the "Add new city" QPushButton is clicked, add the manually-entered city information to the user's custom city database.

Returns
true on success

Definition at line 218 of file locationdialog.cpp.

bool LocationDialog::addCityEnabled ( )
Returns
true if the AddCityBUtton is enabled

Definition at line 437 of file locationdialog.cpp.

void LocationDialog::changeCity ( )
slot

When the selected city in the QListBox changes, repaint the MapCanvas so that the crosshairs icon appears on the newly selected city.

Definition at line 174 of file locationdialog.cpp.

void LocationDialog::clearFields ( )
slot

Definition at line 351 of file locationdialog.cpp.

void LocationDialog::dataChanged ( )
slot

Definition at line 425 of file locationdialog.cpp.

void LocationDialog::enqueueFilterCity ( )
slot

Filter by city / province / country only after a few milliseconds.

Definition at line 126 of file locationdialog.cpp.

void LocationDialog::filterCity ( )
slot

When text is entered in the City/Province/Country Filter KLineEdits, the List of cities is trimmed to show only cities beginning with the entered text.

Also, the QMemArray of ID numbers is kept in sync with the filtered list.

Definition at line 137 of file locationdialog.cpp.

QList<GeoLocation*> LocationDialog::filteredList ( )
inline
Returns
pointer to the List of filtered city pointers.

Definition at line 79 of file locationdialog.h.

void LocationDialog::findCitiesNear ( int  longitude,
int  latitude 
)

Show only cities within 3 degrees of point specified by arguments.

Parameters
longitudethe longitude of the search point (int)
latitudethe latitude of the search point (int)

Definition at line 308 of file locationdialog.cpp.

void LocationDialog::initCityList ( void  )

Initialize list of cities.

Note that the database is not read in here, that is done in the KStars constructor. This simply loads the local QListBox with the names of the cities from the kstarsData object.

Definition at line 93 of file locationdialog.cpp.

void LocationDialog::nameChanged ( )
slot

Definition at line 419 of file locationdialog.cpp.

GeoLocation* LocationDialog::selectedCity ( ) const
inline
Returns
pointer to the highlighted city in the List.

Definition at line 76 of file locationdialog.h.

QString LocationDialog::selectedCityName ( void  ) const
inline
Returns
the city name of the selected location.

Definition at line 89 of file locationdialog.h.

QString LocationDialog::selectedCountryName ( void  ) const
inline
Returns
the country name of the selected location.

Definition at line 95 of file locationdialog.h.

QString LocationDialog::selectedProvinceName ( void  ) const
inline
Returns
the province name of the selected location.

Definition at line 92 of file locationdialog.h.

void LocationDialog::showTZRules ( )
slot

Definition at line 368 of file locationdialog.cpp.

void LocationDialog::slotOk ( )
slot

Definition at line 432 of file locationdialog.cpp.


The documentation for this class was generated from the following files:
  • locationdialog.h
  • locationdialog.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