<?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[QT + system command]]></title><description><![CDATA[<p dir="auto">Hi all,</p>
<p dir="auto">I am trying to trigger a command "sudo apt-get install --only-upgrade [mysoftware]" in qt so that the linux will update my software when i click update manually.<br />
Following is piece of code thats not working :<br />
void MainWindow:: on_whichos_clicked()<br />
{<br />
QMessageBox msgBox;</p>
<p dir="auto">msgBox.setWindowTitle("Which OS ?");<br />
#ifdef Q_OS_LINUX<br />
QProcess process;</p>
<pre><code>process.start("sudo apt-get", QStringList() &lt;&lt; "install setserial" );
msgBox.setInformativeText("This is Linux OS :)");__
</code></pre>
<p dir="auto">Above code works if the process is gui based but the apt-get or any other shell based process does not work. I am trying to do same thing on windows and mac for my auto update feature.</p>
]]></description><link>https://forum.qt.io/topic/31795/qt-system-command</link><generator>RSS for Node</generator><lastBuildDate>Tue, 22 Sep 2026 23:20:38 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/31795.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 10 Sep 2013 10:15:07 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QT + system command on Wed, 06 Jan 2016 15:06:53 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">I am trying to use QT process as;</p>
<p dir="auto">// Create QProcess object<br />
proc = new QProcess();<br />
proc-&gt;start("ping", QStringList() &lt;&lt; "-c 10" &lt;&lt; QString(<a href="http://www.google.com" target="_blank" rel="noopener noreferrer nofollow ugc">www.google.com</a>));</p>
<p dir="auto">And I am gettig error as;</p>
<p dir="auto">ping: Invalid number '10'</p>
<p dir="auto">Any help please,</p>
<p dir="auto">Kind Regards</p>
]]></description><link>https://forum.qt.io/post/305854</link><guid isPermaLink="true">https://forum.qt.io/post/305854</guid><dc:creator><![CDATA[NTCYP]]></dc:creator><pubDate>Wed, 06 Jan 2016 15:06:53 GMT</pubDate></item><item><title><![CDATA[Reply to QT + system command on Fri, 11 Oct 2013 20:35:03 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">In addition to what Tobias wrote, you will also need a mean to ask the user for it's password i.g. using the -A option</p>
]]></description><link>https://forum.qt.io/post/198745</link><guid isPermaLink="true">https://forum.qt.io/post/198745</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Fri, 11 Oct 2013 20:35:03 GMT</pubDate></item><item><title><![CDATA[Reply to QT + system command on Fri, 11 Oct 2013 17:53:52 GMT]]></title><description><![CDATA[<p dir="auto">@process.start(“sudo apt-get”, QStringList() &lt;&lt; “install setserial” ); @</p>
<p dir="auto">should read</p>
<p dir="auto">@process.start(“sudo", QStringList() &lt;&lt; "apt-get” &lt;&lt; “install" &lt;&lt; "setserial” );@</p>
<p dir="auto">There is no command on your system called "sudo apt-get". Commands containing spaces are legal, but tend to be avoided on Linux.</p>
]]></description><link>https://forum.qt.io/post/198737</link><guid isPermaLink="true">https://forum.qt.io/post/198737</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Fri, 11 Oct 2013 17:53:52 GMT</pubDate></item><item><title><![CDATA[Reply to QT + system command on Thu, 12 Sep 2013 14:25:43 GMT]]></title><description><![CDATA[<p dir="auto">You can try popen() with write only flag, so you dont have to use another thread (like with system()).</p>
]]></description><link>https://forum.qt.io/post/195127</link><guid isPermaLink="true">https://forum.qt.io/post/195127</guid><dc:creator><![CDATA[puksec]]></dc:creator><pubDate>Thu, 12 Sep 2013 14:25:43 GMT</pubDate></item><item><title><![CDATA[Reply to QT + system command on Tue, 10 Sep 2013 14:44:33 GMT]]></title><description><![CDATA[<p dir="auto">Hi, AFAIK, QProcess works for all the cases in mentioned.</p>
<p dir="auto">Please note that, if you want to run bash command, the program you started is the bash instead of the bash command. If you run some command such as "sudo apt-get ...", the command is sudo.</p>
]]></description><link>https://forum.qt.io/post/194814</link><guid isPermaLink="true">https://forum.qt.io/post/194814</guid><dc:creator><![CDATA[dbzhang800]]></dc:creator><pubDate>Tue, 10 Sep 2013 14:44:33 GMT</pubDate></item><item><title><![CDATA[Reply to QT + system command on Tue, 10 Sep 2013 12:51:15 GMT]]></title><description><![CDATA[<p dir="auto">You could make a separate thread and use system() call in that thread</p>
]]></description><link>https://forum.qt.io/post/194803</link><guid isPermaLink="true">https://forum.qt.io/post/194803</guid><dc:creator><![CDATA[[[global:former-user]]]]></dc:creator><pubDate>Tue, 10 Sep 2013 12:51:15 GMT</pubDate></item></channel></rss>