[Interest] QTextEdit: custom cursor

Tim Schmidt tim.qt at outlook.com
Sun Aug 8 14:10:08 CEST 2021


Hello,

My name is Tim, and I am new to the Qt community.

A few months ago, I started to implement a text editor as a private project.
So, I am working with a QTextEdit.
At the moment, I am adjusting the space between words and individual characters.
This should help to increase the readability of the text.
Please find attached a minimal executable python example and a screenshot as well.

I made some observations regarding the cursor.

a) The cursor overlaps with the character.
Is it possible to have the cursor with a margin to the left side?
It would be great to place the cursor at the 'font letter spacing' space.
My goal is to move the cursor between two letters, and it doesn't overlap any letter.

b) I can adjust the width of the cursor.
Is there a chance to adjust the height and the color as well?

Maybe somebody can help me out. I am thankful for any pointer.
I don't know if there are low-level functions that I can overwrite :)

Best regards,

Tim :)



[cid:c23075cc-eb1a-4722-a0c6-2931d23b8026 at EURP193.PROD.OUTLOOK.COM]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210808/b9064bdf/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Untitled1.png
Type: image/png
Size: 84579 bytes
Desc: Untitled1.png
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210808/b9064bdf/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: custom_cursor.py
Type: text/x-python-script
Size: 787 bytes
Desc: custom_cursor.py
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20210808/b9064bdf/attachment-0001.bin>


More information about the Interest mailing list