Results 1 to 2 of 2

Thread: Selecting next line with mouseclick

  1. #1
    Join Date
    Jan 2013
    Location
    England
    Posts
    13
    Thanks
    7
    Qt products
    Qt5
    Platforms
    Windows

    Unhappy Selecting next line with mouseclick

    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

  2. #2
    Join Date
    Dec 2012
    Posts
    90
    Thanks
    5
    Thanked 20 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Selecting next line with mouseclick

    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

Similar Threads

  1. Replies: 3
    Last Post: 13th October 2011, 11:53
  2. Getting sender for mouseclick with QwtPlot
    By lxman in forum Qt Programming
    Replies: 1
    Last Post: 23rd January 2011, 01:43
  3. Simulating mouseclick on a HbAction from qtestlib
    By LearningCurve in forum Qt Programming
    Replies: 1
    Last Post: 4th December 2009, 01:16
  4. how to get MouseClick Event in this case
    By yxmaomao in forum Qt Programming
    Replies: 3
    Last Post: 17th July 2008, 03:03
  5. select QGraphicsItems by mouseclick
    By Shawn in forum Qt Programming
    Replies: 20
    Last Post: 31st July 2007, 13:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.