Я пытаюсь подключить два виджета с помощью опции сигналов / слотов, но все еще получаю сообщение об ошибке, что «такого слота нет». Дело в том, что при написании программы я использовал 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); } }
второй виджет:
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.
Так почему же могла появиться эта ошибка?