Skip to content
This repository has been archived by the owner on Mar 17, 2021. It is now read-only.

Adapt TaurusGraphicsAttributeItem to be compatible with python3 #881

Merged
merged 5 commits into from
Mar 20, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions lib/taurus/qt/qtgui/graphic/taurusgraphic.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,12 +867,21 @@ class QGraphicsTextBoxing(Qt.QGraphicsItemGroup):
_TEXT_RATIO = 0.8

def __init__(self, parent=None, scene=None):
Qt.QGraphicsItemGroup.__init__(self, parent, scene)
self._rect = Qt.QGraphicsRectItem(self, scene)
Qt.QGraphicsItemGroup.__init__(self, parent)
if scene is not None:
scene.addItem(self)
self._rect = Qt.QGraphicsRectItem(self)
if scene is not None:
scene.addItem(self._rect)
self._rect.setBrush(Qt.QBrush(Qt.Qt.NoBrush))
self._rect.setPen(Qt.QPen(Qt.Qt.NoPen))
self._text = Qt.QGraphicsTextItem(self, scene)
self._text.scale(self._TEXT_RATIO, self._TEXT_RATIO)
self._text = Qt.QGraphicsTextItem(self)
if scene is not None:
scene.addItem(self._text)
self._text.setTransform(
Qt.QTransform.fromScale(self._TEXT_RATIO, self._TEXT_RATIO),
True)

self._validBackground = None
# using that like the previous code create a worst result
self.__layoutValide = True
Expand Down Expand Up @@ -1163,8 +1172,9 @@ def updateStyle(self):
_frName = None
else:
_frName = 'rvalue.magnitude'
text = self._currText = self.getDisplayValue(fragmentName=_frName)
self._currText = text.decode('unicode-escape')
text = self.getDisplayValue(fragmentName=_frName)

self._currText = text
self._currHtmlText = None

TaurusGraphicsItem.updateStyle(self)
Expand Down