X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSUPERVGUI%2FSUPERVGUI_BrowseNodeDlg.cxx;fp=src%2FSUPERVGUI%2FSUPERVGUI_BrowseNodeDlg.cxx;h=6d05fb711da36b5e9e0208eacb0539b643fcaf38;hb=e80e7f7fa6716eb79a74468182f1161ae5121298;hp=54cf5fa61d8bdafcbbb7e45159759d2cbf1adbfb;hpb=8231f8de49ba40887ae588d8e11e649764cf866e;p=modules%2Fsuperv.git diff --git a/src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx b/src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx index 54cf5fa..6d05fb7 100644 --- a/src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx +++ b/src/SUPERVGUI/SUPERVGUI_BrowseNodeDlg.cxx @@ -44,7 +44,7 @@ SUPERVGUI_PortField::SUPERVGUI_PortField( QWidget* theParent, SUPERV_Port thePor 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; @@ -55,8 +55,12 @@ SUPERVGUI_PortField::SUPERVGUI_PortField( QWidget* theParent, SUPERV_Port thePor 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 ); @@ -67,7 +71,25 @@ SUPERVGUI_PortField::SUPERVGUI_PortField( QWidget* theParent, SUPERV_Port thePor 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 ); }