Skip to content

Fix QRectF to QRect cast in QwtPainterClass.drawBackground #99

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 12, 2025

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