The Qt5 control triggers the problem solution of the slot function during initialization. qt5 triggers
In programming, such as the QSpinBox control and QComboBox control, when initializing the value range and content of the control, a signal is often triggered to call the corresponding slot function. This is often not the result we want.
Solution:
It can trigger the signal of the control and call the slot. This is because the signal of the control has been associated with the slot, so we only need to associate the signal and slot after initializing the control, in this way, the above situations can be avoided. Therefore, the code associated with the signal and the slot is put at the end of the constructor, or simply move the code associated with the signal and the slot to these functions, such as the showEvent (QShowEvent * evt) function after the interface Initialization is complete but not displayed.