Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to draw custom text cursor in QTextEdit?
Forum Updated to NodeBB v4.3 + New Features

How to draw custom text cursor in QTextEdit?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 0 Posters 1.7k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? This user is from outside of this forum
    ? This user is from outside of this forum
    Guest
    wrote on last edited by
    #1

    I would like to change the text cursor's shape (not the mouse cursor) in QTextEdit and using the setCursorWidth(int width) method with 8 or 10 (so the shape becomes block) is just fine. But the problem is that the cursor hides the current character. Is it possible to draw my own text cursor and make the text cursor transparent when it is over a character? This is the same behaviour as the Fake Vim Mode's text cursor in Qt Creator or Terminal's cursor.

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved