X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModuleBase%2FModuleBase_WidgetSwitch.cpp;h=a6e20a8cfffc2f8a253c53c9cf8d6f6aede60278;hb=6920ebc7d04391d5a1de785c8bed0301c3fab205;hp=3024f116616dc303d4c14d46d7b73fe19e18c7fc;hpb=b96d49472ad23f609343fa158d1d7b96c729ed09;p=modules%2Fshaper.git diff --git a/src/ModuleBase/ModuleBase_WidgetSwitch.cpp b/src/ModuleBase/ModuleBase_WidgetSwitch.cpp index 3024f1166..a6e20a8cf 100644 --- a/src/ModuleBase/ModuleBase_WidgetSwitch.cpp +++ b/src/ModuleBase/ModuleBase_WidgetSwitch.cpp @@ -12,7 +12,7 @@ #include ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* parent) -: QFrame(parent) + : QFrame(parent) { myMainLay = new QVBoxLayout(this); myMainLay->setContentsMargins(2, 4, 2, 2); @@ -20,10 +20,8 @@ ModuleBase_WidgetSwitch::ModuleBase_WidgetSwitch(QWidget* parent) 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))); } @@ -60,7 +58,7 @@ int ModuleBase_WidgetSwitch::indexOf(QWidget* theWidget) const 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); @@ -116,10 +114,11 @@ void ModuleBase_WidgetSwitch::setCurrentIndex(int index) 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); }