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 1 commit
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
16 changes: 11 additions & 5 deletions lib/taurus/qt/qtgui/graphic/taurusgraphic.py
Original file line number Diff line number Diff line change
Expand Up @@ -867,12 +867,18 @@ 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.scale(self._TEXT_RATIO, self._TEXT_RATIO)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This line is now commented... can it really be safely ignored?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was commented by mistake

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it must be changed since it fails with py3

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

TaurusGraphicsItem.updateStyle(self)
Expand Down