enthought / pyface

pyface: traits-capable windowing framework
Other
105 stars 55 forks source link

Bug report: DeprecationWarning #1167

Closed johannesloibl closed 1 year ago

johannesloibl commented 1 year ago

Environment

OS: Windows Python version: 3.9 Toolkit: Qt Qt API: PySide2

Description

My pytest unittests show a deprecation warning that is coming from pyface:

 C:\git\...\.tox\codecov\lib\site-packages\pyface\ui\qt4\code_editor\gutters.py:134: DeprecationWarning: an integer is required (got type float).  Implicit conversion to integers using __int__ is deprecated, and may be removed
 in a future version of Python.
    painter.drawText(

Apparently, the variable top is of float type sometimes:

painter.drawText(
    0,
    top,
    self.width() - 2,
    self.fontMetrics().height(),
    QtCore.Qt.AlignmentFlag.AlignRight,
    str(blocknum + 1),
)
corranwebster commented 1 year ago

Thanks for the report - this is currently causing issues with PySide 6.4 where they seem to have made that change.