QString aLabelTxt(myPort->Name());
- SUPERV_CNode aNode = myPort->Node();
+ /*SUPERV_CNode aNode = myPort->Node();
SALOME_ModuleCatalog::Service* aService = aNode->Service();
SALOME_ModuleCatalog::ListOfServicesParameter aList;
aList = (myPort->IsInput())? aService->ServiceinParameter : aService->ServiceoutParameter;
break;
}
}
-
- aLabelTxt += QString(":");
+ aLabelTxt += QString(":");*/
+
+ // mkr : the following way is easyer to get ports' type than commented above
+ QString aPortType = QString(myPort->Type());
+ aLabelTxt += QString(" (") + aPortType + QString("):");
+
myLabel = new QLabel(aLabelTxt, theParent );
myValue = new QLineEdit( theParent );
aPalette.setInactive(aPalette.disabled());
aPalette.setActive(aPalette.disabled());
myValue->setPalette(aPalette);
- }
+ }
+ // mkr : PAL6276 -->
+ else {
+ if ( !aPortType.compare(QString("boolean")) )
+ myValue->setValidator( new QIntValidator( 0, 1, theParent ) );
+
+ if ( !aPortType.compare(QString("short")) || !aPortType.compare(QString("int")) || !aPortType.compare(QString("long")) )
+ myValue->setValidator( new QIntValidator( theParent ) );
+
+ if ( !aPortType.compare(QString("float")) || !aPortType.compare(QString("double")) )
+ myValue->setValidator( new QDoubleValidator( theParent ) );
+
+ if ( !aPortType.compare(QString("char")) ) {
+ QRegExp aRX( "." );
+ myValue->setValidator( new QRegExpValidator( aRX, theParent ) );
+
+ }
+ }
+ // mkr : PAL6276 <--
myValue->installEventFilter( this );
}