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

kstars

  • sources
  • kde-4.12
  • kdeedu
  • kstars
  • kstars
  • widgets
fovwidget.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  fovwidget.cpp - description
3  -------------------
4  begin : Sat 22 Sept 2007
5  copyright : (C) 2007 by Jason Harris
6  email : kstars@30doradus.org
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #include "fovwidget.h"
19 #include "dialogs/fovdialog.h"
20 #include "fov.h"
21 
22 #include <QPaintEvent>
23 #include <QPainter>
24 
25 FOVWidget::FOVWidget( QWidget *parent ) : QFrame( parent ), m_FOV(0)
26 {}
27 
28 FOVWidget::~FOVWidget()
29 {}
30 
31 void FOVWidget::setFOV( FOV *f ) {
32  m_FOV = f;
33 }
34 
35 void FOVWidget::paintEvent( QPaintEvent * ) {
36  QPainter p;
37  p.begin( this );
38  p.setRenderHint( QPainter::Antialiasing, true );
39  p.fillRect( contentsRect(), QColor( "black" ) );
40 
41  if( m_FOV && m_FOV->sizeX() > 0 && m_FOV->sizeY() > 0 ) {
42  m_FOV->draw(p, 0.6*contentsRect().width(), 0.6*contentsRect().height() );
43  QFont smallFont = p.font();
44  smallFont.setPointSize( p.font().pointSize() - 2 );
45  p.setFont( smallFont );
46  // TODO: Check if decimal points in this are localized (eg: It should read 1,5 x 1,5 in German rather than 1.5 x 1.5)
47  p.drawText( rect(), Qt::AlignHCenter|Qt::AlignBottom,
48  i18nc("angular size in arcminutes", "%1 x %2 arcmin",
49  QString::number( m_FOV->sizeX(), 'f', 1 ),
50  QString::number( m_FOV->sizeY(), 'f', 1 ) ) );
51  }
52 
53  p.end();
54 }
55 
56 #include "fovwidget.moc"
FOV
class encapulating a Field-of-View symbol
Definition: fov.h:32
FOV::sizeX
float sizeX() const
Definition: fov.h:53
QWidget
FOVWidget::setFOV
void setFOV(FOV *f)
Definition: fovwidget.cpp:31
FOVWidget::FOVWidget
FOVWidget(QWidget *parent=0)
Definition: fovwidget.cpp:25
fovdialog.h
fovwidget.h
fov.h
NaN::f
const float f
Definition: nan.h:36
i18nc
i18nc("string from libindi, used in the config dialog","100x")
FOV::draw
void draw(QPainter &p, float zoomFactor)
draw the FOV symbol on a QPainter
Definition: fov.cpp:57
FOVWidget::~FOVWidget
~FOVWidget()
Definition: fovwidget.cpp:28
FOVWidget::paintEvent
void paintEvent(QPaintEvent *e)
Definition: fovwidget.cpp:35
QFrame
FOV::sizeY
float sizeY() const
Definition: fov.h:54
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:19 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