Results 1 to 6 of 6

Thread: Touchscreen doble click problem

  1. #1
    Join Date
    Mar 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Touchscreen doble click problem

    I am developing a graphic interface in a touch screen with QtCreator.

    I have implemented a graphic keyboard to add characters to certein text filds, where every key is a QPushButton class.

    The problem is when I press some key, the button event function [click( )] is called twice. What event could I used to add a single letter when I push a single key?

    Thanks.

  2. #2
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Touchscreen doble click problem

    Quote Originally Posted by pablo7 View Post
    What event could I used to add a single letter when I push a single key?
    You have to use QKeyEvent.

  3. #3
    Join Date
    Mar 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Touchscreen doble click problem

    Thank yogeshgokul, but I think QKeyEvent is used when I utilize real keyboard, but in my case I'm using virtual keyboard in a touchscreen like this image.
    I don't know what event or function I have to use to call my function of QPushButton once instead of twice.

    Thanks
    Attached Images Attached Images

  4. #4
    Join Date
    Aug 2008
    Posts
    60
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Touchscreen doble click problem

    Hi pablo7,
    You can try to catch the QTouchEvent and then filter required events.
    Thanks.

  5. #5
    Join Date
    Dec 2007
    Posts
    628
    Thanks
    3
    Thanked 89 Times in 87 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Touchscreen doble click problem

    Quote Originally Posted by pablo7 View Post
    I think QKeyEvent is used when I utilize real keyboard, but in my case I'm using virtual keyboard
    QKeyEvent is your solution.

    Quote Originally Posted by pablo7 View Post
    I don't know what event or function I have to use to call my function of QPushButton once instead of twice.
    When you press a mouse left button on any part of this image. Say you clicked on "A". So, in mouse click event you have to do like this.

    Qt Code:
    1. QKeyEvent keyEvent(QEvent::KeyPress, Qt::Key_A, Qt::NoModifier);
    2. QApplication::sendEvent(parent->focusWidget(), &event);
    To copy to clipboard, switch view to plain text mode 

    Using this approach, I also created a virtual keyboard. But I was using QToolButtons instead of an Image. Please see the attached screen shot.
    Attached Images Attached Images

  6. #6
    Join Date
    Mar 2009
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Touchscreen doble click problem

    Thanks yogeshgokul. It looks a good idea, I will try it.

Similar Threads

  1. Weird problem: multithread QT app kills my linux
    By Ishark in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2008, 09:12
  2. Problem with QT embedded and touchscreen calibration.
    By webquinty in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 2nd July 2008, 11:33
  3. QTreeWidget double click - expand problem
    By stefan in forum Newbie
    Replies: 2
    Last Post: 29th June 2008, 13:24
  4. Table header section click problem
    By Khal Drogo in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2008, 22:31

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.