X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=InterfaceQT4%2FmonWidgetFact.py;h=012afc11bf8f2123abad018bc77a3a59d566f6b6;hb=96176d0080e0d4efbd29d98c0df700a64a82acdc;hp=77756ad434e9f68268cae90c0479a9917fc40935;hpb=a54fdbf858683f1439bc26f155ece0fec66ae026;p=tools%2Feficas.git diff --git a/InterfaceQT4/monWidgetFact.py b/InterfaceQT4/monWidgetFact.py index 77756ad4..012afc11 100644 --- a/InterfaceQT4/monWidgetFact.py +++ b/InterfaceQT4/monWidgetFact.py @@ -17,12 +17,15 @@ # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # Modules Python +from __future__ import absolute_import +from PyQt5.QtCore import Qt, QTimer +from PyQt5.QtWidgets import QWidget + + # Modules Eficas +from .groupe import Groupe from desWidgetFact import Ui_WidgetFact -from groupe import Groupe -from PyQt4.QtGui import * -from PyQt4.QtCore import * from Extensions.i18n import tr # Import des panels @@ -30,15 +33,25 @@ class MonWidgetFact(Ui_WidgetFact,Groupe): """ """ def __init__(self,node,editor,parentQt,definition, obj, niveau,commande): - #print "init de Fact" + #print "fact : ",node.item.nom Groupe.__init__(self,node,editor,parentQt, definition,obj,niveau,commande) labeltext,fonte,couleur = self.node.item.GetLabelText() self.GroupBox.setText(tr(labeltext)) self.GroupBox.setTextInteractionFlags(Qt.TextSelectableByMouse) self.parentQt.commandesLayout.insertWidget(-1,self) + self.doitAfficherOptionnel=False + + def enterEvent(self,event): + #print "enterEvent ", self.node.item.GetLabelText()[0] + self.doitAfficherOptionnel=True + QWidget.enterEvent(self,event) + QTimer.singleShot(500, self.delayAffiche) - def focusInEvent(self,event): - # print "je passe dans focusInEvent" - if self.editor.code != "CARMELCND" :self.afficheOptionnel() - QWidget.focusInEvent(self,event) + def leaveEvent(self,event): + #print "leaveEvent", self.node.item.GetLabelText()[0] + self.doitAfficherOptionnel=False + QWidget.leaveEvent(self,event) + def delayAffiche(self): + #print "delayAffiche, self.doitAfficherOptionnel = ", self.doitAfficherOptionnel + if self.doitAfficherOptionnel and self.editor.code != "CARMELCND" :self.afficheOptionnel()