X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=InterfaceQT4%2FmonWidgetSimpBase.py;h=c431983c48f6b695269b8adfca8b1ed0e79fb611;hb=80eb29926b88137b9f0f19175c0d0c52d7dcc206;hp=c8202eb5bdb0ca24c4c98591fb18f48c1837ca01;hpb=16d5922e798b1254eb558678612711d72ed38b32;p=tools%2Feficas.git diff --git a/InterfaceQT4/monWidgetSimpBase.py b/InterfaceQT4/monWidgetSimpBase.py index c8202eb5..c431983c 100644 --- a/InterfaceQT4/monWidgetSimpBase.py +++ b/InterfaceQT4/monWidgetSimpBase.py @@ -33,24 +33,29 @@ from qtSaisie import SaisieValeur class MonWidgetSimpBase (Ui_WidgetSimpBase,Feuille): - def __init__(self,node,monSimpDef,nom,objSimp,parentQt): - Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt) + def __init__(self,node,monSimpDef,nom,objSimp,parentQt,commande): + Feuille.__init__(self,node,monSimpDef,nom,objSimp,parentQt,commande) + #print "MonWidgetSimpBase", nom self.parentQt.commandesLayout.insertWidget(-1,self) self.setFocusPolicy(Qt.StrongFocus) self.connect(self.lineEditVal,SIGNAL("returnPressed()"),self.LEValeurPressed) + self.AAfficher=self.lineEditVal + self.maCommande.listeAffichageWidget.append(self.lineEditVal) - def showEvent(self, event): - if self.prendLeFocus==1 : - self.activateWindow() - self.lineEditVal.setFocus() - self.prendLeFocus=0 - QWidget.showEvent(self,event) + + #def showEvent(self, event): + # if self.prendLeFocus==1 : + # self.activateWindow() + # self.lineEditVal.setFocus() + # self.prendLeFocus=0 + # QWidget.showEvent(self,event) def setValeurs(self): self.politique=PolitiqueUnique(self.node,self.editor) valeur=self.node.item.get_valeur() valeurTexte=self.politique.GetValeurTexte(valeur) chaine=QString("") + if valeurTexte != None : from decimal import Decimal if isinstance(valeurTexte,Decimal): @@ -58,10 +63,11 @@ class MonWidgetSimpBase (Ui_WidgetSimpBase,Feuille): elif repr(valeurTexte.__class__).find("PARAMETRE") > 0: chaine = QString(repr(valeur)) else : - try : - chaine=QString("").setNum(valeurTexte) - except : - chaine=QString(str(valeurTexte)) + #PN ???? + #try : + # chaine=QString("").setNum(valeurTexte) + #except : + chaine=QString(str(valeurTexte)) self.lineEditVal.setText(chaine) @@ -73,7 +79,9 @@ class MonWidgetSimpBase (Ui_WidgetSimpBase,Feuille): 'Matrice' : tr(u'Une Matrice est attendue. '), 'Fichier' : tr(u'Un fichier est attendu. '), 'FichierNoAbs' : tr(u'Un fichier est attendu. '), - 'Repertoire' : tr(u'Un repertoire est attendu. ')} + 'Repertoire' : tr(u'Un repertoire est attendu. '), + 'Heure' : tr(u'Heure sous la forme HH:MM'), + 'Date' : tr(u'Date sous la forme JJ/MM/AA')} if mc.type[0] != types.ClassType: commentaire = d_aides.get(mc.type[0], tr("Type de base inconnu")) else : commentaire="" @@ -81,13 +89,12 @@ class MonWidgetSimpBase (Ui_WidgetSimpBase,Feuille): def LEValeurPressed(self): - print "LEValeurPressed" - print SaisieValeur.LEValeurPressed + if str(self.lineEditVal.text())=="" or str(self.lineEditVal.text())==None : return SaisieValeur.LEValeurPressed(self) self.parentQt.donneFocus() + self.setValeurs() + self.reaffiche() - print "je suis la aussi" - #PNPNPN - pas fait #if self.objSimp.parent.nom == "MODEL" : # if self.objSimp.isvalid(): # self.objSimp.parent.change_fichier="1"