QGLWidget::renderText 边界框
是否可以在逻辑坐标或窗口坐标中获取 QGLWidget::renderText() 输出的边界框?如何?
Is it possible to get the bounding box of the output of QGLWidget::renderText() in logical or window coordinates? How?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以尝试使用 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.