diff --git a/Orange/widgets/data/owpythonscript.py b/Orange/widgets/data/owpythonscript.py index 46bf76eadcb..b5476832153 100644 --- a/Orange/widgets/data/owpythonscript.py +++ b/Orange/widgets/data/owpythonscript.py @@ -286,8 +286,8 @@ def paintEvent(self, event): p.drawRoundedRect(rect, 5, 5) p.restore() - textstart = (width - fm.width(self.indicator_text)) / 2 - p.drawText(textstart, height / 2 + 5, self.indicator_text) + textstart = (width - fm.width(self.indicator_text)) // 2 + p.drawText(textstart, height // 2 + 5, self.indicator_text) def minimumSizeHint(self): fm = QFontMetrics(self.font()) diff --git a/Orange/widgets/data/utils/pythoneditor/editor.py b/Orange/widgets/data/utils/pythoneditor/editor.py index 883f9350df8..3dc6dac8aa4 100644 --- a/Orange/widgets/data/utils/pythoneditor/editor.py +++ b/Orange/widgets/data/utils/pythoneditor/editor.py @@ -1369,11 +1369,11 @@ def drawWhiteSpace(block, column, char): leftCursorRect = self.__cursorRect(block, column, 0) rightCursorRect = self.__cursorRect(block, column + 1, 0) if leftCursorRect.top() == rightCursorRect.top(): # if on the same visual line - middleHeight = (leftCursorRect.top() + leftCursorRect.bottom()) / 2 + middleHeight = (leftCursorRect.top() + leftCursorRect.bottom()) // 2 if char == ' ': painter.setPen(Qt.transparent) painter.setBrush(QBrush(Qt.gray)) - xPos = (leftCursorRect.x() + rightCursorRect.x()) / 2 + xPos = (leftCursorRect.x() + rightCursorRect.x()) // 2 painter.drawRect(QRect(xPos, middleHeight, 2, 2)) else: painter.setPen(QColor(Qt.gray).lighter(factor=120))