[Development] QNoDebug - available but undocumented

Curtis Mitch mitch.curtis at theqtcompany.com
Fri Jul 31 10:48:24 CEST 2015


> -----Original Message-----
> From: development-bounces+mitch.curtis=theqtcompany.com at qt-project.org
> [mailto:development-bounces+mitch.curtis=theqtcompany.com at qt-
> project.org] On Behalf Of Tomasz Siekierda
> Sent: Friday, 31 July 2015 10:43 AM
> To: Smith Martin <Martin.Smith at theqtcompany.com>
> Cc: development at qt-project.org
> Subject: Re: [Development] QNoDebug - available but undocumented
> 
> On 31 July 2015 at 10:26, Smith Martin <Martin.Smith at theqtcompany.com>
> wrote:
> > qdebug.cpp should contain a comment like this:
> >
> > /*!
> >   \class QNoDebug
> >   \internal
> > */
> 
> Well, it does not contain this comment.
> 
> Olivier Goffart:
> > It's a fake class that replaces QDebug when QT_NO_DEBUG_OUTPUT is
> defined.
> > That way the code compiles but is optimized away.
> 
> Thanks for the explanation. I've asked because I've been surprised to
> see it being used in some project like this:
> 
> #ifdef DEBUG_FETCHER
>     #define fetcherDebug qDebug()
> #else
>     #define fetcherDebug NoDebug()
> #endif
> 
> as a temporary solution to enable debug output of a new feature.

What's the benefit of this over QLoggingCategory?

> _______________________________________________
> Development mailing list
> Development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/development



More information about the Development mailing list