我正在创建一个文本编辑器,现在我想要将qtextcursor移动到行的开头,但是文本光标只会从单词的开始处移动而不是行的实际开始,如果有的话在下一个区块中没有任何字,光标不会移动到那里。无论如何都在那里
cursor.movePosition(16)
self.textEdit.setTextCursor(cursor)
#but this will only work if there is atleast one word in the next block
cursor.setPosition(0)
#this will move the cursor to the word from where the document starts not the actual start of the document
cursor.movePosition(3)
#this will do the same
我在我的文本编辑器中创建列表功能(我使用内置的光标创建列表)但我需要修改一点,为此我必须完全控制光标。我也尝试使用选项卡和退格键spantounasly但导致问题
查看图像。光标位于蓝色位置。但我希望它位于黑色位置,但目前只有在黑色位置有文字时才可以使用