Click here to Skip to main content
15,867,308 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying to execute


import executer

    class Window(QtWidegets.QWidget):
      def __init__(self):
            .....
            .....    
            self.runBtn = QtWidgets.QPushButton(self.tab)
            self.runBtn.clicked.connect(self.func2)

            ......

      def func1(self, text):
          self.tableWidget_2.setItem(row, 1, QtWidgets.QTableWidgetItem(text))


      def func2(self):
            .....
            .....
            t = threading.Thread(target=executer.execute_func, args=(self.func1))
            t.setDaemon(True)
            t.start()


executer.py

def execute_func(dispFunc):

      connect() #another thread is created in this funcn
      ......
      ......
      text = "Something"
      dispFunc(row, text)


On clicking the run button, when the func1 is called for displaying the text in the table widget, I am getting this error message:

QObject::connect: Cannot queue arguments of type 'QVector<int>' 
(Make sure 'QVector<int>' is registered using qRegisterMetaType().) 


What I have tried:

class MyThread(QThread):
    change_value = pyqtSignal(int, str)

    def run(self):
        .....

    def func2(self):
        self.thread = MyThread()
        self.thread.change_value.connect(self.func1)
        self.thread.start()


Please help
Posted
Updated 23-Nov-20 18:16pm
v2

1 solution

Quote:
Make sure 'QVector<int>' is registered using qRegisterMetaType()
Try following the instructions in the error message.

QMetaType Class | Qt Core 5.15.2[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900