Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否可以在溢出并显示垂直滚动条之前以某种方式计算适合 QPlainTextEdit 控件(具有一定大小)的行数?
获取盒子的高度和宽度然后计算它呢?您可以(手动)尝试为此找到一些合理的数字 - 取决于字体格式。