labscript-suite / labscript-utils

Shared modules used by the 𝘭𝘒𝘣𝘴𝘀𝘳π˜ͺ𝘱𝘡 𝘴𝘢π˜ͺ𝘡𝘦. Includes a graphical exception handler, debug tools, configuration management, cross platform filepath conversions, unit conversions and custom GUI widgets.
http://labscriptsuite.org
Other
2 stars 45 forks source link

Fix issue with dragdroptab - convert float coords to int #97

Closed chrisjbillington closed 1 year ago

chrisjbillington commented 1 year ago

QPoint no longer auto converts float arguments, resulting in an error

This resolves an issue where dragging a tab outside of the main window results in this exception:

Traceback (most recent call last):
  File "/home/bilbo/miniconda3/envs/py311/lib/python3.11/site-packages/labscript_utils/qtwidgets/dragdroptab.py", line 319, in updateCurrentTime
    self.limbo_position = QPoint(new_pos_x, new_pos_y)
                          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: arguments did not match any overloaded call:
  QPoint(): too many arguments
  QPoint(int, int): argument 1 has unexpected type 'float'
  QPoint(QPoint): argument 1 has unexpected type 'float'