View Full Version : I can't assign TableView signals...

8th January 2006, 16:20
I am trying to tie a signal to a slot in another thread, but in vain. The code compiles with no errors, but I get the message "entered signal error" and the link doesn't work. Could anyone help?
Creating the thread and assigning the signal to the slot:

fetchThread = new FetchThread;
model = new FeedModel;
bool result;
emit log("Jest model");
result = connect(tableView, SIGNAL(activated(const QModelIndex&)),
fetchThread, SLOT(update(const QModelIndex&)));
if (!result) {
emit log("entered signal error");
The update slot:

void FetchThread::update(QModelIndex &index)
log("Updating element: " + QString::number(index.row()) + ":" + QString::number(index.column()));
QString str = index.data(Qt::DisplayRole).toString();
model->setData(index, str+ "!");

8th January 2006, 16:56
Does your program output anything to the console (on windows you will have to add "CONFIG += console" to your .pro file)?

8th January 2006, 17:43
I turned on the console and it doesn't show anything.
log(QString) is my signal assigned with a slot in the main window showing some text in a textbrowser.

8th January 2006, 18:30
I turned on the console and it doesn't show anything.
Do you compile your program in debug mode ("CONFIG += debug")? If there is some problem with connection, Qt should write information on the console about it.

8th January 2006, 18:50
Looks like those two signatures don't match:

SLOT(update(const QModelIndex&)));

void FetchThread::update(QModelIndex &index)

Note the lack of the "const" modifier in the second signature.

9th January 2006, 22:04
Thank you! I created the debug libraries now and found my error. It dealed with types, indeed.