Hi!
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:
Qt Code:
  1. fetchThread = new FetchThread;
  2. model = new FeedModel;
  3. bool result;
  4. tableView->setModel(model);
  5. emit log("Jest model");
  6. [B] result = connect(tableView, SIGNAL(activated(const QModelIndex&)),
  7. fetchThread, SLOT(update(const QModelIndex&)));
  8. if (!result) {
  9. emit log("entered signal error");
  10. }
  11. [/B] fetchThread->setModel(model);
  12. fetchThread->start();
To copy to clipboard, switch view to plain text mode 
The update slot:
Qt Code:
  1. void FetchThread::update(QModelIndex &index)
  2. {
  3. log("Updating element: " + QString::number(index.row()) + ":" + QString::number(index.column()));
  4. QString str = index.data(Qt::DisplayRole).toString();
  5. model->setData(index, str+ "!");
  6. }
To copy to clipboard, switch view to plain text mode