QGLWidget::renderText 边界框

发布于 2024-09-08 22:06:28 字数 76 浏览 0 评论 0原文

是否可以在逻辑坐标或窗口坐标中获取 QGLWidget::renderText() 输出的边界框?如何?

Is it possible to get the bounding box of the output of QGLWidget::renderText() in logical or window coordinates? How?

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

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

发布评论

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

评论(1

酷炫老祖宗 2024-09-15 22:06:28

您可以尝试使用 QFontMetrics::boundingRect()。另外,也许您需要考虑它如何处理换行符(\n)。

有一个重载的 QFontMetrics::boundingRect() 返回给定文本的边界矩形也位于指定的矩形内。

You can try to use QFontMetrics::boundingRect(). Also maybe you'll need to consider how it handles the newline character (\n).

There's an overloaded QFontMetrics::boundingRect() that returns the bounding rect of the given text within a specified rectangle as well.

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