borges
6th September 2007, 11:53
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
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_()
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
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
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_()
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