• 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
  • indi
indigroup.cpp
Go to the documentation of this file.
1 /* INDI Group
2  Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
3 
4  This application is free software; you can redistribute it and/or
5  modify it under the terms of the GNU General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  JM Changelog
10  2004-16-1: Start
11 
12  */
13 
14 #include "indigroup.h"
15 #include "indiproperty.h"
16 #include "indidevice.h"
17 
18 #include <klocale.h>
19 #include <kdialog.h>
20 
21 #include <QFrame>
22 #include <QTimer>
23 #include <QTabWidget>
24 #include <QVBoxLayout>
25 #include <QDebug>
26 
27 /*******************************************************************
28 ** INDI Group: a tab widget for common properties. All properties
29 ** belong to a group, whether they have one or not but how the group
30 ** is displayed differs
31 *******************************************************************/
32 INDI_G::INDI_G(INDI_D *idv, const QString &inName)
33 {
34  dp = idv;
35  name = inName;
36 
37  propertyContainer = new QFrame();
38  propertyLayout = new QVBoxLayout(propertyContainer);
39  propertyLayout->setMargin(20);
40  propertyLayout->setSpacing(KDialog::spacingHint());
41  VerticalSpacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
42 
43  propertyLayout->addItem(VerticalSpacer);
44 
45  //dp->groupContainer->addTab(propertyContainer, name);
46 }
47 
48 INDI_G::~INDI_G()
49 {
50  while ( ! propList.isEmpty() ) delete propList.takeFirst();
51 
52  delete(propertyContainer);
53 }
54 
55 bool INDI_G::addProperty(INDI::Property *prop)
56 {
57  QString propName(prop->getName());
58 
59  INDI_P * pp = getProperty(propName);
60 
61  if (pp)
62  return false;
63 
64  pp = new INDI_P(this, prop);
65  propList.append(pp);
66 
67  propertyLayout->removeItem(VerticalSpacer);
68  propertyLayout->addLayout(pp->getContainer());
69  propertyLayout->addItem(VerticalSpacer);
70 
71  return true;
72 }
73 
74 bool INDI_G::removeProperty(const QString &probName)
75 {
76 
77 
78  foreach(INDI_P * pp, propList)
79  {
80  if (pp->getName() == probName)
81  {
82  propList.removeOne(pp);
83  propertyLayout->removeItem(pp->getContainer());
84  //qDebug() << "Removing GUI property " << probName << " from gorup " << name << " with size " << propList.size() << " and count " << propList.count() << endl;
85  delete (pp);
86  return true;
87  }
88  }
89 
90 
91  return false;
92 }
93 
94 INDI_P * INDI_G::getProperty(const QString & propName)
95 {
96 
97  foreach(INDI_P *pp, propList)
98  {
99  if (pp->getName() == propName )
100  return pp;
101  }
102 
103  return NULL;
104 
105 }
INDI_G::addProperty
bool addProperty(INDI::Property *prob)
Definition: indigroup.cpp:55
INDI_P
Definition: indiproperty.h:38
INDI_P::getContainer
QHBoxLayout * getContainer()
Definition: indiproperty.h:75
INDI_P::getName
const QString & getName()
Definition: indiproperty.h:77
indidevice.h
INDI_G::~INDI_G
~INDI_G()
Definition: indigroup.cpp:48
INDI_D
Definition: indidevice.h:30
INDI_G::INDI_G
INDI_G(INDI_D *idv, const QString &inName)
Definition: indigroup.cpp:32
INDI_G::removeProperty
bool removeProperty(const QString &propName)
Definition: indigroup.cpp:74
INDI_G::getProperty
INDI_P * getProperty(const QString &propName)
Definition: indigroup.cpp:94
indiproperty.h
QFrame
indigroup.h
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