Title: super() does not work for Qt classes · Issue #39 · MeVisLab/pythonqt · GitHub
Open Graph Title: super() does not work for Qt classes · Issue #39 · MeVisLab/pythonqt
X Title: super() does not work for Qt classes · Issue #39 · MeVisLab/pythonqt
Description: I just want to share some insights into this issue, I currently have no intention to fix the issue, as that would be somewhat complicated. This is an example of what does not work: from PythonQt.QtGui import QDoubleValidator class MyFunn...
Open Graph Description: I just want to share some insights into this issue, I currently have no intention to fix the issue, as that would be somewhat complicated. This is an example of what does not work: from PythonQt.Qt...
X Description: I just want to share some insights into this issue, I currently have no intention to fix the issue, as that would be somewhat complicated. This is an example of what does not work: from PythonQt.Qt...
Opengraph URL: https://github.com/MeVisLab/pythonqt/issues/39
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"super() does not work for Qt classes","articleBody":"I just want to share some insights into this issue, I currently have no intention to fix the issue, as that would be somewhat complicated.\r\n\r\nThis is an example of what does not work:\r\n```\r\nfrom PythonQt.QtGui import QDoubleValidator\r\n\r\nclass MyFunnyValidator(QDoubleValidator):\r\n def setRange(self, minimum, maximum, decimals):\r\n super().setRange(minimum, maximum, decimals+1)\r\n```\r\nThe problem boils down to the fact that the method lookup of super() directly accesses the internal tp_dict member of the super classes, which is only filled to an absolute minimum by PythonQt (for performance reasons). Everything else is delivered through tp_getattro calls, but this does not work for super.\r\n\r\nI discussed with Florian Link what would have to be done to fill the tp_dict.\r\n\r\n- This would probably need to happen in PythonQtInstanceWrapper_init the first time an instance of the class is created.\r\n- One could have a look at PythonQtClassWrapper_getattro how this is done, where the \\_\\_dict\\_\\_ member is dynamically filled.\r\n- But one would have to have in mind that QObject class wrappers can get updated methods when, e.g., the Qt bindings are loaded, so the class tp_dict would have to be updated then or at least flushed.\r\n- There might be other unforeseen consequences.\r\n\r\nWe both agreed that this change is somewhat tricky and probably currently not worthwhile.","author":{"url":"https://github.com/usiems","@type":"Person","name":"usiems"},"datePublished":"2021-02-09T14:11:45Z","url":"https://github.com/MeVisLab/pythonqt/issues/39"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| 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:f95a16ea-ddf1-f257-becd-1326c976b2be |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8052:210CDA:26B5AF:330325:6AFF7563 |
| html-safe-nonce | 0c3d21e4b53bd989bb3b783e4159fe2cb2c16c120020c46be8b464362224f051 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MDUyOjIxMENEQToyNkI1QUY6MzMwMzI1OjZBRkY3NTYzIiwidmlzaXRvcl9pZCI6IjE3MDE5MTY2MTI4NjIzNzUyNjciLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 671c6841c77f786268edda2905b7abe5cba61c74382a4f989a279c0652bd471c |
| hovercard-subject-tag | issue:804587518 |
| 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/MeVisLab/pythonqt/39/issue_layout |
| twitter:image | https://opengraph.githubassets.com/f0a5cafeac8fe3bf6868b96ce3b63d1cce2b0c897f2c9707c989af239beeae6e/MeVisLab/pythonqt/issues/39 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/f0a5cafeac8fe3bf6868b96ce3b63d1cce2b0c897f2c9707c989af239beeae6e/MeVisLab/pythonqt/issues/39 |
| og:image:alt | I just want to share some insights into this issue, I currently have no intention to fix the issue, as that would be somewhat complicated. This is an example of what does not work: from PythonQt.Qt... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | usiems |
| hostname | github.com |
| expected-hostname | github.com |
| None | 35e31dc3576ce5a5753c960de52d6fbb2e3131488d65b48fb38a436f42fcbefe |
| turbo-cache-control | no-preview |
| go-import | github.com/MeVisLab/pythonqt git https://github.com/MeVisLab/pythonqt.git |
| octolytics-dimension-user_id | 15028021 |
| octolytics-dimension-user_login | MeVisLab |
| octolytics-dimension-repository_id | 193056137 |
| octolytics-dimension-repository_nwo | MeVisLab/pythonqt |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 193056137 |
| octolytics-dimension-repository_network_root_nwo | MeVisLab/pythonqt |
| 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 | ed8a67e95c8353d0d4bc94ad2812a7ecbf91bffa |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width