我希望我的文本光标始终位于QTextEdit的相同垂直位置。
例如,假设我有(*I* = 光标,==== 分隔编辑框)。假设*I*距离顶部 20 个像素。
============================================
Today is a nice weather
I wanted to go *I*for a walk.
But finaly got caught in a rain.
============================================
现在,如果我向下移动光标。
============================================
I wanted to go for a walk.
But finaly got *I*caught in a rain.
Damn it.
============================================
并不是说我不能简单地计算行数,因为我有嵌入的表格并且字体大小也不同。