[Qt-interest] Regarding qWarning msgs

J-P Nurmi jpnurmi at gmail.com
Sat Dec 11 17:56:26 CET 2010


On Sat, Dec 11, 2010 at 6:02 PM, Mahendra G.R <mahendra at mahendragr.com> wrote:
> Hi all,
>
> i have some annoying warning messages, i suppose they are qWarning messages,
> is there a way to supress it?, i found out few links to have a custom
> message handler but for some reason its not working, is there anyother
> solution for this??.

Hi,

You can define QT_NO_WARNING_OUTPUT in order to suppress qWarning()'s
from your project:
http://doc.qt.nokia.com/4.7/debug.html#warning-and-debugging-messages.

If you have "annoying" warnings from Qt, should you rather fix the
code? :) Anyway, in order to suppress those, you could override the
message handler:
http://doc.qt.nokia.com/4.7/qtglobal.html#qInstallMsgHandler. There's
an example snippet how to install a message handler. If you still
cannot get it working, you have to provide more details than "doesn't
work".

--
J-P Nurmi



More information about the Qt-interest-old mailing list