Restore Mac Application Window after Cmd-H: Difference between revisions

From Qt Wiki
Jump to navigation Jump to search
No edit summary
 
mNo edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 1: Line 1:
=How to restore an OS X application window after hiding with Cmd-H=
[[Category:HowTo]]
 
[[Category:snippets]]
If you have hidden an OS X Application with Cmd-H (aka Apple-H = ⌘-H) the hidden window cannot be shown again by calling slot show(). In this case you must call
If you have hidden an OS X Application with Cmd-H (aka Apple-H = ⌘-H) the hidden window cannot be shown again by calling slot show(). In this case you must call


If you have installed a system tray icon with [http://doc.qt.nokia.com/stable/qsystemtrayicon.html QSystemTrayIcon] ''[doc.qt.nokia.com]'' you can add a menu entry and connect the [http://doc.qt.nokia.com/stable/qaction.html QAction’s] ''[doc.qt.nokia.com]'' triggered() signal with the respecitve slots.
<code>
 
raise();
===Categories:===
// maybe additionally to activate the window:
activateWindow();
</code>


* [[:Category:HowTo|HowTo]]
If you have installed a system tray icon with [http://doc.qt.io/qt-5/qsystemtrayicon.html QSystemTrayIcon] you can add a menu entry and connect the [http://doc.qt.io/qt-5/qaction.html QAction's] triggered() signal with the respecitve slots.
* [[:Category:snippets|snippets]]

Latest revision as of 14:10, 24 March 2016

If you have hidden an OS X Application with Cmd-H (aka Apple-H = ⌘-H) the hidden window cannot be shown again by calling slot show(). In this case you must call

raise();
// maybe additionally to activate the window:
activateWindow();

If you have installed a system tray icon with QSystemTrayIcon you can add a menu entry and connect the QAction's triggered() signal with the respecitve slots.