Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Twice QWidget::TouchBegin event
Forum Updated to NodeBB v4.3 + New Features

Twice QWidget::TouchBegin event

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
1 Posts 1 Posters 242 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gianc
    wrote on last edited by
    #1

    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
    bool Zone::event(QEvent *e)
    {
    if (e->type() == QEvent::TouchBegin) {
    qDebug("TouchBegin");
    .........
    return true;
    }

    if (e->type() == QEvent::TouchEnd) {
    	qDebug("TouchEnd");
    	.....
    	return true;
    }
    
    if (e->type() == QEvent::MouseButtonPress) {
    	qDebug("MouseButtonPress");
    	.....
    	return true;
    }
    
    if (e->type() == QEvent::MouseButtonRelease) {
    	qDebug("MouseButtonRelease");
    	.......
    	return true;
    }
    return QWidget::event(e);
    

    }

    Output
    TouchBegin
    TouchBegin
    MouseButtonPresseds
    TouchEnd
    MouseButtonReleased

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved