Thanks for your responce ...
I' like to be creative
and happy too
..
I found an easy solution :-)
this is my base class for item:
...
...
def shape(self):
"""
overloading of the shape method
"""
self.drawShape(path)
painterStrock.setWidth(self.lineWith)
path1=painterStrock.createStroke(path)
return path1
...
..
class BaseEntity(QtGui.QGraphicsItem):
...
...
def shape(self):
"""
overloading of the shape method
"""
painterStrock=QtGui.QPainterPathStroker()
path=QtGui.QPainterPath()
self.drawShape(path)
painterStrock.setWidth(self.lineWith)
path1=painterStrock.createStroke(path)
return path1
...
..
To copy to clipboard, switch view to plain text mode
I derive my object from the above one : and for example the this is the arc one :
from Interface.Entity.base import *
class Arc(BaseEntity):
"""
this class define the arcQT object
"""
.....
def drawShape(self, painterPath):
"""
overloading of the shape method
"""
painterPath.arcTo(self.boundingRect(),self.startAngle,self.spanAngle)
......
from Interface.Entity.base import *
class Arc(BaseEntity):
"""
this class define the arcQT object
"""
.....
def drawShape(self, painterPath):
"""
overloading of the shape method
"""
painterPath.arcTo(self.boundingRect(),self.startAngle,self.spanAngle)
......
To copy to clipboard, switch view to plain text mode
I change the
painterStrock.setWidth(self.lineWith)
painterStrock.setWidth(self.lineWith)
To copy to clipboard, switch view to plain text mode
in to
painterStrock.setWidth(self.lineWith*10)
painterStrock.setWidth(self.lineWith*10)
To copy to clipboard, switch view to plain text mode
This enlarge the with of the shape :-)
Regards,
Matteo
Bookmarks