Skip to content

Conversation

Adrian-B-Moreira
Copy link
Contributor

When calling QwtPlotRenderer.renderTo(...), it internally calls drawBackground() where a QRectF is being assigned to QStyleOption.rect, which expects a QRect. This leads to an error: QRectF cannot be converted to QRect in this context.

The fix was explicitly convert the QRectF to a QRect before assignment.

@PierreRaybaut PierreRaybaut changed the title Fix qrectf to qrect cast in drawBackground Fix QRectF to QRect cast in QwtPainterClass.drawBackground Apr 12, 2025
@PierreRaybaut
Copy link
Collaborator

When calling QwtPlotRenderer.renderTo(...), it internally calls drawBackground() where a QRectF is being assigned to QStyleOption.rect, which expects a QRect. This leads to an error: QRectF cannot be converted to QRect in this context.

The fix was explicitly convert the QRectF to a QRect before assignment.

Thanks for reporting the issue and fixing it at the same time

@PierreRaybaut PierreRaybaut merged commit a2cf1ff into PlotPyStack:master Apr 12, 2025
0 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants