gpt4 book ai didi

c++ - 如何对齐 QTextEdit 文本

转载 作者:行者123 更新时间:2023-11-30 00:43:55 25 4
gpt4 key购买 nike

如何对齐此文本? \t 不好。

我看到的(图片)

预期结果(图片)

最佳答案

我以前遇到过这个问题。为了解决这个问题,我使用了 monospace 字体。

为了让所有内容对齐(固定字体宽度),我使用了这些行:

  // Use "monospaced" font: 
// ->insure left column alignment, as for the terminal
//
QFont font("monospace");
font.setPointSize(10);
myQTextEdit->setCurrentFont(font);

来 self 的包含 QTextEdit 的父小部件子部件。

关于c++ - 如何对齐 QTextEdit 文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51784074/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com