aboutsummaryrefslogtreecommitdiff
path: root/src/gui
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/mainwindow.py4
-rw-r--r--src/gui/preview_thread.py3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/gui/mainwindow.py b/src/gui/mainwindow.py
index f6de763..2bfc4e3 100644
--- a/src/gui/mainwindow.py
+++ b/src/gui/mainwindow.py
@@ -4,7 +4,7 @@
This shows a preview of the video being created and allows for saving
projects and exporting the video at a later time.
'''
-from PyQt5 import QtCore, QtGui, QtWidgets, uic
+from PyQt5 import QtCore, QtWidgets, uic
import PyQt5.QtWidgets as QtWidgets
from PIL import Image
from queue import Queue
@@ -754,7 +754,7 @@ class MainWindow(QtWidgets.QMainWindow):
self.autosave()
self.updateWindowTitle()
- @QtCore.pyqtSlot(QtGui.QImage)
+ @QtCore.pyqtSlot('QImage')
def showPreviewImage(self, image):
self.previewWindow.changePixmap(image)
diff --git a/src/gui/preview_thread.py b/src/gui/preview_thread.py
index 137864b..3943a5c 100644
--- a/src/gui/preview_thread.py
+++ b/src/gui/preview_thread.py
@@ -38,6 +38,7 @@ class Worker(QtCore.QObject):
"components": components,
}
self.queue.put(dic)
+ log.debug('Preview thread id: {}'.format(int(QtCore.QThread.currentThreadId())))
@pyqtSlot()
def process(self):
@@ -79,6 +80,8 @@ class Worker(QtCore.QObject):
except RuntimeError as e:
log.error(str(e))
else:
+ # We must store a reference to this QImage
+ # or else Qt will garbage-collect it on the C++ side
self.frame = ImageQt(frame)
self.imageCreated.emit(QtGui.QImage(self.frame))