Results 1 to 3 of 3

Thread: Re-implement mouse events of QTextEdit

  1. #1
    Join Date
    Oct 2006
    Location
    Bangalore
    Posts
    32
    Qt products
    Qt4
    Platforms
    Windows

    Question Re-implement mouse events of QTextEdit

    Hi, i am working on plain text editor using QTextEdit. I have subclassed QTextEdit.

    MyEditor : public QTextEdit

    I want to re-implement keypressevent and mouse events (move/clicked/released et cetera)

    Re-implementing keypressevent has no issues. But when i reimplement mousemoveevent for example, i expect the cotrol to come to my re-implemented mousemove event function in MyEditor . This is not happening.

    I installed event filter on MyEditor and then caught mouse event in eventhandler and calling my slot say processMovemoveEvent( me ). This works.

    I wonder if re-implementing mouse events for QTextEdit does not allowed?

    Some light please .........

  2. #2
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: Re-implement mouse events of QTextEdit

    Please post the code where you try to install the event handler.

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Re-implement mouse events of QTextEdit

    Quote Originally Posted by Ankitha Varsha View Post
    But when i reimplement mousemoveevent for example, i expect the cotrol to come to my re-implemented mousemove event function in MyEditor . This is not happening.
    You have to enable mouse tracking with QWidget::setMouseTracking().

Similar Threads

  1. mouse moving don't produce mouse events
    By coralbird in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2006, 07:13
  2. Replies: 2
    Last Post: 24th July 2006, 19:36
  3. QStackerWidget and mouse events
    By high_flyer in forum Qt Programming
    Replies: 3
    Last Post: 25th April 2006, 20:25
  4. Forwarding mouse events to another widget.
    By yogeshm02 in forum Qt Programming
    Replies: 8
    Last Post: 28th February 2006, 14:25
  5. QPushButton mouse events
    By Twey in forum Newbie
    Replies: 5
    Last Post: 15th January 2006, 17:41

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.