How to enable qDebug::noquote inside qMessageHandler?

338 Views Asked by At

How to enable

qDebug::noquote

inside custom message handler in Qt?

Without using qDebug().noquote()

qDebug().noquote() <<

every time.

1

There are 1 best solutions below

0
master_clown On

There is no need to call 'noquote()' every time, as it is said in here:

QDebug &QDebug::noquote()

Disables automatic insertion of quotation characters around QChar, QString and QByteArray contents and returns a reference to the stream.

When quoting is disabled, these types are printed without quotation characters and without escaping of non-printable characters.

If you use it inside a custom message handler, it would suffice to call 'noquote()' in the constructor.