Title: Stylesheet Test fails (PySide6, Python 3.12) · Issue #102 · PlotPyStack/PythonQwt · GitHub
Open Graph Title: Stylesheet Test fails (PySide6, Python 3.12) · Issue #102 · PlotPyStack/PythonQwt
X Title: Stylesheet Test fails (PySide6, Python 3.12) · Issue #102 · PlotPyStack/PythonQwt
Description: Installing PythonQwt version 0.14.5 into a python 3.12.3 virtual environment together with PySide6 (version 6.9.1) and running the stylesheet testcase results in the following backtrace: Python 3.12.3 (main, Jun 18 2025, 17:59:45) [GCC 1...
Open Graph Description: Installing PythonQwt version 0.14.5 into a python 3.12.3 virtual environment together with PySide6 (version 6.9.1) and running the stylesheet testcase results in the following backtrace: Python 3.1...
X Description: Installing PythonQwt version 0.14.5 into a python 3.12.3 virtual environment together with PySide6 (version 6.9.1) and running the stylesheet testcase results in the following backtrace: Python 3.1...
Opengraph URL: https://github.com/PlotPyStack/PythonQwt/issues/102
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Stylesheet Test fails (PySide6, Python 3.12)","articleBody":"Installing `PythonQwt` version 0.14.5 into a python 3.12.3 virtual environment together with `PySide6` (version 6.9.1) and running the stylesheet testcase results in the following backtrace:\n\n```\nPython 3.12.3 (main, Jun 18 2025, 17:59:45) [GCC 13.3.0] on linux\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\n\u003e\u003e\u003e from qwt import tests\n\u003e\u003e\u003e tests.run()\nTraceback (most recent call last):\n File \"/home/martin/.virtualenvs/venv/lib/python3.12/site-packages/qwt/tests/test_stylesheet.py\", line 37, in \u003cmodule\u003e\n test_stylesheet()\n File \"/home/martin/.virtualenvs/venv/lib/python3.12/site-packages/qwt/tests/test_stylesheet.py\", line 33, in test_stylesheet\n utils.test_widget(StyleSheetPlot, size=(600, 400))\n File \"/home/martin/.virtualenvs/venv/lib/python3.12/site-packages/qwt/tests/utils.py\", line 301, in test_widget\n central_widget.add_widget(widget)\n File \"/home/martin/.virtualenvs/venv/lib/python3.12/site-packages/qwt/tests/utils.py\", line 252, in add_widget\n self.layout().addWidget(widget)\n File \"/home/martin/.virtualenvs/venv/lib/python3.12/site-packages/qwt/plot_canvas.py\", line 582, in event\n self.updateStyleSheetInfo()\n File \"/home/martin/.virtualenvs/venv/lib/python3.12/site-packages/qwt/plot_canvas.py\", line 809, in updateStyleSheetInfo\n self.style().drawPrimitive(QStyle.PE_Widget, opt, painter, self)\n File \"/home/martin/.virtualenvs/venv/lib/python3.12/site-packages/qwt/null_paintdevice.py\", line 59, in drawRects\n device.drawRects(rects, rectCount)\n File \"/home/martin/.virtualenvs/venv/lib/python3.12/site-packages/qwt/plot_canvas.py\", line 80, in drawRects\n self.border.rectList += [rects.getRect().index(i)]\n ^^^^^^^^^^^^^\nAttributeError: Error calling Python override of QFrame::event(): Error calling Python override of QPaintEngine::drawRects(): 'list' object has no attribute 'getRect'\n^X^C^CTraceback (most recent call last):\n File \"\u003cstdin\u003e\", line 1, in \u003cmodule\u003e\n File \"/home/martin/.virtualenvs/venv/lib/python3.12/site-packages/qwt/tests/__init__.py\", line 37, in run\n app.exec()\n``` \nThe other testcases seem to work without trouble. \n\nIt seems that the issue is caused by the handling of the `PySide` backend in the `plotRects` implementation inside `plot_canvas.py`. Something along the lines of this change seems to fix it (with some of the corner cases still present most likely not needed anymore):\n\n```\ndiff --git a/qwt/plot_canvas.py b/qwt/plot_canvas.py\nindex c7c7950..ff8705e 100644\n--- a/qwt/plot_canvas.py\n+++ b/qwt/plot_canvas.py\n@@ -75,9 +75,16 @@ class QwtStyleSheetRecorder(QwtNullPaintDevice):\n # Pyside\n if isinstance(rects, (QRect, QRectF)):\n self.border.list = [rects]\n+ elif all(isinstance(rects, (QRect, QRectF)):\n+ if isinstance(rects, list):\n+ self.border.rectList += rects\n+ else:\n+ # That may not even be necessary\n+ self.border.rectList += [r for r in rects]\n else:\n+ # Should we get here ?\n for i in range(count):\n- self.border.rectList += [rects.getRect().index(i)]\n+ self.border.rectList += [rects[i]]\n else:\n # PyQt\n for i in range(count):\n``","author":{"url":"https://github.com/martinschwinzerl","@type":"Person","name":"martinschwinzerl"},"datePublished":"2025-07-11T23:36:29.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":2},"url":"https://github.com/102/PythonQwt/issues/102"}
| 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:eea3d833-8a64-1c36-651e-6b62595137fd |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EE16:242157:23AB3DA:2EBC20E:69746F5F |
| html-safe-nonce | be9054bb4ec71d2193df16f8bc98417d5bee1531dce7c4fb5ac541259040dc20 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFRTE2OjI0MjE1NzoyM0FCM0RBOjJFQkMyMEU6Njk3NDZGNUYiLCJ2aXNpdG9yX2lkIjoiNDY1Njg3MTY3MDMxMDc5MzA1NSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 7741da53470b92f25470669bc82057c2f629eba53e2f2f80876b6b4433b35ead |
| hovercard-subject-tag | issue:3224471519 |
| 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/102/issue_layout |
| twitter:image | https://opengraph.githubassets.com/279710c9762a141dc78beb2bc72b758b883a486287d4706ed992096df1e543a8/PlotPyStack/PythonQwt/issues/102 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/279710c9762a141dc78beb2bc72b758b883a486287d4706ed992096df1e543a8/PlotPyStack/PythonQwt/issues/102 |
| og:image:alt | Installing PythonQwt version 0.14.5 into a python 3.12.3 virtual environment together with PySide6 (version 6.9.1) and running the stylesheet testcase results in the following backtrace: Python 3.1... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | martinschwinzerl |
| hostname | github.com |
| expected-hostname | github.com |
| None | e0b95d743b7672c9ac0e1032d5f117950182dc164a83434a7db86510e8f0b37c |
| 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 | 56fe7e2e8de6e57740bca50402351ea656f7a4bf |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width