<?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[Test doubleclick on QSystemTrayIcon]]></title><description><![CDATA[<p dir="auto">I'm trying to test that my application gets activated when the system tray icon is double-clicked.<br />
Since QSystemTrayIcon is not derived from QWidget, I can't use QTest::mouseDClick.</p>
<p dir="auto">The only solution i have found sofar is using the windows funtions SetCursorPos and mouse_event, but it seems very brittle to have to move the cursor to a certain position and have it double-click there.</p>
<p dir="auto">Is there a QT way of doing this instead?</p>
<p dir="auto">BR. Kenneth.</p>
]]></description><link>https://forum.qt.io/topic/74856/test-doubleclick-on-qsystemtrayicon</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Jul 2026 16:09:31 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/74856.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 06 Jan 2017 08:16:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Test doubleclick on QSystemTrayIcon on Fri, 06 Jan 2017 08:51:55 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/arashz4">@<bdi>ARASHz4</bdi></a> Thanks. I already had that written. I was trying to make a unit-test that tested it.</p>
]]></description><link>https://forum.qt.io/post/367715</link><guid isPermaLink="true">https://forum.qt.io/post/367715</guid><dc:creator><![CDATA[kjoo]]></dc:creator><pubDate>Fri, 06 Jan 2017 08:51:55 GMT</pubDate></item><item><title><![CDATA[Reply to Test doubleclick on QSystemTrayIcon on Fri, 06 Jan 2017 08:50:16 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/vronin">@<bdi>VRonin</bdi></a> Thanks. I think this is a good solution.</p>
]]></description><link>https://forum.qt.io/post/367714</link><guid isPermaLink="true">https://forum.qt.io/post/367714</guid><dc:creator><![CDATA[kjoo]]></dc:creator><pubDate>Fri, 06 Jan 2017 08:50:16 GMT</pubDate></item><item><title><![CDATA[Reply to Test doubleclick on QSystemTrayIcon on Fri, 06 Jan 2017 08:34:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/kjoo">@<bdi>kjoo</bdi></a> said in <a href="/topic/74856/test-doubleclick-on-qsystemtrayicon/1">Test doubleclick on QSystemTrayIcon</a>:</p>
<blockquote>
<p dir="auto">I'm trying to test that my application gets activated when the system tray icon is double-clicked.</p>
</blockquote>
<p dir="auto">you can manually emit the signal: <code>tray-&gt;activated(QSystemTrayIcon::DoubleClick);</code></p>
<p dir="auto">I know it's not <em>exactly</em> the same as actually double clicking but if you are not reimplementing QSystemTrayIcon then you do not need to test the link between click and signal as it is already done in Qt's own tests</p>
]]></description><link>https://forum.qt.io/post/367706</link><guid isPermaLink="true">https://forum.qt.io/post/367706</guid><dc:creator><![CDATA[VRonin]]></dc:creator><pubDate>Fri, 06 Jan 2017 08:34:56 GMT</pubDate></item><item><title><![CDATA[Reply to Test doubleclick on QSystemTrayIcon on Fri, 06 Jan 2017 08:23:12 GMT]]></title><description><![CDATA[<pre><code>Tray-&gt;connect(Tray, SIGNAL(activated(QSystemTrayIcon::ActivationReason)), this,
                    SLOT(RestoreWindowTrigger(QSystemTrayIcon::ActivationReason)));
</code></pre>
<pre><code>void MainWindow::RestoreWindowTrigger(QSystemTrayIcon::ActivationReason RW)
{
    if(RW == QSystemTrayIcon::DoubleClick)
    {
        show();
        activateWindow();
    }
}
</code></pre>
]]></description><link>https://forum.qt.io/post/367702</link><guid isPermaLink="true">https://forum.qt.io/post/367702</guid><dc:creator><![CDATA[ARASHz4]]></dc:creator><pubDate>Fri, 06 Jan 2017 08:23:12 GMT</pubDate></item></channel></rss>