Commit 8ee4f5a0 authored by Maxime Perrotin's avatar Maxime Perrotin

MSC can show extra characters

parent b3e636b3
...@@ -42,8 +42,7 @@ the name of the element. To modify the name of the element use the method ...@@ -42,8 +42,7 @@ the name of the element. To modify the name of the element use the method
:meth:`MscElement.setName` and to read the name of the element use :meth:`MscElement.setName` and to read the name of the element use
:meth:`MscElement.name`. :meth:`MscElement.name`.
""" """
from PySide.QtCore import QObject, Signal from PySide.QtCore import QObject, Signal, QRegExp
from PySide.QtCore import QRegExp
import mscregexp import mscregexp
...@@ -107,13 +106,16 @@ class MscElement(QObject): ...@@ -107,13 +106,16 @@ class MscElement(QObject):
:meth:`MscElement.delete` :meth:`MscElement.delete`
""" """
_NameRegExp = None
def __init__(self, name='', parent=None, elemType=TYPE): def __init__(self, name='', parent=None, elemType=TYPE):
''' '''
construct construct
''' '''
super(MscElement, self).__init__(parent) super(MscElement, self).__init__(parent)
self._name = '' self._name = ''
self._NameRegExp = QRegExp('(' + mscregexp.Name + ')') if not self._NameRegExp:
self._NameRegExp = QRegExp('(' + mscregexp.Name + ')')
self.elemType = elemType self.elemType = elemType
self.setName(name) self.setName(name)
self._comment = u"" self._comment = u""
......
...@@ -33,7 +33,8 @@ within the MSC. ...@@ -33,7 +33,8 @@ within the MSC.
""" """
from mscelement import MscElement from mscelement import MscElement
import mscregexp
from PySide.QtCore import QRegExp
class MscProcedure(MscElement): class MscProcedure(MscElement):
u""" u"""
...@@ -43,6 +44,8 @@ class MscProcedure(MscElement): ...@@ -43,6 +44,8 @@ class MscProcedure(MscElement):
:type parent: PySide.QtCore.QObject :type parent: PySide.QtCore.QObject
""" """
TYPE = u"Procedure" TYPE = u"Procedure"
# Label allow more character than basic MscElement
_NameRegExp = QRegExp('(' + mscregexp.Text + ')')
def __init__(self, name, orderPos=0, parent=None): def __init__(self, name, orderPos=0, parent=None):
''' '''
......
...@@ -93,7 +93,7 @@ class MscGraphProcedure(MscGraphItem): ...@@ -93,7 +93,7 @@ class MscGraphProcedure(MscGraphItem):
self.label.setTextLabel(self.mscData().getName()) self.label.setTextLabel(self.mscData().getName())
def updateLabelPosition(self): def updateLabelPosition(self):
self.label.setCenterPos(QPointF(0, 15)) self.label.setCenterPos(QPointF(30, 15))
#************************************************************************** #**************************************************************************
# Item Change # Item Change
...@@ -122,7 +122,7 @@ class MscGraphProcedure(MscGraphItem): ...@@ -122,7 +122,7 @@ class MscGraphProcedure(MscGraphItem):
self.mscData().setAbsPos(self.mapToScene(0, 0).y()) self.mscData().setAbsPos(self.mapToScene(0, 0).y())
self.yHasChanged.emit(self) self.yHasChanged.emit(self)
return value #MscGraphItem.itemChange(self, change, value) return value
#************************************************************************** #**************************************************************************
# Paint Functions # Paint Functions
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment