Avatar ·

How to implement multithreading in PyQt?

📁 Multiprocessing, Advanced Python Topics, example

For example, there is such a code:

import sys
from PyQt5 import QtCore, QtGui, QtWidgets, uic

class MyWin(QtWidgets.QMainWindow):
    def __init__(self, parent=None):
        QtWidgets.QWidget.__init__(self, parent)
        self.menu()

    def menu(self):
        uic.loadUi("menu.ui", self)
        '''''here is all logic, UI changes, etc.'''

if __name__ == "__main__":
    app = QtWidgets.QApplication(sys.argv)
    w = MyWin()
    w.show()
    sys.exit(app.exec_())