I am trying to connect two widgets through the signals/slots option but I keep getting this error that 'no such slot' exists. The fact is that while writing the program I used Ctrl + Space just to be sure I don't make any typos.
so I have one widget:
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);
}
}
the 2nd widget:
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)
{
...
}
and the main widget:
renderingwidget.cpp where i connect the 2 above:
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)));
}
the ui->graphicsView has been promoted to renderArea and the ui->clothoidTable to the TableViewList.
So why could this error be appearing?