Qt threading done right (thread pool for word counter)

This commit is contained in:
Veronica K. B. Olsen
2020-10-07 15:04:13 +02:00
parent b6a4568254
commit 0c1aaecd78
2 changed files with 46 additions and 38 deletions
+2 -1
View File
@@ -32,7 +32,7 @@ import os
from datetime import datetime
from time import time
from PyQt5.QtCore import Qt, QTimer
from PyQt5.QtCore import Qt, QTimer, QThreadPool
from PyQt5.QtGui import QIcon, QPixmap, QColor, QKeySequence, QCursor
from PyQt5.QtWidgets import (
qApp, QMainWindow, QVBoxLayout, QWidget, QSplitter, QFileDialog, QShortcut,
@@ -60,6 +60,7 @@ class GuiMain(QMainWindow):
logger.debug("Initialising GUI ...")
self.setObjectName("GuiMain")
self.mainConf = nw.CONFIG
self.threadPool = QThreadPool()
# Some runtime info useful for debugging
logger.info("OS: %s" % self.mainConf.osType)