Version: 8.3.0
FormContainer Class Reference

#include <FormContainer.hxx>

Inheritance diagram for FormContainer:
Collaboration diagram for FormContainer:

Public Slots

void onModifyType (const QString &text)
 
void onModifyAOC (int val)
 
- Public Slots inherited from FormContainerBase
void on_ch_advance_stateChanged (int state)
 
void onModifyName (const QString &text)
 

Public Member Functions

 FormContainer (QWidget *parent=0)
 
virtual ~FormContainer ()
 
virtual void FillPanel (YACS::ENGINE::Container *container)
 
QString getTypeStr () const
 
- Public Member Functions inherited from FormContainerBase
 FormContainerBase (QWidget *parent=0)
 
virtual ~FormContainerBase ()
 
virtual void onModified ()
 
virtual bool onApply ()
 
virtual void onCancel ()
 

Private Attributes

QComboBoxcb_type
 

Additional Inherited Members

- Protected Attributes inherited from FormContainerBase
bool _advanced
 
YACS::ENGINE::Container_container
 
std::map< std::string,
std::string > 
_properties
 
FormAdvParamContainer_advancedParams
 

Detailed Description

Definition at line 35 of file FormContainer.hxx.

Constructor & Destructor Documentation

FormContainer::FormContainer ( QWidget parent = 0)

Definition at line 33 of file FormContainer.cxx.

References cb_type, FillPanel(), onModifyAOC(), and onModifyType().

33  :FormContainerBase(parent),cb_type(new QComboBox(this))
34 {
35  gridLayout_2_2->addWidget(cb_type);
36  FormContainer::FillPanel(0); // --- set widgets before signal connexion to avoid false modif detection
37  connect(cb_type, SIGNAL(activated(const QString&)),this, SLOT(onModifyType(const QString&)));
38  connect(ch_aoc,SIGNAL(stateChanged(int)),this,SLOT(onModifyAOC(int)));
39 }
FormContainer::~FormContainer ( )
virtual

Definition at line 41 of file FormContainer.cxx.

42 {
43 }

Member Function Documentation

void FormContainer::FillPanel ( YACS::ENGINE::Container container)
virtual

Reimplemented from FormContainerBase.

Definition at line 45 of file FormContainer.cxx.

References FormContainerBase::_properties, cb_type, DEBTRACE, FormContainerBase::FillPanel(), and YACS::ENGINE::Container::isAttachedOnCloning().

Referenced by FormContainer().

46 {
47  DEBTRACE("FormContainer::FillPanel");
49  if(container)
50  ch_aoc->setCheckState(container->isAttachedOnCloning()?Qt::Checked:Qt::Unchecked);
51  cb_type->clear();
52  cb_type->addItem("mono");
53  cb_type->addItem("multi");
54  if(_properties.count("type") && _properties["type"]=="multi")
55  cb_type->setCurrentIndex(1);
56 }
QString FormContainer::getTypeStr ( ) const
virtual

Implements FormContainerBase.

Definition at line 58 of file FormContainer.cxx.

59 {
60  return QString("Container");
61 }
void FormContainer::onModifyAOC ( int  val)
slot

Definition at line 78 of file FormContainer.cxx.

References FormContainerBase::_container, FormContainerBase::_properties, YACS::ENGINE::Container::AOC_ENTRY, YACS::ENGINE::Container::isAttachedOnCloning(), FormContainerBase::onModified(), and YACS::ENGINE::Container::setAttachOnCloningStatus().

Referenced by FormContainer().

79 {
80  if (!_container)
81  return;
82  bool val2(false);
83  if(val==Qt::Unchecked)
84  val2=false;
85  if(val==Qt::Checked)
86  val2=true;
87  bool prop(_container->isAttachedOnCloning());
88  int prop2((int)val2);
89  std::ostringstream oss; oss << prop2;
92  if(prop!=val2)
93  onModified();
94 }
void FormContainer::onModifyType ( const QString &  text)
slot

Definition at line 63 of file FormContainer.cxx.

References FormContainerBase::_advancedParams, FormContainerBase::_container, FormContainerBase::_properties, DEBTRACE, YACS::ENGINE::Container::getProperty(), FormContainerBase::onModified(), and FormAdvParamContainer::setModeText().

Referenced by FormContainer().

64 {
65  DEBTRACE("onModifyType " << text.toStdString());
66  if (!_container)
67  return;
68  std::string prop=_container->getProperty("type");
69  _properties["type"] = text.toStdString();
70  if (_properties["type"] == "mono")
72  else
73  _advancedParams->setModeText("multi");
74  if (prop != text.toStdString())
75  onModified();
76 }

Member Data Documentation

QComboBox* FormContainer::cb_type
private

Definition at line 47 of file FormContainer.hxx.

Referenced by FillPanel(), and FormContainer().


The documentation for this class was generated from the following files: