我应该设置什么属性来适应标签中的文本

发布于 2024-09-05 07:08:39 字数 213 浏览 0 评论 0原文

我想在 Qlabell 中显示一个大字符串,为此我只是在 Qt GUI 编辑器中创建了一个标签。

然后将字符串的 Wordwrap 属性设置为“ON”。

这里的文本本身不会进入下一行。相反,它穿过了视图区域。

但是,如果我给出 "\n" 它效果很好。

如何将大字符串放在标签中以显示在可见区域中?

I want to display a big string in a Qlablel for this I simply have created a label in the Qt GUI editor.

Then set the string with the Wordwrap property to "ON".

Here text is not coming to the next line itself. Instead, it's crossing the view region.

However, if I give an "\n" it works well.

How do I put up the big string in a label to display in a visible region?

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

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

发布评论

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

评论(1

忆依然 2024-09-12 07:08:40
label->setWordWrap(true);

请参阅QLabel::setWordWrap(bool on) 文档

label->setWordWrap(true);

See the QLabel::setWordWrap(bool on) documentation.

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