<?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[Launch telnet from Qt GUI application]]></title><description><![CDATA[<p dir="auto">I have a Qt Widgets application for Windows 11, and I would like to have a control on the front panel that launches a telnet window in a command prompt, which would run independently of the application until the user closes it. I am trying to find a way to do this with QProcess but nothing seems to work. The suggestions I've found online say to use QProcess to launch cmd.exe with the telnet command and parameters in the argument list, but it doesn't work. If I run my application from the Run menu in Qt Creator, I see some output in the Application Output tab, but it doesn't pop up a separate terminal. If I run it outside Qt Creator by double-clicking the executable, nothing happens. I tried using the C++ system command instead of QProcess -- this launches the telnet window but causes the GUI to be unresponsive until the window is closed. How can I make this work? It seems like there should be a way.</p>
]]></description><link>https://forum.qt.io/topic/164904/launch-telnet-from-qt-gui-application</link><generator>RSS for Node</generator><lastBuildDate>Mon, 28 Sep 2026 06:46:19 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/164904.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Jul 2026 12:39:54 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Mon, 10 Aug 2026 12:58:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/emma-2000">@<bdi>Emma-2000</bdi></a> Is that not exactly what I wrote above at <a href="https://forum.qt.io/post/839250">https://forum.qt.io/post/839250</a> ?</p>
]]></description><link>https://forum.qt.io/post/839632</link><guid isPermaLink="true">https://forum.qt.io/post/839632</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 10 Aug 2026 12:58:10 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Mon, 10 Aug 2026 12:22:08 GMT]]></title><description><![CDATA[<p dir="auto">QProcess::startDetached() is probably the better approach here if the goal is to keep the Qt GUI responsive while the console runs independently.</p>
<p dir="auto">I would try launching cmd.exe and using start so that Windows creates a separate console process:</p>
<p dir="auto">QStringList args = {"/c", "start", "telnet.exe", "172.99.99.99"};<br />
bool ok = QProcess::startDetached("cmd.exe", args);<br />
qDebug() &lt;&lt; "started:" &lt;&lt; ok;</p>
<p dir="auto">The important part is start, because simply running cmd.exe /c telnet.exe ... may not give you the separate interactive window you're expecting. startDetached() also means the child process can continue after the Qt application exits.</p>
<p dir="auto">If telnet.exe isn't available through PATH, I'd also try using its full path.</p>
]]></description><link>https://forum.qt.io/post/839630</link><guid isPermaLink="true">https://forum.qt.io/post/839630</guid><dc:creator><![CDATA[Emma-2000]]></dc:creator><pubDate>Mon, 10 Aug 2026 12:22:08 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Wed, 22 Jul 2026 08:29:44 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> said in <a href="/post/839292">Launch telnet from Qt GUI application</a>:</p>
<blockquote>
<p dir="auto">and don't use QProcess::startDetached() if you want to interact with your application</p>
</blockquote>
<p dir="auto">and</p>
<blockquote>
<p dir="auto">That's the whole point of this function - fire and forget<br />
<a href="https://doc.qt.io/qt-6/qprocess.html#startDetached" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-6/qprocess.html#startDetached</a></p>
</blockquote>
<p dir="auto">Hi Christian.  I am sorry but I do not agree with your statements.  Under Linux at least <code>startDetached()</code> causes the child process not to get killed when the parent process exits, but it is not true to say that means you do not use if you need interaction.</p>
<p dir="auto">Testing under Linux at least, where <strong>telnet</strong> does <em>not</em> open its own window (maybe it does under Windows, I don't know) while, say, <strong>gedit</strong> does, I see the following behaviour:</p>
<ul>
<li><code>start("telnet")</code>: runs telnet (in the background), no window, exiting Qt app kills the telnet.</li>
<li><code>startDetached("telnet")</code>: same as <code>start()</code>, but exiting Qt app does not kill the telnet.</li>
<li><code>start("gedit")</code>: runs gedit, that creates its own window and interacts fine, exiting Qt app kills the gedit.</li>
<li><code>startDetached("gedit")</code>: same as <code>start()</code>, but exiting Qt app does not kill the gedit.</li>
</ul>
<p dir="auto">If I want a Linux spawned <strong>telnet</strong> to be visible and have a window I have to use something like e.g. <code>xterm -e telnet</code> as the command.  And again that behaves as above: dies on parent exit with <code>start()</code>, continues to run afterwards with <code>startDetached()</code>, but same interaction in both cases.</p>
<p dir="auto">Maybe it's different under Windows and/or with <strong>telnet</strong> there, but saying that "and don't use QProcess::startDetached() if you want to interact with your application" is not the story under Linux at least.  Which is why I expressed my surprise when you wrote that, as not my experience in Linux.</p>
]]></description><link>https://forum.qt.io/post/839308</link><guid isPermaLink="true">https://forum.qt.io/post/839308</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Wed, 22 Jul 2026 08:29:44 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Tue, 21 Jul 2026 14:29:56 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/jonb">@<bdi>JonB</bdi></a> said in <a href="/post/839291">Launch telnet from Qt GUI application</a>:</p>
<blockquote>
<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> said in <a href="/post/839290">Launch telnet from Qt GUI application</a>:</p>
<blockquote>
<p dir="auto">and don't use QProcess::startDetached() if you want to interact with your application</p>
</blockquote>
<p dir="auto">Oh, really??</p>
</blockquote>
<p dir="auto">That's the whole point of this function - fire and forget<br />
<a href="https://doc.qt.io/qt-6/qprocess.html#startDetached" target="_blank" rel="noopener noreferrer nofollow ugc">https://doc.qt.io/qt-6/qprocess.html#startDetached</a></p>
]]></description><link>https://forum.qt.io/post/839292</link><guid isPermaLink="true">https://forum.qt.io/post/839292</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 21 Jul 2026 14:29:56 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Tue, 21 Jul 2026 14:26:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> said in <a href="/post/839290">Launch telnet from Qt GUI application</a>:</p>
<blockquote>
<p dir="auto">and don't use QProcess::startDetached() if you want to interact with your application</p>
</blockquote>
<p dir="auto">Oh, really??</p>
]]></description><link>https://forum.qt.io/post/839291</link><guid isPermaLink="true">https://forum.qt.io/post/839291</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 21 Jul 2026 14:26:07 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Tue, 21 Jul 2026 14:24:14 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richferrara">@<bdi>richferrara</bdi></a> said in <a href="/post/839287">Launch telnet from Qt GUI application</a>:</p>
<blockquote>
<p dir="auto">For whatever reason, QProcess seems to only be capable of running applications in the background.</p>
</blockquote>
<p dir="auto">This is wrong. Please show your code and don't use QProcess::startDetached() if you want to interact with your application.</p>
]]></description><link>https://forum.qt.io/post/839290</link><guid isPermaLink="true">https://forum.qt.io/post/839290</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 21 Jul 2026 14:24:14 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Tue, 21 Jul 2026 14:24:29 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richferrara">@<bdi>richferrara</bdi></a><br />
<code>QProcess</code> should be fine.  You could also try having it run, say, <strong>notepad</strong>, if you don't think it can run e.g. a UI process.  Did you actually try either my code or <a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a>'s ?  If the Windows <strong>telnet</strong> opens its own window then you ought not <em>need</em> to run it via <code>cmd</code>/<code>start</code>?  I guess I will be quiet now as I cannot test under Windows, maybe <a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a> will.</p>
]]></description><link>https://forum.qt.io/post/839289</link><guid isPermaLink="true">https://forum.qt.io/post/839289</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 21 Jul 2026 14:24:29 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Tue, 21 Jul 2026 14:08:07 GMT]]></title><description><![CDATA[<p dir="auto">The windows telnet command normally runs in its own terminal window. For whatever reason, QProcess seems to only be capable of running applications in the background.</p>
]]></description><link>https://forum.qt.io/post/839287</link><guid isPermaLink="true">https://forum.qt.io/post/839287</guid><dc:creator><![CDATA[richferrara]]></dc:creator><pubDate>Tue, 21 Jul 2026 14:08:07 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Tue, 21 Jul 2026 10:48:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/christian-ehrlicher">@<bdi>Christian-Ehrlicher</bdi></a><br />
The OP essentially <em>claimed</em> to have tried this and <em>claimed</em> it did not work:</p>
<pre><code>The first thing I tried was just launching telnet directly:
QStringList args = {"172.99.99.99"}; // using my target IP address
QProcess::startDetached("telnet.exe", {args});
</code></pre>
<p dir="auto">That is why I tried "building up" step by step with them to see what was happening.  Have you tried this under Windows (which I cannot do)?  The question is whether the Windows' <strong>telnet</strong> opens any kind of "terminal/console/command" window for itself, the suggestion is it does not and hence is "invisible"?</p>
]]></description><link>https://forum.qt.io/post/839276</link><guid isPermaLink="true">https://forum.qt.io/post/839276</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 21 Jul 2026 10:48:07 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Tue, 21 Jul 2026 08:49:40 GMT]]></title><description><![CDATA[<p dir="auto">Why one needs to run a cmd.exe at all?</p>
<p dir="auto">Simply follow the docs</p>
<pre><code>QObject *parent = new QObject;
...
QString program = "telnet";
QStringList arguments;
arguments &lt;&lt; "172.99.99.99";

