[英]Why does the length of the cursor change when I input in QPlainTextEdit?
The length of the cursor changes when I input a word, and the length becomes the same as the word. 当我输入单词时,光标的长度发生变化,并且长度与单词相同。 How can I set QPlainTextEdit?
如何设置QPlainTextEdit?
self.setFont(QFont("Consolas", 10, QFont.Normal))
I set the css font family "Consolas", and when I input English words, there is no problem. 我将css字体系列设置为“ Consolas”,当我输入英语单词时,没有问题。 (I highlight the line number because when I get a screenshot the cursor disappear)
(我突出显示行号,因为当我获得屏幕截图时,光标消失了)
But when I input Chinese word (this word is higher than English word), the problem comes. 但是当我输入中文单词(这个单词比英文单词高)时,问题就来了。
As you can see, the chinese word sinks (the height of the line became higher and the line sink): it is strange. 如您所见,中文单词下沉(行的高度变高,行下沉):这很奇怪。
The effect of above picture in Sublime Text is what I want. 我想要的是Sublime Text中上述图片的效果。
I think there is no problem with QPlainTextEdit
. 我认为
QPlainTextEdit
没有问题。 You are seeing this problem because you are comparing Chinese letters with lower-case English letters: 您正在看到此问题,因为您正在将中文字母与小写英文字母进行比较:
Have a look: 看一看:
中国asdsd
These English letters look small as compared to Chinese ones, but: 与中文字母相比,这些英文字母看上去很小,但:
国中ASDFASD
In this case they look same sized. 在这种情况下,它们看起来大小相同。 Try it in your
QPlainTextEdit
, I tried it, everything is okay :) 在您的
QPlainTextEdit
尝试一下,我尝试了,一切都很好:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.