Results 1 to 3 of 3

Thread: Twice QWidget::event TouchBegin instead one

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2011
    Posts
    8
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Twice QWidget::event TouchBegin instead one

    I wrote an application for raspberry with qt 5.3, raspbian jessie and a 7-inch touch screen.
    In my application I need to override the QWidget::event method. And everything was worked ok.
    My problems start when I ported my code to raspbian stretch with the qt 5.7.1.
    Now my code doesn't work because the QEvent::TouchBegin event is sent twice time.
    Do you have any suggestions?

    Code
    Qt Code:
    1. bool Zone::event(QEvent *e)
    2. {
    3. if (e->type() == QEvent::TouchBegin) {
    4. qDebug("TouchBegin");
    5. .........
    6. return true;
    7. }
    8.  
    9. if (e->type() == QEvent::TouchEnd) {
    10. qDebug("TouchEnd");
    11. .....
    12. return true;
    13. }
    14.  
    15. if (e->type() == QEvent::MouseButtonPress) {
    16. qDebug("MouseButtonPress");
    17. .....
    18. return true;
    19. }
    20.  
    21. if (e->type() == QEvent::MouseButtonRelease) {
    22. qDebug("MouseButtonRelease");
    23. .......
    24. return true;
    25. }
    26. return QWidget::event(e);
    27. }
    To copy to clipboard, switch view to plain text mode 

    Output
    TouchBegin
    TouchBegin
    MouseButtonPresseds
    TouchEnd
    MouseButtonReleased
    Last edited by anda_skoa; 12th April 2019 at 10:31. Reason: missing [code] tags

Similar Threads

  1. QTouchEvent : No TouchBegin if I don't Move or Up
    By Rajesh.Rathod in forum Qt Programming
    Replies: 0
    Last Post: 16th September 2015, 13:40
  2. Close Event in for a qwidget
    By ehnuh in forum Qt Programming
    Replies: 0
    Last Post: 30th October 2012, 05:31
  3. Replies: 0
    Last Post: 23rd November 2010, 20:54
  4. QWidget Shown Event
    By perq in forum Qt Programming
    Replies: 1
    Last Post: 13th September 2010, 15:20
  5. QWidget post event
    By bunjee in forum Qt Programming
    Replies: 1
    Last Post: 14th November 2008, 18:07

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.