Title: TypeError in `QwtSymbol.drawSymbol` method due to outdated `renderSymbols` call · Issue #100 · PlotPyStack/PythonQwt · GitHub
Open Graph Title: TypeError in `QwtSymbol.drawSymbol` method due to outdated `renderSymbols` call · Issue #100 · PlotPyStack/PythonQwt
X Title: TypeError in `QwtSymbol.drawSymbol` method due to outdated `renderSymbols` call · Issue #100 · PlotPyStack/PythonQwt
Description: Description Issue Description Fixed a critical bug in the QwtSymbol.drawSymbol method that was causing a TypeError when attempting to draw a symbol into a rectangle. The error message was: TypeError: QwtSymbol.renderSymbols() takes 3 pos...
Open Graph Description: Description Issue Description Fixed a critical bug in the QwtSymbol.drawSymbol method that was causing a TypeError when attempting to draw a symbol into a rectangle. The error message was: TypeErro...
X Description: Description Issue Description Fixed a critical bug in the QwtSymbol.drawSymbol method that was causing a TypeError when attempting to draw a symbol into a rectangle. The error message was: TypeErro...
Opengraph URL: https://github.com/PlotPyStack/PythonQwt/issues/100
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"TypeError in `QwtSymbol.drawSymbol` method due to outdated `renderSymbols` call","articleBody":"## Description\n\n### Issue Description\nFixed a critical bug in the `QwtSymbol.drawSymbol` method that was causing a TypeError when attempting to draw a symbol into a rectangle. The error message was:\n```\nTypeError: QwtSymbol.renderSymbols() takes 3 positional arguments but 4 were given\n```\n\n### Root Cause Analysis\nThis bug had two distinct causes:\n\n1. **Outdated method call**: Following changeset 6a36ce7 \"QwtSymbol.drawSymbols/renderSymbols: removed numPoints argument\" (version 0.11), the call to `renderSymbols` in the `drawSymbol` method was not updated to match the new signature. The method was still being called with incorrect arguments, causing the TypeError.\n\n2. **Incorrect parameter type**: Even after fixing the parameter count, there was another issue: the second argument of `renderSymbols` expects a list of points (`points`, plural), but a single `QPointF` object was being passed directly. The method expects an iterable collection, not a single point.\n\n### Location\nFile: `qwt/symbol.py`\nMethod: `QwtSymbol.drawSymbol`\n\n### Fixed Code\nThe issue was fixed by:\n1. Updating the call to use the correct number of parameters\n2. Passing a list containing the single QPointF rather than the QPointF directly, as the method expects an iterable collection of points\n\nThe affected code section was in `drawSymbol` method:\n\n```python\n# Before:\nself.renderSymbols(painter, QPointF(), 1) # Incorrect call with wrong arguments\n\n# After:\nself.renderSymbols(painter, [QPointF()]) # Fixed call with correct arguments\n```\n\n### Impact\nThis bug would prevent symbols from being properly rendered in certain contexts, particularly when using the `drawSymbol` method with a rectangle parameter, which is critical for displaying symbols in legends and other UI elements.\n\n### Additional Context\nThis bug appears to have been introduced during the transition to version 0.11 when the `numPoints` parameter was removed from the `renderSymbols` method but not all calls to this method were updated accordingly.\n","author":{"url":"https://github.com/PierreRaybaut","@type":"Person","name":"PierreRaybaut"},"datePublished":"2025-06-12T09:33:57.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/100/PythonQwt/issues/100"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:09cc54b6-5893-eb6b-06ae-61f6b2e54cc7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8B40:59C53:A211EE:D92617:69731AF4 |
| html-safe-nonce | 8a4cb100f6eeb792f937ecf1476bdd26917fafcec0a3144b015ad2e4dfa6e8a4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QjQwOjU5QzUzOkEyMTFFRTpEOTI2MTc6Njk3MzFBRjQiLCJ2aXNpdG9yX2lkIjoiODg2NzAyNTU3MjgwNjcyODQzNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | b26131f6671d6d5387ba96680622f809b5d812c319b899bbf65e5186f18a4bfa |
| hovercard-subject-tag | issue:3139541848 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/PlotPyStack/PythonQwt/100/issue_layout |
| twitter:image | https://opengraph.githubassets.com/1c7235ff02784707e2e5995b2920e915ce454ce28488117ef2a81e9d25751b2d/PlotPyStack/PythonQwt/issues/100 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/1c7235ff02784707e2e5995b2920e915ce454ce28488117ef2a81e9d25751b2d/PlotPyStack/PythonQwt/issues/100 |
| og:image:alt | Description Issue Description Fixed a critical bug in the QwtSymbol.drawSymbol method that was causing a TypeError when attempting to draw a symbol into a rectangle. The error message was: TypeErro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | PierreRaybaut |
| hostname | github.com |
| expected-hostname | github.com |
| None | 44ab3188c1dcfe3be0f9c3feca2e04e14fb79f120939ce2395e4f15ab96ec1d4 |
| turbo-cache-control | no-preview |
| go-import | github.com/PlotPyStack/PythonQwt git https://github.com/PlotPyStack/PythonQwt.git |
| octolytics-dimension-user_id | 145201262 |
| octolytics-dimension-user_login | PlotPyStack |
| octolytics-dimension-repository_id | 41204495 |
| octolytics-dimension-repository_nwo | PlotPyStack/PythonQwt |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 41204495 |
| octolytics-dimension-repository_network_root_nwo | PlotPyStack/PythonQwt |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | a5e2b48bd1260476599758f5d253b5d24092ab84 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width