如何删除插槽,在Designer模式下创建?

问题描述:

我创建了 cancelButton 按钮。然后我创建了函数槽 on_cancelButton_clicked()它使用上下文菜单项转到槽。但是,一段时间后,我删除了这个按钮(它不再需要),并试图删除该函数,但编译器给出错误未定义的引用< class_name> :: on_cancelButton_clicked()

I've created the button cancelButton. Then I've created function-slot on_cancelButton_clicked() for it using context menu item Go to slot. But, after a while, I've deleted this button (it wasn't longer needed), and tried to delete that function, but compiler gives error undefined reference to <class_name>::on_cancelButton_clicked().

我已清除build文件夹(并删除了它),检查了ui文件中可以指向此函数的一些行,但我没有发现任何东西。

I've made cleanup of build folder (and removed it), checked for some lines in ui file that can point to this function, but i didn't found anything.

解决方案很简单。我没有从头文件中删除< class_name> :: on_cancelButton_clicked()的声明。 (由 Ammar 发布此处

Solution is simple. I didn't remove the declaration of <class_name>::on_cancelButton_clicked() from header file. (by Ammar, posted here)