• 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
  • tools
  • whatsinteresting
skyobjlistmodel.h
Go to the documentation of this file.
1 /***************************************************************************
2  skyobjlistmodel.h - K Desktop Planetarium
3  -------------------
4  begin : 2012/26/05
5  copyright : (C) 2012 by Samikshan Bairagya
6  email : samikshan@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 SKYOBJ_LISTMODEL_H
19 #define SKYOBJ_LISTMODEL_H
20 
21 #include "qabstractitemmodel.h"
22 #include "skyobject.h"
23 #include "skyobjitem.h"
24 
30 class SkyObjListModel : public QAbstractListModel
31 {
32  Q_OBJECT
33 public:
37  explicit SkyObjListModel(SkyObjItem *soitem = 0, QObject *parent = 0);
38 
43  void addSkyObject(SkyObjItem *sobj);
44 
49  int rowCount(const QModelIndex& parent = QModelIndex()) const;
50 
55  QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
56 
61  QList<SkyObjItem *> getSkyObjItems();
62 
67  SkyObjItem *getSkyObjItem(int index);
68 
72  void resetModel();
73 
74 private:
75  QList<SkyObjItem *> m_SoItemList;
76 };
77 
78 #endif
SkyObjListModel::addSkyObject
void addSkyObject(SkyObjItem *sobj)
Add a sky-object to the model.
Definition: skyobjlistmodel.cpp:25
SkyObjItem
Represents an item in the list of interesting sky-objects.
Definition: skyobjitem.h:29
skyobject.h
SkyObjListModel::resetModel
void resetModel()
Erase all data in model.
Definition: skyobjlistmodel.cpp:57
SkyObjListModel
Represents a model for the list of interesting sky-objects to be displayed in the QML interface...
Definition: skyobjlistmodel.h:30
QAbstractListModel
SkyObjListModel::getSkyObjItem
SkyObjItem * getSkyObjItem(int index)
Get sky-object item referred to by index.
Definition: skyobjlistmodel.cpp:52
QObject
SkyObjListModel::getSkyObjItems
QList< SkyObjItem * > getSkyObjItems()
Get the list of sky-object items in the model.
Definition: skyobjlistmodel.cpp:47
skyobjitem.h
SkyObjListModel::data
QVariant data(const QModelIndex &index, int role=Qt::DisplayRole) const
Overriden method from QAbstractItemModel.
Definition: skyobjlistmodel.cpp:37
SkyObjListModel::rowCount
int rowCount(const QModelIndex &parent=QModelIndex()) const
Overridden method from QAbstractItemModel.
Definition: skyobjlistmodel.cpp:32
SkyObjListModel::SkyObjListModel
SkyObjListModel(SkyObjItem *soitem=0, QObject *parent=0)
Constructor.
Definition: skyobjlistmodel.cpp:20
QList
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:36:21 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