Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for MCUs
  4. Not able to detect touch events as "TouchBegin" QEvent when Popup object is open.

Not able to detect touch events as "TouchBegin" QEvent when Popup object is open.

Scheduled Pinned Locked Moved Unsolved Qt for MCUs
popup qmleventfilterqeventqmlc++embedded qt
1 Posts 1 Posters 346 Views
  • 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.
  • P Offline
    P Offline
    Pavankumar S V
    wrote on 5 Apr 2023, 11:08 last edited by Pavankumar S V 4 May 2023, 11:41
    #1

    Hello,
    I have implemented a code to detect X and Y co-ordinates of the touch points.
    In the implementation, I have used eventFilter() to detect the touch events like this:

    bool IpcSocket::eventFilter(QObject *,QEvent *event)
    {
    	qDebug()<<" EVENT TYPE :"<<event->type();
    
    	if(event->type() == QEvent::TouchBegin)
    	{
    		QList<QTouchEvent::TouchPoint> touchBeginPoints = static_cast<QTouchEvent *>(event)->touchPoints();
    		foreach (const QTouchEvent::TouchPoint &touchBeginPoint, touchBeginPoints)
    		{
    			unsigned int touchX = touchBeginPoint.pos().x();
    			unsigned int touchY = touchBeginPoint.pos().y();
    			qDebug() << "X :=" << touchX << ", Y :=" << touchY;
    		}
    	}
    	return false;
    }
    

    In most cases, whenever the screen is touched, the above eventFilter() function is called with the touch events detected as "TouchBegin" QEvent.
    But if a popup is opened and if there is a single touch anywhere on the screen, then the above function is called with the touch event detected as a series of "UpdateRequest" QEvents.
    But I want to get the X and Y touch co-ordinates even with the pop up opened. Please help me with the below queries:

    1. I want to know why the touch event is not detected as "TouchBegin" QEvent if pop up is opened.
    2. Also I wanted to know how to detect the touch events as "TouchBegin" QEvent when popup is opened.
    1 Reply Last reply
    0

    1/1

    5 Apr 2023, 11:08

    • Login

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