<?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[How do I stop QT writing to console?]]></title><description><![CDATA[<p dir="auto">I start my QT application (on Linux, from the command line), and interact with it. Every so often, it dumps a string to the command line; usually a whinge about how a slot doesn't exist so a signal can't be connected, or maybe <em>QTextCursor::setPosition: Position '-1' out of range</em> or some other such.</p>
<p dir="auto">I find lots of information about how I can get QT to output this sort of thing; how can I <em>stop</em> it polluting the console?</p>
]]></description><link>https://forum.qt.io/topic/32412/how-do-i-stop-qt-writing-to-console</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 08:10:08 GMT</lastBuildDate><atom:link href="https://forum.qt.io/topic/32412.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 26 Sep 2013 12:18:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to How do I stop QT writing to console? on Thu, 26 Sep 2013 13:36:23 GMT]]></title><description><![CDATA[<p dir="auto">You can change where Qt prints out debug messages, warnings, critical and fatal error messages by installing a new message handler.</p>
<p dir="auto">See the documentation :<br />
<a href="http://qt-project.org/doc/qt-5.0/qtcore/qtglobal.html#qInstallMessageHandler" target="_blank" rel="noopener noreferrer nofollow ugc">http://qt-project.org/doc/qt-5.0/qtcore/qtglobal.html#qInstallMessageHandler</a></p>
<p dir="auto">For example, you can choose to redirect them in a log file.</p>
]]></description><link>https://forum.qt.io/post/196815</link><guid isPermaLink="true">https://forum.qt.io/post/196815</guid><dc:creator><![CDATA[Tom C]]></dc:creator><pubDate>Thu, 26 Sep 2013 13:36:23 GMT</pubDate></item><item><title><![CDATA[Reply to How do I stop QT writing to console? on Thu, 26 Sep 2013 13:22:46 GMT]]></title><description><![CDATA[<p dir="auto">In the Code you may achieve the same effect with</p>
<p dir="auto">int fd = ::open("/dev/null/",O_WRONLY,0744 );<br />
if(fd!=-1)<br />
{<br />
dup2(fd,1)<br />
dup2(fd,2)<br />
close(fd);<br />
}</p>
<p dir="auto">A simpler solution ould be to simply wrte a bash frontend like<br />
/bin/application which does</p>
<p dir="auto">#!/bin/bash</p>
<p dir="auto">/bin/application-bin &gt;/dev/null 2&gt;&amp;1</p>
]]></description><link>https://forum.qt.io/post/196813</link><guid isPermaLink="true">https://forum.qt.io/post/196813</guid><dc:creator><![CDATA[oncaphillis]]></dc:creator><pubDate>Thu, 26 Sep 2013 13:22:46 GMT</pubDate></item><item><title><![CDATA[Reply to How do I stop QT writing to console? on Thu, 26 Sep 2013 12:41:03 GMT]]></title><description><![CDATA[<p dir="auto">The intention is that the user should not under ordinary circumstances have messages presented in the console, so silent is fine.</p>
<p dir="auto">I'd rather not have to do some command-line fu to get this right; the current requirement is that the user should be able to start the application with no more than typing the name of the application at the command line, so a fix that requires them to do more is off the table at the moment.</p>
]]></description><link>https://forum.qt.io/post/196804</link><guid isPermaLink="true">https://forum.qt.io/post/196804</guid><dc:creator><![CDATA[Moschops]]></dc:creator><pubDate>Thu, 26 Sep 2013 12:41:03 GMT</pubDate></item><item><title><![CDATA[Reply to How do I stop QT writing to console? on Thu, 26 Sep 2013 12:25:45 GMT]]></title><description><![CDATA[<p dir="auto">Is simple redirection on the command line a solution ?</p>
<p dir="auto"><em>command &gt;/dev/null 2&gt;&amp;1</em></p>
<p dir="auto">But then it is totally silent</p>
]]></description><link>https://forum.qt.io/post/196802</link><guid isPermaLink="true">https://forum.qt.io/post/196802</guid><dc:creator><![CDATA[oncaphillis]]></dc:creator><pubDate>Thu, 26 Sep 2013 12:25:45 GMT</pubDate></item></channel></rss>