<?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[QProcess readAll()]]></title><description><![CDATA[<p dir="auto">I'm qorking with QProcess and have a roadblock reading output:</p>
<p dir="auto">this first routine works: I get content in the QString I can query:</p>
<p dir="auto">@<br />
void start_server()<br />
{<br />
QProcess *start_adb=new QProcess;<br />
start_adb-&gt;start(adbfile + " start-server");<br />
start_adb-&gt;waitForFinished(-1);<br />
command=start_adb-&gt;readAll();<br />
delete start_adb;</p>
<pre><code> if (command.contains("daemon started successfully"))
     serverRunning = true;
     else
     serverRunning = false;
</code></pre>
<p dir="auto">}<br />
@</p>
<p dir="auto">The QString returns empty in the routine below:</p>
<p dir="auto">@<br />
if (!fileName.isEmpty() )<br />
{</p>
<pre><code>QMessageBox::StandardButton reply;
  reply = QMessageBox::question(this, "Install", "Install "+fileName+"?",
                                QMessageBox::Yes|QMessageBox::No);
  if (reply == QMessageBox::Yes)
  {
      QProcess *install_apk=new QProcess;
      install_apk-&gt;start(adbfile + " install -r" + fileName);
      install_apk-&gt;waitForFinished(-1);
      command=install_apk-&gt;readAll();
      delete install_apk;
      }

if (command.contains("failed"))
     install_failed  = true;
     else
     install_failed = false;
</code></pre>
<p dir="auto">}</p>
<p dir="auto">}</p>
<p dir="auto">@</p>
<p dir="auto">I can run this command manually and get output succeed or fail.</p>
]]></description><link>https://forum.qt.io/topic/42066/qprocess-readall</link><generator>RSS for Node</generator><lastBuildDate>Fri, 15 May 2026 06:38:53 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/42066.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 01 Jun 2014 21:50:12 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QProcess readAll() on Mon, 02 Jun 2014 00:58:14 GMT]]></title><description><![CDATA[<p dir="auto">Oops!   The command I build was malformed.</p>
<p dir="auto">This line:</p>
<p dir="auto">@<br />
install_apk-&gt;start(adbfile + " install -r" + fileName);<br />
@</p>
<p dir="auto">should be:</p>
<p dir="auto">@<br />
install_apk-&gt;start(adbfile + " install -r " + fileName);<br />
@</p>
<p dir="auto">Fixed.</p>
]]></description><link>https://forum.qt.io/post/230669</link><guid isPermaLink="true">https://forum.qt.io/post/230669</guid><dc:creator><![CDATA[jocala]]></dc:creator><pubDate>Mon, 02 Jun 2014 00:58:14 GMT</pubDate></item></channel></rss>