PDA

View Full Version : No matching signal for on_pushButtonViewExistingProductRecords_clicked()



rahulvishwakarma
8th April 2020, 13:27
i've centos 7.5 and qt5.7 in VM. I am builfing a small project. I've added a button "pushButtonViewExistingProductRecords" and used slot by name for other buttons, after some time i removed that button (pushButtonViewExistingProductRecords ). after that compiler shows follwoing error, but project runs successfully. error is:-


QMetaObject::connectSlotsByName: No matching signal for on_pushButtonViewExistingProductRecords_clicked()

how to get rid of this.

Lesiok
8th April 2020, 13:39
Run full rebuild.

rahulvishwakarma
8th April 2020, 15:00
i did as follows :-

build -> clean project then
build -> rebuild project

but has no effect

d_stranz
8th April 2020, 15:57
You might have to either run qmake manually or edit the XML in the .ui file to remove the connection (which will be listed at the bottom of the file). Make a backup copy of the ui file first because if you mess up the editing, you will probably also break the UI itself.

This is one reason why I (and many other Qt developers, I think) don't like using automatically generated connections based on name. I don't like things that happen in code I don't see without a lot of poking around.

ChristianEhrlicher
8th April 2020, 19:40
> after some time i removed that button

But you forgot to remove the function - it is still there but the autoconnect feature can no longer find the associated button.

d_stranz
9th April 2020, 00:19
Yes, that's probably correct - the function declaration is hidden in the MOC-generated code, and the function implementation still exists in the cpp file. Another reason why I dislike auto-generated slots.

rahulvishwakarma
9th April 2020, 07:42
finally I get your point, and I deleted both declaration and implementation in header and source files. thanks a lot