Ошибка PyQt QTimer и QPixmap без их использования

Поэтому я создаю программу с 2 классами, но когда я вызываю функцию из одного класса в другом классе, это дает мне эту ошибку:

QPixmap: It is not safe to use pixmaps outside the GUI thread
QPixmap: It is not safe to use pixmaps outside the GUI thread
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread
QObject::startTimer: QTimer can only be used with threads started with QThread

Я не использую QTimer или QPixmap, вот часть кода:

class Connect(QMainWindow):

    def __init__(self):
            # ...

    def connect(self):
            ip = self.iip.text()
            po = self.ipo.text()
            start_new_thread(self.client, (ip, int(po)))

    def client(self, i, p):
            s = socket(AF_INET, SOCK_STREAM)
            s.connect((i, p))
            data = s.recv(1024)
            Audo().addNewRoom(data)

class Audo(QMainWindow):

    def __init__(self):
            # ...

    def addNewRoom(self, room_name):
        self.rooms[room_name.lower()] = QTreeWidgetItem(self.roomsw, [room_name])

0 ответов

Другие вопросы по тегам