Qt quitOnLastWindowClosed及setQuitOnLastWindowClosed(bool)
quitOnLastWindowClosed属性用于控制应用程序退出方式,如果为true(默认),QApplication会在最后一个可见的窗口关闭后退出。如果设置为false,窗口关闭后,应用程序仍可以在后台运行。可以通过setQuitOnLastWindowClosed函数进行设置,该函数是QGuipplication(QApplication)父类的静态函数。setQuitOnLastWindowClosed实际调用的是QApplication的父类QCorepplication的setQuitLockEnabled函数,用于设置全局静态变量quitLockRefEnable(默认为true)。

浙公网安备 33010602011771号