<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Python GUIs - pyqg6</title><link>https://www.pythonguis.com/</link><description>Create GUI applications with Python and Qt</description><atom:link href="https://www.pythonguis.com/feeds/pyqg6.tag.rss.xml" rel="self"/><lastBuildDate>Mon, 11 May 2020 09:00:00 +0000</lastBuildDate><item><title>Fixing Crashes When Using NumPy Arrays with QImage in Qt Threads — How to safely pass image data between threads when streaming video or updating displays</title><link>https://www.pythonguis.com/faq/crashing-in-qrunner-threads-with-numpy/</link><description>I'm using a threaded runner to stream a live video feed by converting a NumPy array to a &lt;code&gt;QImage&lt;/code&gt;, then to a &lt;code&gt;QPixmap&lt;/code&gt;, and displaying it on a &lt;code&gt;QLabel&lt;/code&gt;. But I'm frequently encountering crashes when the label is resized too quickly or the scroll area is scrolled. Could this be a problem with the &lt;code&gt;QImage&lt;/code&gt; memory buffer getting cleared before the &lt;code&gt;QPixmap&lt;/code&gt; can update? Is this fixable, or is it a fundamental issue with threads in Python/Qt?</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Martin Fitzpatrick</dc:creator><pubDate>Mon, 11 May 2020 09:00:00 +0000</pubDate><guid>tag:www.pythonguis.com,2020-05-11:/faq/crashing-in-qrunner-threads-with-numpy/</guid><category>python</category><category>pyqg6</category><category>pyside6</category><category>threads</category><category>numpy</category><category>qimage</category><category>concurrency</category><category>qt</category><category>qt6</category><category>data-science</category><category>pyside6-data-science</category><category>pyside6-concurrency</category></item></channel></rss>