Is there something like a "cursorForPosition" for QLineEdits?
Unsolved
General and Desktop
-
Hi everyone!
Is there something like a "cursorForPosition" for QLineEdits?
I want to implement a QLineEdit with functionality to detect where a mouse click occurred and respond accordingly. Do I need to use QTextEdits for this and make them look like QLineEdits?
Thanks a lot!
-
You cant (out of the box). When you use mousePressEvents, you know where the click happened. The rest is on you what to do with this information.
By default the cursor is going where you click, right?!
LineEdit is a pretty simple input field. If you need further functionality to work with larger texts, you should have a look atQTextEdit
orQPlainTextEdit
.