QProcess *myProcess = new QProcess(parent);
myProcess-&gt;start(program, arguments);
</code></pre>
]]></description><link>https://forum.qt.io/post/839273</link><guid isPermaLink="true">https://forum.qt.io/post/839273</guid><dc:creator><![CDATA[Christian Ehrlicher]]></dc:creator><pubDate>Tue, 21 Jul 2026 08:49:40 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Tue, 21 Jul 2026 07:49:39 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richferrara">@<bdi>richferrara</bdi></a> said in <a href="/post/839252">Launch telnet from Qt GUI application</a>:</p>
<blockquote>
<p dir="auto">system("start telnet") works.</p>
</blockquote>
<p dir="auto">As should the code I suggested sticking with <code>QProcess</code>.</p>
]]></description><link>https://forum.qt.io/post/839267</link><guid isPermaLink="true">https://forum.qt.io/post/839267</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Tue, 21 Jul 2026 07:49:39 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Mon, 20 Jul 2026 20:07:55 GMT]]></title><description><![CDATA[<p dir="auto">I figured it out.</p>
<p dir="auto">system("start telnet") works.</p>
]]></description><link>https://forum.qt.io/post/839252</link><guid isPermaLink="true">https://forum.qt.io/post/839252</guid><dc:creator><![CDATA[richferrara]]></dc:creator><pubDate>Mon, 20 Jul 2026 20:07:55 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Mon, 20 Jul 2026 17:45:31 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richferrara">@<bdi>richferrara</bdi></a><br />
I really would expect</p>
<pre><code>QStringList args = {"/c", "start telnet"};
QProcess::startDetached("cmd", {args});
</code></pre>
<p dir="auto">to work, no?  I am expecting this at least to open a terminal/console where you can interact with <strong>telnet</strong>.  I do not expect it to get "destroyed".  I expect it to work both inside and outside <strong>Creator</strong>.  But I can't test anything.</p>
]]></description><link>https://forum.qt.io/post/839250</link><guid isPermaLink="true">https://forum.qt.io/post/839250</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 20 Jul 2026 17:45:31 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Mon, 20 Jul 2026 16:57:23 GMT]]></title><description><![CDATA[<p dir="auto">Running the telnet command, I see this in the Application Output tab:</p>
<p dir="auto">true<br />
false<br />
"\r\nC:\[path to my executable]&gt;" ""<br />
QProcess: Destroyed while process ("cmd.exe") is still running</p>
<p dir="auto">Running the dir command, I see the output of dir start displaying in the tab.</p>
<p dir="auto">I only see anything when I run my executable through Qt Creator's Run menu. If I run outside Qt Creator, I see no output.</p>
]]></description><link>https://forum.qt.io/post/839249</link><guid isPermaLink="true">https://forum.qt.io/post/839249</guid><dc:creator><![CDATA[richferrara]]></dc:creator><pubDate>Mon, 20 Jul 2026 16:57:23 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Mon, 20 Jul 2026 16:14:43 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richferrara">@<bdi>richferrara</bdi></a><br />
Start with, say:</p>
<pre><code class="language-cpp">QProcess p;
QStringList args = {"/k", "telnet.exe"};
p.start("cmd.exe", args);
qDebug() &lt;&lt; p.waitForStarted(3000);
qDebug() &lt;&lt; p.waitForFinished(3000);
qDebug() &lt;&lt; p.readAllStandardOutput() &lt;&lt; p.readAllStandardError();
</code></pre>
<p dir="auto">Depending on what you get, try changing to:</p>
<pre><code class="language-cpp">QStringList args = {"/c", "dir /s C:\\"};
</code></pre>
<p dir="auto">First thing is to figure out that you're getting the command right.  Then deal with needing a console to run the <strong>telnet</strong> in.</p>
]]></description><link>https://forum.qt.io/post/839248</link><guid isPermaLink="true">https://forum.qt.io/post/839248</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 20 Jul 2026 16:14:43 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Mon, 20 Jul 2026 15:38:31 GMT]]></title><description><![CDATA[<p dir="auto">The first thing I tried was just launching telnet directly:<br />
QStringList args = {"172.99.99.99"};  // using my target IP address<br />
QProcess::startDetached("telnet.exe", {args});</p>
<p dir="auto">Then I read online that I needed to run the command prompt instead and include telnet in the arguments list:<br />
QStringList args = {"/c", "telnet.exe", "172.99.99.99"}; // also tried "/k"; also tried no "/" argument<br />
QProcess::startDetached("cmd.exe", args);</p>
<p dir="auto">I also tried putting in the complete path to cmd.exe and telnet.exe, then I tried creating a QProcess object and using qProcess.start() instead of the static startDetached. Nothing worked.</p>
]]></description><link>https://forum.qt.io/post/839247</link><guid isPermaLink="true">https://forum.qt.io/post/839247</guid><dc:creator><![CDATA[richferrara]]></dc:creator><pubDate>Mon, 20 Jul 2026 15:38:31 GMT</pubDate></item><item><title><![CDATA[Reply to Launch telnet from Qt GUI application on Mon, 20 Jul 2026 13:46:34 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/richferrara">@<bdi>richferrara</bdi></a> said in <a href="/post/839242">Launch telnet from Qt GUI application</a>:</p>
<blockquote>
<p dir="auto">I am trying to find a way to do this with QProcess but nothing seems to work. The suggestions I've found online say to use QProcess to launch cmd.exe with the telnet command and parameters in the argument list, but it doesn't work.</p>
</blockquote>
<blockquote>
<p dir="auto">I tried using the C++ system command instead of QProcess -- this launches the telnet window</p>
</blockquote>
<p dir="auto">Could you show <em>precisely</em> what you have tried (i.e. showing code and full command line) (a) with <code>QProcess</code> and (b) with <code>system</code> command.  May be able to help --- this is my area but I only run Qt under Linux so it may be guesswork!</p>
]]></description><link>https://forum.qt.io/post/839244</link><guid isPermaLink="true">https://forum.qt.io/post/839244</guid><dc:creator><![CDATA[JonB]]></dc:creator><pubDate>Mon, 20 Jul 2026 13:46:34 GMT</pubDate></item></channel></rss>