- myWidgetApi->toChildWidget();
- do {
- QString aPageName = qs(myWidgetApi->getProperty(CONTAINER_PAGE_NAME));
- QString aCaseId = qs(myWidgetApi->getProperty(_ID));
- ModuleBase_PageBase* aPage = new ModuleBase_PageWidget(aWidget);
- createWidget(aPage);
- if (aWdgType == WDG_SWITCH || aWdgType == WDG_TOOLBOX) {
- ModuleBase_PagedContainer* aContainer = qobject_cast<ModuleBase_PagedContainer*>(aWidget);
-
- QString anIconPath = qs( myWidgetApi->getProperty( CONTAINER_PAGE_ICON ) );
- QPixmap anIcon( anIconPath );
- aContainer->addPage( aPage, aPageName, aCaseId, anIcon );
- }
- } while (myWidgetApi->toNextWidget());
+ if (myWidgetApi->toChildWidget()) {
+ do {
+ QString aPageName = qs(myWidgetApi->getProperty(CONTAINER_PAGE_NAME));
+ QString aCaseId = qs(myWidgetApi->getProperty(_ID));
+ ModuleBase_PageBase* aPage = new ModuleBase_PageWidget(aWidget);
+ createWidget(aPage);
+ if (aWdgType == WDG_SWITCH || aWdgType == WDG_TOOLBOX) {
+ ModuleBase_PagedContainer* aContainer = qobject_cast<ModuleBase_PagedContainer*>(aWidget);
+
+ QString anIconPath = qs( myWidgetApi->getProperty( CONTAINER_PAGE_ICON ) );
+ QPixmap anIcon( anIconPath );
+ aContainer->addPage( aPage, aPageName, aCaseId, anIcon );
+ }
+ } while (myWidgetApi->toNextWidget());
+ }