Code scene:
The function calls setupUi okBtn twice inside the function
and the automatic connection slot function fails
problem analysis:
Such a function is called inside the setupUi function: connectSlotsByName
Judging from the function name, it is to connect the signal and the slot through the name (component name)
Explanation of the official document:
So the process should be like this:
The setupUi function will have a new resource inside, and the new resource will be called twice Twice, it involves the duplication of component object names. At this time, there are two okBtn. The connection method is to recursively retrieve the component object names. The first okBtn that is always connected appears, so the second okBtn is not connected, resulting in no effect ( Of course, you can use the connect function directly to connect normally, because it is through the memory to find the corresponding component connection )