Results 1 to 11 of 11

Thread: Touch not working on qt application using waveshare screen

  1. #1
    Join Date
    Jul 2015
    Location
    Ahmedabad, India
    Posts
    12
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Touch not working on qt application using waveshare screen

    I am having touch issue for Waveshare 10.1 LCD with raspbian - it unable to emit the onPushbuttonclicked signal, it recognize the touch event very well like touch begin, update and end. Anyone faced the same issue? here is the link for product http://www.waveshare.com/wiki/10.1inch_HDMI_LCD

    Also is there any way to Synthesize touch event to mouse event?

    Regards,

    Tushar Kachhadiya

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Touch not working on qt application using waveshare screen

    So when you debugged the QPA and it gets the touch events but doesn't synthesize the mouse events?

    Cheers,
    _

  3. #3
    Join Date
    Jul 2015
    Location
    Ahmedabad, India
    Posts
    12
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Touch not working on qt application using waveshare screen

    Yes, It was not synthesizing the mouse events with touch events. I am only getting touch events not any signal execution of QPushbutton. See this is the log which I got during touch on screen

    Mouse button pressed
    Touch Update
    Touch Update
    Touch Update
    Touch Update
    Touch Update
    Touch Update
    Touch Update
    Touch Update
    Touch Update
    Touch Update
    Touch Update
    Touch Update
    Touch End
    Mouse button release

    Do you know any method to synthesize mouse and touch events?

    Thanks

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Touch not working on qt application using waveshare screen

    You bet press and release, so how are you arriving at the idea that no mouse events get synthesized?
    They are right there, no?

    Cheers,
    _

  5. #5
    Join Date
    Jul 2015
    Location
    Ahmedabad, India
    Posts
    12
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Touch not working on qt application using waveshare screen

    Hi,

    I have slot which will be executed by pressing QPushbutton from screen. If I use mouse to press that button works but, not touch. Touch is only responding me the debug messages which I put in source code instead of button press slot work like mouse.

    Thanks

  6. #6
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Touch not working on qt application using waveshare screen

    Well, your debug code clearly indicates that mouse events are being synthesized, so I am not sure how you arrived at the conclusion they are not.

    Do the pressed() or released() signals of the button get emitted?

    Do the mouse events have the correct target and coordinates?

    Cheers,
    _

  7. #7
    Join Date
    Jul 2015
    Location
    Ahmedabad, India
    Posts
    12
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Touch not working on qt application using waveshare screen

    Hi,

    When I used mouse to press or click on QPushbutton that time it was emitted both clicked() and pressed() signals. Now, When I used touch for same operation that time both of this signal was not emitted.

    Yes, mouse events have the correct target and coordinates.

    Thanks

  8. #8
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Touch not working on qt application using waveshare screen

    Quote Originally Posted by kachhadiyatushar View Post
    Yes, mouse events have the correct target and coordinates.
    And it is the same target and range of coordinates when you use the mouse?

    I don't see how the mouse handling code in QPushButton could behave differently on where the events came from, i.e. whether they were synthesized or not.

    Cheers,
    _

  9. #9
    Join Date
    Jul 2015
    Location
    Ahmedabad, India
    Posts
    12
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Touch not working on qt application using waveshare screen

    Hi,

    Here is the code I have used to capture events.

    setAttribute(Qt::WA_AcceptTouchEvents,true);

    bool CMainWindow::event(QEvent *ev)
    {
    int t = ev->type();
    switch (t) {
    case QEvent::MouseButtonPress:
    qDebug()<<"Mouse button pressed";
    break;
    case QEvent::TouchBegin:
    qDebug()<<"Touch Begin";
    break;
    case QEvent::MouseButtonDblClick:
    qDebug()<<"Mouse button dbl click";
    break;
    case QEvent::MouseButtonRelease:
    qDebug()<<"Mouse button release";
    break;
    case QEvent::TouchUpdate:
    qDebug()<<"Touch Update";
    break;
    case QEvent::TouchCancel:
    qDebug()<<"Touch Cancel";
    break;
    case QEvent::TouchEnd:
    qDebug()<<"Touch End";
    break;
    }
    if(t == QEvent::TouchBegin)
    {
    ev->accept();
    return true;
    }
    else
    return QWidget::event(ev);
    }

    void CMainWindow:n_lbl_i_clicked()
    {
    qDebug()<<"Click Signal Emitted";
    }

    void CMainWindow:n_lbl_i_pressed()
    {
    qDebug()<<"Press Signal Emitted";
    }

    Debug Logs of app when I press or click on button using mouse :-

    Press Signal Emitted
    Click Signal Emitted

    Debug Logs of app when I press or click on button using touch :-

    Touch Begin
    Touch Update
    Mouse button pressed
    Touch Update
    Touch Update
    Touch Update
    Touch Update
    Touch End
    Mouse button release

    Also, I am getting mouse cursor on my application screen and it moves smooth everywhere and emits the click() and press() signal, If I click or press QPushbutton. The same aren't working using touch.

    Thanks
    Last edited by kachhadiyatushar; 25th October 2016 at 12:18.

  10. #10
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Touch not working on qt application using waveshare screen

    A few observations/questions:

    * why are you intercepting the TouchBegin event?
    * how did you determine that target and coordinates of the mouse events where OK?
    * have you checked which events are actually delivered to the button?

    Cheers,

  11. #11
    Join Date
    Oct 2016
    Posts
    8
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Windows Android

    Default Re: Touch not working on qt application using waveshare screen

    I have slot which will be executed by pressing QPushbutton from screen. If I use mouse to press that button works but, not touch. Touch is only responding me the debug messages which I put in source code instead of button press slot work like mouse.

Similar Threads

  1. Touch screen wrong coordinates on touch
    By Talei in forum Qt Programming
    Replies: 0
    Last Post: 1st January 2014, 23:35
  2. QT interfacing with touch screen!!!
    By sanujas in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 5th April 2013, 12:03
  3. Qt Touch Screen Support
    By keyurapatel21 in forum Qt for Embedded and Mobile
    Replies: 2
    Last Post: 19th October 2011, 19:31
  4. Touch Screen on Windows 7
    By briankibler in forum Qt Programming
    Replies: 2
    Last Post: 2nd March 2011, 15:15
  5. Touch screen
    By rchaitanya in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 19th January 2009, 14:40

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.