I am using Qt 5.2.1. I read this, and that - it doesn't cover my case. I have QSqlTableModel , and a window that uses it. I want to react on its dataChanged signal:
void QAbstractItemModel::​dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles = QVector<int> ())
So I initialize the model in my windowClass constructor like this:
kontrahentModel = new QSqlTableModel(this);
And heres the slot declaration:
void on_kontrahentModel_dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles = QVector<int> ());
Same number of arguments - but it results in the infamous
QMetaObject::connectSlotsByName: No matching signal for (...)
What did I miss? Does it only work for GUI signals?
I fixed it by accident while writing this question... My model was missing a name. When I added
All worked like a charm...
BUT - "there is no rose without a thorn". When assigning a parent for the model, an old problem returns - described here: QSqlQueryModel with a parent - app crash