2 # -*- coding: utf-8 -*-
3 # Copyright (C) 2007-2013 EDF R&D
5 # This library is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU Lesser General Public
7 # License as published by the Free Software Foundation; either
8 # version 2.1 of the License.
10 # This library is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 # Lesser General Public License for more details.
15 # You should have received a copy of the GNU Lesser General Public
16 # License along with this library; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 # See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 from determine import monEnvQT5
25 from PyQt5.QtWidgets import QToolButton
27 from PyQt4.QtGui import *
28 from PyQt4.QtCore import *
29 from Extensions.i18n import tr
31 class MonBoutonValide(QToolButton) :
33 def __init__(self,parent):
34 QToolButton.__init__(self,parent)
35 while( not(hasattr(parent,'node'))):
36 parent= parent.parent()
39 def mouseDoubleClickEvent(self, event):
40 #print "dans mouseDoubleClickEvent"
41 strRapport=unicode(self.parent.node.item.object.report())
42 self.parent.editor._viewText(strRapport, "JDC_RAPPORT")
44 def mousePressEvent(self, event):
45 #print "dans mousePressEvent"
46 if self.parent.node.item.object.isvalid() :
47 myToolTip=QString(tr("objet valide"))
48 QToolTip.showText(event.globalPos(),myToolTip )
51 texte=unicode(self.parent.node.item.object.report())
53 for l in texte.split('\n')[2:-2]:
54 if re.match('^[\t !]*$',l) : continue
55 if re.match('^ *Fin Mot-cl',l) : continue
56 if re.match('^ *D?but Mot-cl',l) : continue
57 if re.match('^ *Mot-cl',l) : continue
65 QToolTip.showText(event.globalPos(),myToolTip )