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
:meth:`MscElement.setName` and to read the name of the element use
:meth:`MscElement.name`.
"""
from PySide.QtCore import QObject, Signal
from PySide.QtCore import QRegExp
from PySide.QtCore import QObject, Signal, QRegExp
import mscregexp
......@@ -107,13 +106,16 @@ class MscElement(QObject):
:meth:`MscElement.delete`
"""
_NameRegExp = None
def __init__(self, name='', parent=None, elemType=TYPE):
'''
construct
'''
super(MscElement, self).__init__(parent)
self._name = ''
self._NameRegExp = QRegExp('(' + mscregexp.Name + ')')
if not self._NameRegExp:
self._NameRegExp = QRegExp('(' + mscregexp.Name + ')')
self.elemType = elemType
self.setName(name)
self._comment = u""
......
......@@ -33,7 +33,8 @@ within the MSC.
"""
from mscelement import MscElement
import mscregexp
from PySide.QtCore import QRegExp
class MscProcedure(MscElement):
u"""
......@@ -43,6 +44,8 @@ class MscProcedure(MscElement):
:type parent: PySide.QtCore.QObject
"""
TYPE = u"Procedure"
# Label allow more character than basic MscElement
_NameRegExp = QRegExp('(' + mscregexp.Text + ')')
def __init__(self, name, orderPos=0, parent=None):
'''
......
......@@ -93,7 +93,7 @@ class MscGraphProcedure(MscGraphItem):
self.label.setTextLabel(self.mscData().getName())
def updateLabelPosition(self):
self.label.setCenterPos(QPointF(0, 15))
self.label.setCenterPos(QPointF(30, 15))
#**************************************************************************
# Item Change
......@@ -122,7 +122,7 @@ class MscGraphProcedure(MscGraphItem):
self.mscData().setAbsPos(self.mapToScene(0, 0).y())
self.yHasChanged.emit(self)
return value #MscGraphItem.itemChange(self, change, value)
return value
#**************************************************************************
# 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