Results 1 to 11 of 11

Thread: QTextEdit eventfilter MouseButtonDblClick

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Qt products
    Qt5
    Platforms
    Windows Android
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Default Re: QTextEdit eventfilter MouseButtonDblClick

    Either works. Are you thinking perhaps the viewport's parent may change?
    I can see that obj == textEdit->viewport() has more certainty.
    Regardless, thanks again for the help.
    Last edited by Henry Blue Heeler; 10th April 2015 at 00:10. Reason: Solved

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QTextEdit eventfilter MouseButtonDblClick

    Quote Originally Posted by Henry Blue Heeler View Post
    Either works. Are you thinking perhaps the viewport's parent may change?
    I am thinking that you are testing against the object you really want to test against instead of testing a relation which may be true for more than one object. If you are expecting "4", test against "4" and not "an even number".
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Qt products
    Qt5
    Platforms
    Windows Android
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Default Re: QTextEdit eventfilter MouseButtonDblClick

    Yes, the object (viewport) could have multiple parents (unlikely in this scenario), but I get the nuance. Better practice, per se. Thx.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,373
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QTextEdit eventfilter MouseButtonDblClick

    Quote Originally Posted by Henry Blue Heeler View Post
    Yes, the object (viewport) could have multiple parents
    No. The text edit may have (and indeed has) multiple children.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Dec 2013
    Location
    Colorado
    Posts
    45
    Qt products
    Qt5
    Platforms
    Windows Android
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Default Re: QTextEdit eventfilter MouseButtonDblClick

    Quote Originally Posted by wysota View Post
    No. The text edit may have (and indeed has) multiple children.
    Good point! Thx.

Similar Threads

  1. Replies: 12
    Last Post: 16th February 2014, 15:28
  2. EventFilter problem
    By aruval3 in forum Qt Programming
    Replies: 10
    Last Post: 17th November 2011, 22:22
  3. Autorepeat within eventfilter
    By Patrick_Bao in forum Qt Programming
    Replies: 0
    Last Post: 1st December 2010, 08:37
  4. QTreeWidget and eventFilter
    By luoyes in forum Qt Programming
    Replies: 2
    Last Post: 5th November 2009, 07:38
  5. Replies: 2
    Last Post: 10th April 2009, 03:06

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.