In Qt, be careful when using singleton mode. Because static objects are used in singleton mode, static objects are not released until the end of the program, but once the static object is included in the QT parent-child system, it can lead to ambiguous behavior. And, even if we are careful not to pass the parent pointer over the constructor (that is, not to make a parent object for the static object), it is possible to redefine the parent object according to some mechanism of QT, which is the most deadly and most easily overlooked. So, using singleton mode in Qt, which is exactly "static object", be careful, especially those nested window classes that inherit from Qwidget, and even if we don't set the parent object for them, they will redefine the parent itself. By then, we may not be able to find the cause of the program crash.
Use singleton mode in Qt to be careful