重定向 QObject::dumpObjectInfo()

发布于 2024-12-27 01:46:29 字数 89 浏览 2 评论 0原文

是否可以获取 QObject::dumpObjectInfo() 的输出并通过 qDebug 通道以外的其他方式显示它?理想情况下,我想将此方法的输出转换为字符串。

Is it possible to get the output of QObject::dumpObjectInfo() and display it through something other than the qDebug channel? Ideally, I would like to get the output of this method into a string.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

删除会话 2025-01-03 01:46:29

不,这是不可能的,因为 qDebug() 调用在方法中被硬编码:http://qt.gitorious.org/qt/qt/blobs/fd529383c4491580db344fb3d8035bd0ad3cb5e0/src/corelib/kernel/qobject.cpp#line3689

但是您可以通过安装消息处理程序来重定向调试通道本身:<一href="http://developer.qt.nokia.com/doc/qt-4.8/qtglobal.html#qInstallMsgHandler" rel="nofollow">http://developer.qt.nokia.com/doc/qt-4.8 /qtglobal.html#qInstallMsgHandler

No, it is impossible due to qDebug() calls are hardcoded in the method: http://qt.gitorious.org/qt/qt/blobs/fd529383c4491580db344fb3d8035bd0ad3cb5e0/src/corelib/kernel/qobject.cpp#line3689

But you can redirect debug channel itself by installing message handler: http://developer.qt.nokia.com/doc/qt-4.8/qtglobal.html#qInstallMsgHandler

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文