【发布时间】:2021-10-31 21:07:15
【问题描述】:
我有一个QTableView,我需要从中获取 selectionChanged 事件。我似乎无法让连接正常工作。我有:
MyWidget.h
...
protected slots:
void slotLoadTransaction(const QItemSelection & selected, const QItemSelection & deselected);
private:
QTableView table;
...
MyWidget.cpp
...
connect(
table->selectionModel(),
SIGNAL(selectionChanged(const QItemSelection & selected, const QItemSelection & deselected)),
this,
SLOT(slotLoadTransaction(const QItemSelection & selected, const QItemSelection & deselected))
);
...
在运行时,我收到“没有这样的信号”错误。
【问题讨论】: