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

kstars

Public Member Functions | Protected Member Functions | Properties | List of all members
dmsBox Class Reference

#include <dmsbox.h>

Inheritance diagram for dmsBox:
Inheritance graph
[legend]

Public Member Functions

 dmsBox (QWidget *parent, bool deg=true)
 
 ~dmsBox ()
 
void clearFields (void)
 
dms createDms (bool deg=true, bool *ok=0)
 
bool degType (void) const
 
bool isEmpty ()
 
void setDegType (bool t)
 
void setDMS (const QString &s)
 
void show (dms t, bool deg=true)
 
void show (const dms *t, bool deg=true)
 
void showInDegrees (dms t)
 
void showInDegrees (const dms *t)
 
void showInHours (dms t)
 
void showInHours (const dms *t)
 

Protected Member Functions

void focusInEvent (QFocusEvent *e)
 
void focusOutEvent (QFocusEvent *e)
 

Properties

bool degType
 

Detailed Description

A KLineEdit which is capable of displaying and parsing angle values flexibly and robustly.

Angle values can be displayed and parsed as Degrees or Hours. When displaying a value, it uses a space-delimited triplet of integers representing the degrees, arcminutes, and arcseconds of the angle (or hours, minutes, seconds). For example, "-34 45 57". When parsing a value input by the user, it can also understand a number of other formats:

  • colon-delimited fields ("-34:45:57")
  • one or two fields ("-35"; "-34 46")
  • fields with unit-labels ("-34d 45m 57s")
  • floating-point numbers ("-34.76583")
Note
Inherits KLineEdit.
Author
Pablo de Vicente
Version
1.0

Definition at line 44 of file dmsbox.h.

Constructor & Destructor Documentation

dmsBox::dmsBox ( QWidget *  parent,
bool  deg = true 
)
explicit

Constructor for the dmsBox object.

Parameters
parentpointer to the parent QWidget
degif true use deg/arcmin/arcsec; otherwise use hours/min/sec.

Definition at line 29 of file dmsbox.cpp.

dmsBox::~dmsBox ( )

Destructor (empty)

Definition at line 173 of file dmsbox.cpp.

Member Function Documentation

void dmsBox::clearFields ( void  )
inline

Clears the KLineEdit.

Definition at line 128 of file dmsbox.h.

dms dmsBox::createDms ( bool  deg = true,
bool *  ok = 0 
)

Parse the text in the dmsBox as an angle.

The text may be an integer or double value, or it may be a triplet of integer values (separated by spaces or colons) representing deg/hrs, min, sec. It is also possible to have two fields. In this case, if the second field is a double, it is converted to decimal min and double sec.

Parameters
degif true use deg/arcmin/arcsec; otherwise use hours/min/sec.
okset to true if a dms object was succedssfully created.
Returns
a dms object constructed from the fields of the dmsbox

Definition at line 163 of file dmsbox.cpp.

bool dmsBox::degType ( void  ) const
inline
Returns
a boolean indicating if object contains degrees or hours

Definition at line 118 of file dmsbox.h.

void dmsBox::focusInEvent ( QFocusEvent *  e)
protected

Definition at line 60 of file dmsbox.cpp.

void dmsBox::focusOutEvent ( QFocusEvent *  e)
protected

Definition at line 70 of file dmsbox.cpp.

bool dmsBox::isEmpty ( )
inline

Definition at line 130 of file dmsbox.h.

void dmsBox::setDegType ( bool  t)

set the dmsBox to Degrees or Hours

Parameters
tif true, the box expects angle values in degrees; otherwise it expects values in hours

Definition at line 90 of file dmsbox.cpp.

void dmsBox::setDMS ( const QString &  s)
inline

Simply display a string.

Note
JH: Why don't we just use KLineEdit::setText() instead?
Parameters
sthe string to display (it need not be a valid angle value).

Definition at line 102 of file dmsbox.h.

void dmsBox::show ( dms  t,
bool  deg = true 
)

Display an angle.

Simply calls showInDegrees(t) or showInHours(t) depending on the value of deg.

Parameters
tthe dms object which is to be displayed.
degif true, display Deg/Arcmin/Arcsec; otherwise display Hours/Min/Sec.

Definition at line 155 of file dmsbox.cpp.

void dmsBox::show ( const dms *  t,
bool  deg = true 
)

Display an angle.

Simply calls showInDegrees(t) or showInHours(t) depending on the value of deg. This behaves essentially like the above function. It differs only in the data type of its argument.

Parameters
tthe dms object which is to be displayed.
degif true, display Deg/Arcmin/Arcsec; otherwise display Hours/Min/Sec.

Definition at line 154 of file dmsbox.cpp.

void dmsBox::showInDegrees ( dms  t)

Display an angle using Deg/Arcmin/Arcsec.

t the dms object which is to be displayed

Definition at line 141 of file dmsbox.cpp.

void dmsBox::showInDegrees ( const dms *  t)

Display an angle using Deg/Arcmin/Arcsec.

This behaves just like the above function. It differs only in the data type of the argument. t pointer to the dms object which is to be displayed

Definition at line 140 of file dmsbox.cpp.

void dmsBox::showInHours ( dms  t)

Display an angle using Hours/Min/Sec.

t the dms object which is to be displayed

Definition at line 148 of file dmsbox.cpp.

void dmsBox::showInHours ( const dms *  t)

Display an angle using Hours/Min/Sec.

This behaves just like the above function. It differs only in the data type of the argument. t pointer to the dms object which is to be displayed

Definition at line 147 of file dmsbox.cpp.

Property Documentation

bool dmsBox::degType
readwrite

Definition at line 46 of file dmsbox.h.


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