+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
/*
* ModuleBase_WidgetSwitch.cpp
*
#include <QSpacerItem>
ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* parent)
-: QFrame(parent)
+ : QFrame(parent)
{
myMainLay = new QVBoxLayout(this);
myMainLay->setContentsMargins(2, 4, 2, 2);
myCombo->hide();
myMainLay->addWidget(myCombo);
this->setFrameShape(QFrame::StyledPanel);
- connect(myCombo, SIGNAL(currentIndexChanged(int)),
- this, SLOT(setCurrentIndex(int)));
- connect(myCombo, SIGNAL(currentIndexChanged(int)),
- this, SIGNAL(currentPageChanged(int)));
+ connect(myCombo, SIGNAL(currentIndexChanged(int)), this, SLOT(setCurrentIndex(int)));
+ connect(myCombo, SIGNAL(currentIndexChanged(int)), this, SIGNAL(currentPageChanged(int)));
}
int ModuleBase_WidgetSwitch::insertPage(int theIndex, QWidget* theWidget, const QString& theName)
{
int index = theIndex < count() ? theIndex : count();
- if(count() == 0)
+ if (count() == 0)
myCombo->show();
myCombo->insertItem(index, theName);
myCases.insert(index, theWidget);
void ModuleBase_WidgetSwitch::refresh()
{
- foreach(QWidget* eachWidget, myCases) {
+ foreach(QWidget* eachWidget, myCases)
+ {
eachWidget->setVisible(false);
}
- if(currentIndex() >= myCases.count())
+ if (currentIndex() >= myCases.count())
return;
myCases[currentIndex()]->setVisible(true);
}