Hello all,
i am porting a python application from qt3 to qt4 but i have some problem. Here is a minimal program showing the error i'm getting:
import sys,thread
from PyQt4 import QtGui, QtCore
win.setCentralWidget(table)
def change_row_count():
table.setRowCount(2)
thread.start_new_thread(change_row_count, ())
win.show()
app.exec_()
import sys,thread
from PyQt4 import QtGui, QtCore
app = QtGui.QApplication(sys.argv)
win = QtGui.QMainWindow()
table = QtGui.QTableWidget(1, 2)
win.setCentralWidget(table)
def change_row_count():
table.setRowCount(2)
thread.start_new_thread(change_row_count, ())
win.show()
app.exec_()
To copy to clipboard, switch view to plain text mode
and this is what i get (under linux):
$ python test.py
QObject::connect: Cannot queue arguments of type 'QModelIndex'
(Make sure 'QModelIndex' is registed using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QModelIndex'
(Make sure 'QModelIndex' is registed using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QModelIndex'
(Make sure 'QModelIndex' is registed using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QModelIndex'
(Make sure 'QModelIndex' is registed using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QModelIndex'
(Make sure 'QModelIndex' is registed using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QModelIndex'
(Make sure 'QModelIndex' is registed using qRegisterMetaType().)
QObject::connect: Cannot queue arguments of type 'QModelIndex'
(Make sure 'QModelIndex' is registed using qRegisterMetaType().)
changing rowCount in the main thread or commenting out setRowCount call in change_row_count() makes those errors disappear.
What's wrong?
Thanks in advance
Bookmarks