PDA

View Full Version : Selecting next line with mouseclick



Jake123
1st February 2013, 22:58
Hello,

I have a QTextEdit in which I want to be able to select a specific line upon a mouseclick.

Basically, i want to be able to get the functionality of the return key (or "enter") with a single mouse click on that line.

I really have no idea how I would go about this and need a hand!

Any help would be appreciated! Thanks

lanz
4th February 2013, 06:21
You can subclass QTextEdit and overload mousePressEvent or mouseReleaseEvent, then get cursor position by textCursor () call.
Also take a look at the line highligting here http://doc.qt.digia.com/qt/widgets-codeeditor.html