Я пытаюсь соединить два виджета с помощью опции сигналов / слотов, но я получаю эту ошибку, что «такого слота нет».Дело в том, что при написании программы я использовал Ctrl + пробел, просто чтобы убедиться, что я не делаю опечаток.
, поэтому у меня есть один виджет:
renderArea.h
class renderArea : public QGraphicsView
{
Q_OBJECT
public:
renderArea(QWidget *parent = 0);
void addClothoid(float length, float startCurvature, float endCurvature);
signals:
void sendData(float length, float startCurvature, float endCurvature);
};
renderArea.cpp
void renderArea::addClothoid(float length, float startCurvature, float endCurvature)
{
...
emit sendData(length, startCurvature, endCurvature);
}
}
2-й виджет:
tableViewList.h
class TableViewList: public QTableView
{
Q_OBJECT
public:
TableViewList(QWidget* parent = 0);
protected slots:
void onClothoidAdded(float length, float startCurvature, float endCurvature);
};
tableViewList.cpp
void TableViewList::onClothoidAdded(float length, float startCurvature, float endCurvature)
{
...
}
и основной виджет:
renderwidget.cpp, где я соединяю 2 выше:
renderingWidget::renderingWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::renderingWidget)
{
ui->setupUi(this);
connect(ui->graphicsView, SIGNAL(sendData(float,float,float)), ui->clothoidTable,
SLOT(onClothoidAdded(float,float,float)));
}
ui-> graphicsView повышен до renderArea, а ui-> clothoidTable для TableViewList.
Так почему может появиться эта ошибка?