<?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 Communication]]></title><description><![CDATA[<p dir="auto">I have two apps both created in QT. I want to start the one app by the other. its fine. What I need to know is ,how to send some signals (contains arguments) to the second app using the first app.<br />
Please reply me with sample code for sending the message (first app) and receiving (second app) it.</p>
]]></description><link>https://forum.qt.io/topic/44788/qprocess-communication</link><generator>RSS for Node</generator><lastBuildDate>Tue, 21 Apr 2026 03:35:59 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/44788.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 12 Aug 2014 13:22:25 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to QProcess Communication on Wed, 13 Aug 2014 21:26:54 GMT]]></title><description><![CDATA[<p dir="auto">You application will crash because of line 5, you use m_pServer-&gt;nextPendingConnection and on't instantiate it first.</p>
]]></description><link>https://forum.qt.io/post/239853</link><guid isPermaLink="true">https://forum.qt.io/post/239853</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Wed, 13 Aug 2014 21:26:54 GMT</pubDate></item><item><title><![CDATA[Reply to QProcess Communication on Wed, 13 Aug 2014 14:16:38 GMT]]></title><description><![CDATA[<p dir="auto">This is coded in Qt console application</p>
<p dir="auto">@int main(int argc, char *argv[])<br />
{<br />
QLocalSocket * m_socket = new QLocalSocket();<br />
m_socket-&gt;connectToServer("SomeServer");        //how to give server name or is it path...</p>
<p dir="auto">if(m_socket-&gt;waitForConnected(1000))<br />
{<br />
//send a message to the server<br />
QByteArray block;<br />
QDataStream out(&amp;block, QIODevice::WriteOnly);<br />
out.setVersion(QDataStream::Qt_4_7);<br />
out &lt;&lt; "x";<br />
out.device()-&gt;seek(0);<br />
m_socket-&gt;write(block);<br />
m_socket-&gt;flush();<br />
QMessageBox box;<br />
box.setText("mesage has been sent");<br />
box.exec();<br />
...<br />
}</p>
<p dir="auto">@</p>
<p dir="auto">And this in Qt widget application</p>
<p dir="auto">where to create the below function...</p>
<p dir="auto">@<br />
void MainWindow::messageReceived()<br />
{</p>
<p dir="auto">QLocalServer *m_pServer;<br />
QLocalSocket *clientConnection = m_pServer-&gt;nextPendingConnection();</p>
<p dir="auto">while (clientConnection-&gt;bytesAvailable() &lt; (int)sizeof(quint32))<br />
clientConnection-&gt;waitForReadyRead();</p>
<p dir="auto">connect(clientConnection, SIGNAL(disconnected()),<br />
clientConnection, SLOT(deleteLater()));</p>
<p dir="auto">QDataStream in(clientConnection);<br />
in.setVersion(QDataStream::Qt_4_7);<br />
if (clientConnection-&gt;bytesAvailable() &lt; (int)sizeof(quint16)) {<br />
return;<br />
}</p>
<p dir="auto">QString message;<br />
in &gt;&gt; message;</p>
<p dir="auto">QMessageBox box;<br />
box.setText(QString(message));<br />
box.exec();<br />
}@</p>
<p dir="auto">I got both applications output but i didn't saw any communication between them.<br />
Please help...</p>
<p dir="auto"><a href="http://stackoverflow.com/questions/13061079/qlocalsocket-to-qlocalserver-message-being-corrupted-during-transfer" target="_blank" rel="noopener noreferrer nofollow ugc">http://stackoverflow.com/questions/13061079/qlocalsocket-to-qlocalserver-message-being-corrupted-during-transfer</a></p>
]]></description><link>https://forum.qt.io/post/239797</link><guid isPermaLink="true">https://forum.qt.io/post/239797</guid><dc:creator><![CDATA[aniljoby]]></dc:creator><pubDate>Wed, 13 Aug 2014 14:16:38 GMT</pubDate></item><item><title><![CDATA[Reply to QProcess Communication on Tue, 12 Aug 2014 21:27:34 GMT]]></title><description><![CDATA[<p dir="auto">Hi,</p>
<p dir="auto">You need to use an IPC system like e.g. QLocalSocket/Server. Have a look at Qt's documentation for IPC examples</p>
]]></description><link>https://forum.qt.io/post/239669</link><guid isPermaLink="true">https://forum.qt.io/post/239669</guid><dc:creator><![CDATA[SGaist]]></dc:creator><pubDate>Tue, 12 Aug 2014 21:27:34 GMT</pubDate></item></channel></rss>