Skip to content

Commit dd255dc

Browse files
committed
Tests/Qt6: Fix TypeError in unit.utils.mouse_event_at_relative_plot_pos
1 parent d8457ed commit dd255dc

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

plotpy/tests/unit/utils.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,14 @@ def mouse_event_at_relative_plot_pos(
7171
plot = win.manager.get_plot()
7272

7373
plot = win.manager.get_plot()
74-
canva: QW.QWidget = plot.canvas() # type: ignore
75-
size = canva.size()
74+
canvas: QW.QWidget = plot.canvas() # type: ignore
75+
size = canvas.size()
7676
pos_x, pos_y = (
7777
relative_xy[0] * size.width(),
7878
relative_xy[1] * size.height(),
7979
)
80-
# pos_x, pos_y = axes_to_canvas(plot.get_active_item(), x, y)
8180
canva_pos = QC.QPointF(pos_x, pos_y).toPoint()
82-
glob_pos = canva.mapToGlobal(canva_pos)
83-
# QTest.mouseClick(canva, QC.Qt.MouseButton.LeftButton, mod, canva_pos)
81+
glob_pos = QC.QPointF(canvas.mapToGlobal(canva_pos))
8482

8583
for type_ in click_types:
8684
mouse_event_press = QG.QMouseEvent(
@@ -91,7 +89,7 @@ def mouse_event_at_relative_plot_pos(
9189
QC.Qt.MouseButton.LeftButton,
9290
mod,
9391
)
94-
qapp.sendEvent(canva, mouse_event_press)
92+
qapp.sendEvent(canvas, mouse_event_press)
9593

9694

9795
def drag_mouse(

0 commit comments

Comments
 (0)