【发布时间】:2015-03-14 09:28:25
【问题描述】:
我使用的是 Qt 5.2.1。我读过this 和that - 它不包括我的情况。我有 QSqlTableModel 和一个使用它的窗口。我想对其dataChanged 信号做出反应:
void QAbstractItemModel::dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles = QVector<int> ())
所以我在 windowClass 构造函数中初始化模型,如下所示:
kontrahentModel = new QSqlTableModel(this);
插槽声明如下:
void on_kontrahentModel_dataChanged(const QModelIndex & topLeft, const QModelIndex & bottomRight, const QVector<int> & roles = QVector<int> ());
相同数量的参数 - 但它会导致臭名昭著
QMetaObject::connectSlotsByName: (...) 没有匹配的信号
我错过了什么?它只适用于 GUI 信号吗?
【问题讨论】:
标签: qt qt5 signals-slots qt5.2