moved kdeaccessibility kdeaddons kdeadmin kdeartwork kdebindings kdeedu kdegames...
[kdeedu.git] / kstars / kstars / indigroup.cpp
blob7ef606b66d367f5da0be7a841675a577feb4b632
1 /* INDI Group
2 Copyright (C) 2003 Jasem Mutlaq (mutlaqja@ikarustech.com)
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.
9 JM Changelog
10 2004-16-1: Start
14 #include "indiproperty.h"
15 #include "indigroup.h"
16 #include "indidevice.h"
17 #include "devicemanager.h"
19 #include <klocale.h>
21 #include <qlayout.h>
22 #include <qframe.h>
23 #include <qtimer.h>
24 #include <qtabwidget.h>
26 /*******************************************************************
27 ** INDI Group: a tab widget for common properties. All properties
28 ** belong to a group, whether they have one or not but how the group
29 ** is displayed differs
30 *******************************************************************/
31 INDI_G::INDI_G(INDI_D *parentDevice, QString inName)
33 dp = parentDevice;
35 name = inName;
37 pl.setAutoDelete(true);
39 // FIXME what's the parent exactly?
40 // You can do this eaither way:
41 // 1. Propertycontainer is a QFrame, then you make QVBoxLayout for it (check form1.cpp)
42 // 2. Keep it as QVBox and let it handle its children.
43 // Depends on which one works best.
44 propertyContainer = new QFrame(dp->groupContainer);
45 propertyLayout = new QVBoxLayout(propertyContainer, 20, KDialog::spacingHint() );
46 VerticalSpacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
48 propertyLayout->addItem(VerticalSpacer);
50 dp->groupContainer->addTab(propertyContainer, name);
53 INDI_G::~INDI_G()
55 pl.clear();
57 delete(propertyContainer);
60 void INDI_G::addProperty(INDI_P *pp)
62 dp->registerProperty(pp);
64 propertyLayout->addLayout(pp->PHBox);
65 propertyLayout->addItem(VerticalSpacer);
67 pl.append(pp);
70 bool INDI_G::removeProperty(INDI_P *pp)
73 return (pl.remove(pp));