• 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
infoboxwidget.h
Go to the documentation of this file.
1 /***************************************************************************
2  fovwidget.cpp - description
3  -------------------
4  begin : 20 Aug 2009
5  copyright : (C) 2009 by Khudyakov Alexey
6  email : alexey.skladnoy@gmail.com
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 #ifndef INFOBOXWIDGET_H_
19 #define INFOBOXWIDGET_H_
20 
21 #include <QWidget>
22 #include <QPoint>
23 #include <QList>
24 #include <QString>
25 #include <QStringList>
26 
27 class SkyPoint;
28 class SkyObject;
29 class InfoBoxWidget;
30 
31 class InfoBoxes : public QWidget
32 {
33  Q_OBJECT
34 public:
35 
36  explicit InfoBoxes(QWidget* parent = 0);
37  virtual ~InfoBoxes();
38 
39  void addInfoBox(InfoBoxWidget* ibox);
40  QList<InfoBoxWidget*> getInfoBoxes() const { return m_boxes; }
41 protected:
42  virtual void resizeEvent(QResizeEvent * event);
43 private:
44  QList<InfoBoxWidget*> m_boxes;
45 };
46 
48 class InfoBoxWidget : public QWidget
49 {
50  Q_OBJECT
51 public:
53  enum {
54  NoAnchor = 0,
55  AnchorRight = 1,
56  AnchorBottom = 2,
57  AnchorBoth = 3
58  };
59 
61  InfoBoxWidget(bool shade, const QPoint& pos, int anchor = 0, const QStringList& str = QStringList(), QWidget* parent = 0);
63  virtual ~InfoBoxWidget();
64 
66  bool shaded() const { return m_shaded; }
68  int sticky() const { return m_anchor; }
69 
71  void adjust();
72 
73 public slots:
75  void slotTimeChanged();
77  void slotGeoChanged();
79  void slotObjectChanged(SkyObject* obj);
81  void slotPointChanged(SkyPoint* p);
82 signals:
84  void clicked();
85 protected:
86  virtual void paintEvent(QPaintEvent* event);
87  virtual void mouseDoubleClickEvent(QMouseEvent* event );
88  virtual void mousePressEvent(QMouseEvent* event);
89  virtual void mouseMoveEvent(QMouseEvent* event );
90  virtual void mouseReleaseEvent(QMouseEvent* event);
91  virtual void showEvent(QShowEvent* event);
92 private:
94  void setPoint(QString name, SkyPoint* p);
96  void updateSize();
97 
98  QStringList m_strings; // list of string to show
99  bool m_adjusted; // True if widget coordinates were adjusted
100  bool m_grabbed; // True if widget is dragged around
101  bool m_shaded; // True if widget if shaded
102  int m_anchor; // Vertical alignment of widget
103 
104  static const int padX;
105  static const int padY;
106 };
107 
108 #endif /* INFOBOXWIDGET_H_ */
InfoBoxWidget::mouseMoveEvent
virtual void mouseMoveEvent(QMouseEvent *event)
Definition: infoboxwidget.cpp:197
InfoBoxWidget::NoAnchor
Definition: infoboxwidget.h:54
QWidget
InfoBoxWidget::slotGeoChanged
void slotGeoChanged()
Set information about location.
Definition: infoboxwidget.cpp:103
InfoBoxWidget::paintEvent
virtual void paintEvent(QPaintEvent *event)
Definition: infoboxwidget.cpp:166
InfoBoxes
Definition: infoboxwidget.h:31
InfoBoxWidget::AnchorRight
Definition: infoboxwidget.h:55
InfoBoxWidget::mousePressEvent
virtual void mousePressEvent(QMouseEvent *event)
Definition: infoboxwidget.cpp:226
InfoBoxes::getInfoBoxes
QList< InfoBoxWidget * > getInfoBoxes() const
Definition: infoboxwidget.h:40
InfoBoxes::addInfoBox
void addInfoBox(InfoBoxWidget *ibox)
Definition: infoboxwidget.cpp:38
SkyPoint
The sky coordinates of a point in the sky.
Definition: skypoint.h:50
InfoBoxWidget::adjust
void adjust()
Adjust widget's postion.
Definition: infoboxwidget.cpp:138
InfoBoxWidget::AnchorBoth
Definition: infoboxwidget.h:57
InfoBoxWidget::AnchorBottom
Definition: infoboxwidget.h:56
InfoBoxes::InfoBoxes
InfoBoxes(QWidget *parent=0)
Definition: infoboxwidget.cpp:33
InfoBoxWidget::~InfoBoxWidget
virtual ~InfoBoxWidget()
Destructor.
Definition: infoboxwidget.cpp:63
InfoBoxWidget::sticky
int sticky() const
Get stickyness status of.
Definition: infoboxwidget.h:68
InfoBoxWidget::mouseDoubleClickEvent
virtual void mouseDoubleClickEvent(QMouseEvent *event)
Definition: infoboxwidget.cpp:235
InfoBoxes::~InfoBoxes
virtual ~InfoBoxes()
Definition: infoboxwidget.cpp:30
InfoBoxWidget
Small optianally transparent box for display of text messages.
Definition: infoboxwidget.h:48
InfoBoxWidget::mouseReleaseEvent
virtual void mouseReleaseEvent(QMouseEvent *event)
Definition: infoboxwidget.cpp:241
InfoBoxWidget::InfoBoxWidget
InfoBoxWidget(bool shade, const QPoint &pos, int anchor=0, const QStringList &str=QStringList(), QWidget *parent=0)
Create one infobox.
Definition: infoboxwidget.cpp:51
InfoBoxWidget::shaded
bool shaded() const
Check whether box is shaded.
Definition: infoboxwidget.h:66
InfoBoxWidget::slotPointChanged
void slotPointChanged(SkyPoint *p)
Set information about pointing.
Definition: infoboxwidget.cpp:121
InfoBoxWidget::clicked
void clicked()
Emitted when widget is clicked.
InfoBoxWidget::slotObjectChanged
void slotObjectChanged(SkyObject *obj)
Set information about object.
Definition: infoboxwidget.cpp:117
InfoBoxes::resizeEvent
virtual void resizeEvent(QResizeEvent *event)
Definition: infoboxwidget.cpp:44
InfoBoxWidget::slotTimeChanged
void slotTimeChanged()
Set information about time.
Definition: infoboxwidget.cpp:77
SkyObject
Provides all necessary information about an object in the sky: its coordinates, name(s), type, magnitude, and QStringLists of URLs for images and webpages regarding the object.
Definition: skyobject.h:46
QList
InfoBoxWidget::showEvent
virtual void showEvent(QShowEvent *event)
Definition: infoboxwidget.cpp:230
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:20 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