Reputation: 8019
I am trying to mimic a command-line client. I wish to set the cursor shape to '>', to show messages to user. I don't see that shape in the options provided by QCursor. Is there a way to set custom shapes to widget cursors?
Upvotes: 2
Views: 3700
Reputation: 371
You need to set the QTextEdit's viewport's cursor: http://doc.qt.nokia.com/stable/qtextedit.html
"The shape of the mouse cursor on a QTextEdit is Qt::IBeamCursor by default. It can be changed through the viewport()'s cursor property."
e.g. To hide the cursor completely:
ui.textEdit->viewport()->setCursor(Qt::BlankCursor);
Upvotes: 5
Reputation: 17114
You may think you want to do this, but you really don't. What will it gain you to change the mouse cursor to '>'? It will certainly confuse the user.
Upvotes: 1
Reputation: 2795
are you talking about mouse's shape
or about the text caret
Check QTextLayout::drawCursor
Upvotes: 2