开发者

What event (if any) does QTextEdit fire when the size of its content changes?

As the title says, how can I receive notification whenever a multi-line QTextEdit changes the size of its content?

(Note: content size is different from the control size, i.e. I want to know when lines were added or removed, or change开发者_如何学运维d height because of a font change).


QTextEdit has a textChanged() signal which will do what you want. From the docs:

"This signal is emitted whenever the document's content changes; for example, when text is inserted or deleted, or when formatting is applied."

I wasn't sure if formatting included font changes but I tested it and it does.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