<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[How to show&#x2F;hide application with shortcut?]]></title><description><![CDATA[<p dir="auto">hi<br />
I'm using windows<br />
how can i show or hide my application by press shortcut key?<br />
"such as some application that show with F11 or ..."</p>
]]></description><link>https://forum.qt.io/topic/17814/how-to-show-hide-application-with-shortcut</link><generator>RSS for Node</generator><lastBuildDate>Fri, 19 Jun 2026 13:52:06 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/17814.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 25 Jun 2012 09:35:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 10:29:47 GMT]]></title><description><![CDATA[<p dir="auto">You are welcome. Good luck and happy coding!</p>
]]></description><link>https://forum.qt.io/post/142601</link><guid isPermaLink="true">https://forum.qt.io/post/142601</guid><dc:creator><![CDATA[tucnak]]></dc:creator><pubDate>Mon, 25 Jun 2012 10:29:47 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 10:20:58 GMT]]></title><description><![CDATA[<p dir="auto">thanks for your reply.<br />
good luck.</p>
]]></description><link>https://forum.qt.io/post/142603</link><guid isPermaLink="true">https://forum.qt.io/post/142603</guid><dc:creator><![CDATA[absfrm]]></dc:creator><pubDate>Mon, 25 Jun 2012 10:20:58 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 10:17:02 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="abbas farahmand" date="1340619266"][quote author="abbas farahmand" date="1340617665"]<br />
Your code looks clear. Try to change it to it:<br />
@<br />
void MainWindow::showhide(){<br />
qDebug() &lt;&lt; "Ctrl+Space called.';<br />
}<br />
@</p>
<p dir="auto">and check Application Output on execution.<br />
[/quote]</p>
<p dir="auto">i changed it,but how can i check Application Output on execution?(sorry I'm not professional in qt)[/quote]</p>
<p dir="auto">You should Run (Ctrl+R) your application in Qt Creator and open in Qt Creator tab "Application Output". There will be all messages which your application prints with cout, cerr, qDebug(), qWarning(), etc.</p>
]]></description><link>https://forum.qt.io/post/142600</link><guid isPermaLink="true">https://forum.qt.io/post/142600</guid><dc:creator><![CDATA[tucnak]]></dc:creator><pubDate>Mon, 25 Jun 2012 10:17:02 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 10:14:26 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="abbas farahmand" date="1340617665"]<br />
Your code looks clear. Try to change it to it:<br />
@<br />
void MainWindow::showhide(){<br />
qDebug() &lt;&lt; "Ctrl+Space called.';<br />
}<br />
@</p>
<p dir="auto">and check Application Output on execution.<br />
[/quote]</p>
<p dir="auto">i changed it,but how can i check Application Output on execution?(sorry I'm not professional in qt)</p>
]]></description><link>https://forum.qt.io/post/142599</link><guid isPermaLink="true">https://forum.qt.io/post/142599</guid><dc:creator><![CDATA[absfrm]]></dc:creator><pubDate>Mon, 25 Jun 2012 10:14:26 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 10:12:07 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="AcerExtensa" date="1340618982"]bq. But I think that author want application-wide shortcut (like F11), so QShortcut will be better.</p>
<p dir="auto">Whats right, after authors second post  I see it too, what right choice for him is QShortcut :)</p>
<p dir="auto">bq. And I said about platform too. He can begin to want to build it on Linux for example.</p>
<p dir="auto">He can begin to want to capture the universe! Who knows? What we will do then? :) The platform was specified. :)</p>
<p dir="auto">Lets stop this discussion :)[/quote]</p>
<p dir="auto">OK. Thanks for discussion. Good luck.</p>
]]></description><link>https://forum.qt.io/post/142597</link><guid isPermaLink="true">https://forum.qt.io/post/142597</guid><dc:creator><![CDATA[tucnak]]></dc:creator><pubDate>Mon, 25 Jun 2012 10:12:07 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 10:09:42 GMT]]></title><description><![CDATA[<p dir="auto">bq. But I think that author want application-wide shortcut (like F11), so QShortcut will be better.</p>
<p dir="auto">Whats right, after authors second post  I see it too, what right choice for him is QShortcut :)</p>
<p dir="auto">bq. And I said about platform too. He can begin to want to build it on Linux for example.</p>
<p dir="auto">He can begin to want to capture the universe! Who knows? What we will do then? :) The platform was specified. :)</p>
<p dir="auto">Lets stop this discussion :)</p>
]]></description><link>https://forum.qt.io/post/142598</link><guid isPermaLink="true">https://forum.qt.io/post/142598</guid><dc:creator><![CDATA[AcerExtensa]]></dc:creator><pubDate>Mon, 25 Jun 2012 10:09:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 10:02:46 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="AcerExtensa" date="1340618195"]bq. I can’t understand what are you talking about. WINAPI working well on Windows</p>
<ol>
<li>platform is declared exactly.</li>
</ol>
<p dir="auto">bq. I’m using windows</p>
<ol start="2">
<li>Like I've said, I <em>thought</em> he need <em>systemwide</em> shortcut for his application. QShortcut will work only if application is activated(focused), RegisterHotKey can associate systemwide shortcut for application(like yakuake in linux or whatever). I was wrong, I'm sorry, forgive me peoples. <em>sarcasm</em></li>
</ol>
<p dir="auto">Can you understand it now? [/quote]</p>
<p dir="auto">I've understood. But I think that author want application-wide shortcut (like F11), so QShortcut will be better.</p>
<p dir="auto">And I said about platform too. He can begin to want to build it on Linux for example.</p>
]]></description><link>https://forum.qt.io/post/142595</link><guid isPermaLink="true">https://forum.qt.io/post/142595</guid><dc:creator><![CDATA[tucnak]]></dc:creator><pubDate>Mon, 25 Jun 2012 10:02:46 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 09:56:35 GMT]]></title><description><![CDATA[<p dir="auto">bq. I can’t understand what are you talking about. WINAPI working well on Windows</p>
<ol>
<li>platform is declared exactly.</li>
</ol>
<p dir="auto">bq. I’m using windows</p>
<ol start="2">
<li>Like I've said, I <em>thought</em> he need <em>systemwide</em> shortcut for his application. QShortcut will work only if application is activated(focused), RegisterHotKey can associate systemwide shortcut for application(like yakuake in linux or whatever). I was wrong, I'm sorry, forgive me peoples. <em>sarcasm</em></li>
</ol>
<p dir="auto">Can you understand it now?</p>
]]></description><link>https://forum.qt.io/post/142594</link><guid isPermaLink="true">https://forum.qt.io/post/142594</guid><dc:creator><![CDATA[AcerExtensa]]></dc:creator><pubDate>Mon, 25 Jun 2012 09:56:35 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 09:53:48 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="abbas farahmand" date="1340617665"]i used this code<br />
@<br />
QShortcut * shwHide = new QShortcut(QKeySequence("Ctrl+Space"), this);<br />
QObject::connect(shwHide, SIGNAL(activated()), this, SLOT(showhide()));<br />
///<br />
void MainWindow::showhide(){<br />
if (isVisible()){<br />
hide();<br />
}<br />
else{<br />
show();<br />
}<br />
}<br />
@</p>
<p dir="auto">what is Difference? [/quote]</p>
<p dir="auto">Your code looks clear. Try to change it to it:<br />
@<br />
void MainWindow::showhide(){<br />
qDebug() &lt;&lt; "Ctrl+Space called.';<br />
}<br />
@</p>
<p dir="auto">and check Application Output on execution.</p>
<p dir="auto">P.S. In other way you can implement QWidget::keyPressEvent(QKeyEvent*):<br />
@<br />
void MainWindow::keyPressEvent(QKeyEvent *e) {<br />
if(e-&gt;key() == Qt::Key_Space &amp;&amp; e-&gt;modifiers() == Qt::CtrlModifier) {<br />
qDebug() &lt;&lt; "called";<br />
return;<br />
}<br />
QWidget::keyPressEvent(e);<br />
}<br />
@</p>
]]></description><link>https://forum.qt.io/post/142593</link><guid isPermaLink="true">https://forum.qt.io/post/142593</guid><dc:creator><![CDATA[tucnak]]></dc:creator><pubDate>Mon, 25 Jun 2012 09:53:48 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 09:48:21 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="AcerExtensa" date="1340617534"]<em>tucnak</em> variant works for application-wide association, RegisterHotKey - is system wide. Have thought you are searching for system wide association...[/quote]</p>
<p dir="auto">I can't understand what are you talking about. WINAPI working well on Windows, but if author want to extend it for Linux, he will add some X11 functions. But Qt has QShortcut class which allow to do it on  the high-level.</p>
]]></description><link>https://forum.qt.io/post/142591</link><guid isPermaLink="true">https://forum.qt.io/post/142591</guid><dc:creator><![CDATA[tucnak]]></dc:creator><pubDate>Mon, 25 Jun 2012 09:48:21 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 09:47:45 GMT]]></title><description><![CDATA[<p dir="auto">i used this code<br />
@<br />
QShortcut * shwHide = new QShortcut(QKeySequence("Ctrl+Space"), this);<br />
QObject::connect(shwHide, SIGNAL(activated()), this, SLOT(showhide()));<br />
///<br />
void MainWindow::showhide(){<br />
if (isVisible()){<br />
hide();<br />
}<br />
else{<br />
show();<br />
}<br />
}<br />
@</p>
<p dir="auto">what is Difference?</p>
]]></description><link>https://forum.qt.io/post/142592</link><guid isPermaLink="true">https://forum.qt.io/post/142592</guid><dc:creator><![CDATA[absfrm]]></dc:creator><pubDate>Mon, 25 Jun 2012 09:47:45 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 09:45:34 GMT]]></title><description><![CDATA[<p dir="auto"><em>tucnak</em> variant works for application-wide association, RegisterHotKey - is system wide. Have thought you are searching for system wide association...</p>
]]></description><link>https://forum.qt.io/post/142588</link><guid isPermaLink="true">https://forum.qt.io/post/142588</guid><dc:creator><![CDATA[AcerExtensa]]></dc:creator><pubDate>Mon, 25 Jun 2012 09:45:34 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 09:44:38 GMT]]></title><description><![CDATA[<p dir="auto">[quote author="AcerExtensa" date="1340617362"]Simply use WINAPI function:  <em>RegisterHotKey</em> -&gt; <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms646309(v=vs.85).aspx%5B/quote%5D" target="_blank" rel="noopener noreferrer nofollow ugc">http://msdn.microsoft.com/en-us/library/windows/desktop/ms646309(v=vs.85).aspx[/quote]</a></p>
<p dir="auto">Why WINAPI? There is QShortcut which allows to do it on cross-platform level.</p>
]]></description><link>https://forum.qt.io/post/142587</link><guid isPermaLink="true">https://forum.qt.io/post/142587</guid><dc:creator><![CDATA[tucnak]]></dc:creator><pubDate>Mon, 25 Jun 2012 09:44:38 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 09:42:42 GMT]]></title><description><![CDATA[<p dir="auto">Simply use WINAPI function:  <em>RegisterHotKey</em> -&gt; <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms646309(v=vs.85).aspx" target="_blank" rel="noopener noreferrer nofollow ugc">http://msdn.microsoft.com/en-us/library/windows/desktop/ms646309(v=vs.85).aspx</a></p>
]]></description><link>https://forum.qt.io/post/142586</link><guid isPermaLink="true">https://forum.qt.io/post/142586</guid><dc:creator><![CDATA[AcerExtensa]]></dc:creator><pubDate>Mon, 25 Jun 2012 09:42:42 GMT</pubDate></item><item><title><![CDATA[Reply to How to show&#x2F;hide application with shortcut? on Mon, 25 Jun 2012 09:40:44 GMT]]></title><description><![CDATA[<p dir="auto">Qt Developers usually use "QShortcut":<a href="http://qt-project.org/doc/qt-5.0/qshortcut.html" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-5.0/qshortcut.html</a> class. It allows to set key sequence on slot.</p>
<p dir="auto">Example use:<br />
@<br />
QShortcut * shortcut = new QShortcut(QKeySequence(tr("Ctrl+O", "File|Open")), parent);<br />
connect(shortcut, SIGNAL(activated()), this, SLOT(openFile()));<br />
@</p>
<p dir="auto">It's easy as 1, 2, 3.</p>
]]></description><link>https://forum.qt.io/post/142585</link><guid isPermaLink="true">https://forum.qt.io/post/142585</guid><dc:creator><![CDATA[tucnak]]></dc:creator><pubDate>Mon, 25 Jun 2012 09:40:44 GMT</pubDate></item></channel></rss>