シグナル/スロットオプションを使用して2つのウィジェットを接続しようとしていますが、「そのようなスロットが存在しない」というエラーが発生し続けます。実際のところ、プログラムを書いている間、タイプミスをしないようにCtrl+Spaceを使用しました。
だから私は1つのウィジェットを持っています:
renderArea.h
クラスrenderArea:public QGraphicsView {{ Q_OBJECT 公衆: renderArea(QWidget * parent = 0); void addClothoid(float length、float startCurvature、float endCurvature); 信号: void sendData(float length、float startCurvature、float endCurvature); };
renderArea.cpp
void renderArea :: addClothoid(float length、float startCurvature、float endCurvature) {{ ..。 sendData(length、startCurvature、endCurvature);を発行します。 } }
2番目のウィジェット:
tableViewList.h
クラスTableViewList:パブリックQTableView {{ Q_OBJECT 公衆: TableViewList(QWidget * parent = 0); 保護されたスロット: void onClothoidAdded(float length、float startCurvature、float endCurvature); };
tableViewList.cpp
void TableViewList :: onClothoidAdded(float length、float startCurvature、float endCurvature) {{ ..。 }
およびメインウィジェット:
上記の2つを接続するrenderingwidget.cpp:
renderWidget :: renderingWidget(QWidget * parent): QWidget(親)、 ui(新しい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にプロモートされました。
では、なぜこのエラーが表示されるのでしょうか。