Title: Qt Embedding w/ Spyder · Issue #13400 · matplotlib/matplotlib · GitHub
Open Graph Title: Qt Embedding w/ Spyder · Issue #13400 · matplotlib/matplotlib
X Title: Qt Embedding w/ Spyder · Issue #13400 · matplotlib/matplotlib
Description: I have found a solution to a bug when using the script on: https://matplotlib.org/gallery/user_interfaces/embedding_in_qt_sgskip.html with the Spyder IDE (v3.3.2) If the script is run as presented, two issues are present: Issue 1: The qa...
Open Graph Description: I have found a solution to a bug when using the script on: https://matplotlib.org/gallery/user_interfaces/embedding_in_qt_sgskip.html with the Spyder IDE (v3.3.2) If the script is run as presented,...
X Description: I have found a solution to a bug when using the script on: https://matplotlib.org/gallery/user_interfaces/embedding_in_qt_sgskip.html with the Spyder IDE (v3.3.2) If the script is run as presented,...
Opengraph URL: https://github.com/matplotlib/matplotlib/issues/13400
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Qt Embedding w/ Spyder","articleBody":"I have found a solution to a bug when using the script on:\r\nhttps://matplotlib.org/gallery/user_interfaces/embedding_in_qt_sgskip.html\r\nwith the Spyder IDE (v3.3.2)\r\n\r\nIf the script is run as presented, two issues are present:\r\nIssue 1: The qapp.exec_() does not terminate when the window is closed.\r\n\r\nThis was resolved for me by adding:\r\n`QtWidgets.QApplication.setQuitOnLastWindowClosed(True)`\r\nbefore qapp.exec_() is called:\r\n\r\n```\r\nif not QtWidgets.QApplication.instance():\r\n qapp = QtWidgets.QApplication(sys.argv)\r\nelse:\r\n qapp = QtWidgets.QApplication.instance()\r\nQtWidgets.QApplication.setQuitOnLastWindowClosed(True)\r\n\r\napp = ApplicationWindow()\r\napp.show()\r\nqapp.exec_()\r\n```\r\n\r\nIssue 2: When this script is called multiple times in the IPython console, the Kernel dies and must be restarted. Per the comment thread on issue #4349, this is solved by replacing:\r\n\r\n`qapp = QtWidgets.QApplication(sys.argv)`\r\n\r\nwith\r\n```\r\nif not QtWidgets.QApplication.instance():\r\n qapp = QtWidgets.QApplication(sys.argv)\r\nelse:\r\n qapp = QtWidgets.QApplication.instance()\r\n```\r\n\r\nCan this be added to the example script?\r\n\r\n**Matplotlib version**\r\n * Operating system: Windows 10\r\n * Matplotlib version: 3.0.2\r\n * Python version: 3.7\r\n\r\n","author":{"url":"https://github.com/gigo318","@type":"Person","name":"gigo318"},"datePublished":"2019-02-10T19:12:21.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":15},"url":"https://github.com/13400/matplotlib/issues/13400"}
| 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:6903594d-b65c-a541-1634-577eca87467c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94B4:24C7F8:8D6611:C5E07F:6A5393CB |
| html-safe-nonce | 7f28bb6e8386192482a48f00ce061098615a652acf4b0cc18e14ad5c631d582a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEI0OjI0QzdGODo4RDY2MTE6QzVFMDdGOjZBNTM5M0NCIiwidmlzaXRvcl9pZCI6IjI0OTgyNjg5MTAzNDE4MjEzODgiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 004e541e3dffe919341ae6b0c71b90ea1cbec6490e5dd90a4c6f570e305c4c43 |
| hovercard-subject-tag | issue:408567831 |
| 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/matplotlib/matplotlib/13400/issue_layout |
| twitter:image | https://opengraph.githubassets.com/638c3e6dccef33673e49d7a555d6c23fe903b669eafdb757163641d706e73be4/matplotlib/matplotlib/issues/13400 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/638c3e6dccef33673e49d7a555d6c23fe903b669eafdb757163641d706e73be4/matplotlib/matplotlib/issues/13400 |
| og:image:alt | I have found a solution to a bug when using the script on: https://matplotlib.org/gallery/user_interfaces/embedding_in_qt_sgskip.html with the Spyder IDE (v3.3.2) If the script is run as presented,... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | gigo318 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b9a586c06a05a7a86fc7e3f4dbd03e42f6869085879aa184aa6369456dbd50fb |
| turbo-cache-control | no-preview |
| go-import | github.com/matplotlib/matplotlib git https://github.com/matplotlib/matplotlib.git |
| octolytics-dimension-user_id | 215947 |
| octolytics-dimension-user_login | matplotlib |
| octolytics-dimension-repository_id | 1385122 |
| octolytics-dimension-repository_nwo | matplotlib/matplotlib |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1385122 |
| octolytics-dimension-repository_network_root_nwo | matplotlib/matplotlib |
| 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 | 07a982c1d40157c619b364352b704c3ce66bb332 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width