从无法访问的项目Fork
Apparently certain versions of Qt have a bug where the tray icon's internal "visible" variable is set to false despite the fact that it still shows. Calling show() first before calling hide() sets the internal boolean value and fixes the issue with the hide call.