How to call qDebug without the appended spaces and newline?

后端 未结 7 1783
耶瑟儿~
耶瑟儿~ 2020-12-13 08:33

I\'m using the the C++/Qt print function qDebug, but sometimes I would like to control how \", space and newline is appended and not use the default qDebug.

Let\'s

相关标签:
7条回答
  • The file $(QTDIR)/src/corelib/io/qdebug.h contains almost all definitions for the debug output methods. One of them is:

    inline QDebug &operator<<(const QString & t) { stream->ts << '\"' << t << '\"'; return maybeSpace(); }

    So there is no "official" way to suppress the quotes, but you can of course change qdebug.h or use your own copy or a modified and renamed copy of the QDebug class.

    0 讨论(0)
提交回复
热议问题