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?
Asked
Active
Viewed 3,324 times
3 Answers
4
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);
-
That's not what he was asking for, but that's what I was searching for, thanks. Didn't found anywhere else the answer. Can I make the QTextEdit not clickable by the Mouse Cursor? – Lilian A. Moraru Jan 11 '12 at 14:29
-
I don't know of a property to do this, but the standard QT approach seems to be override the class, and either 'cancel' the event or fail to pass on the virtual method call to the base class. – Benny G Jan 17 '12 at 03:15
1
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.

TonyK
- 16,761
- 4
- 37
- 72