View Full Version : Creator: How do I tidy up after deleting a qspinbox from a form

7th February 2015, 11:34
I've used Creator to build my GUI. In order to act on the user changing values in spinboxes, I right click on the spinbox, select "go to slot" and select "on value changed". This gives me a member function in the main window class that gets called when the user changes the value. Very successful. Does exactly what I want. However, I changed my mind about some of the spinboxes and wanted to delete them. I clicked on the spinbox in the form editor and hit delete. Everything still compiles and runs OK but I can't tidy up. I now get runtime QMetaObject::connectSlotsByName: No matching signal for on_spinBox_25_valueChanged(int) errors. OK they're non-fatal but annoying. Also I get compile time errors if I delete the member function from the main window class. Can anyone help with some pointers on how to tidy up after deleting a spinbox from a form.

7th February 2015, 12:37
Delete or rename the slots matching the connect-by-name scheme.

7th February 2015, 13:09
Thanks. That was enough of a pointer to help me find out what to do. All OK now.

7th February 2015, 15:58
And another good example why the connect by name "feature" does more good than harm.

One never has to worry about things like that with propery explicit connects.


8th February 2015, 04:27
And another good example why the connect by name "feature" does more good than harm.

Agreed. Basic UI layout goes into the .ui files, advanced ui and program logic goes in the C++ files. You might end up with a lot more code, but it's right there in front of you, not implicit with some MOC magic.