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.
14 #include "indiproperty.h"
15 #include "indigroup.h"
16 #include "indidevice.h"
17 #include "devicemanager.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
)
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
);
57 delete(propertyContainer
);
60 void INDI_G::addProperty(INDI_P
*pp
)
62 dp
->registerProperty(pp
);
64 propertyLayout
->addLayout(pp
->PHBox
);
65 propertyLayout
->addItem(VerticalSpacer
);
70 bool INDI_G::removeProperty(INDI_P
*pp
)
73 return (pl
.remove(pp
));