Results 1 to 2 of 2

Thread: which key press last this will be display on screen

  1. #1
    Join Date
    Dec 2011
    Posts
    13
    Qt products
    Qt3 Qt4 Qt/Embedded Qt Jambi PyQt3 PyQt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Question which key press last this will be display on screen

    Hi all,

    we use key press and key release ...
    we change color through stylesheet both the key press and key release...
    we use two keys Q and W for that...
    but problem is that when I press the "Q" and "W"together but one after another I want to see effect which is last key is press but I see on the screen both the key is press...
    so How can I do this ???

    Kinjal Dhagat

  2. #2
    Join Date
    Sep 2011
    Location
    Manchester
    Posts
    538
    Thanks
    3
    Thanked 106 Times in 103 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: which key press last this will be display on screen

    Qt Code:
    1. myClass::keyPressEvent( QKeyEvent* event )
    2. {
    3. if( event->isAutoRepear() ) // if it's not initial key press - do nothing
    4. {
    5. return;
    6. }
    7.  
    8. // do your magic here
    9. }
    10.  
    11. myClass::keyReleaseEvent( QKeyEvent* event )
    12. {
    13. if( event->isAutoRepear() ) // if it's not initial key press - do nothing
    14. {
    15. return;
    16. }
    17.  
    18. // do your magic here
    19. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. OSD (On Screen Display) application on Qt Embedded
    By sundar.subramaniyan in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 17th July 2011, 17:32
  2. Display continous images on the screen
    By tuent in forum Newbie
    Replies: 11
    Last Post: 29th December 2010, 10:46
  3. How to Keep Splash Screen and App on Same Display
    By ajb_advance in forum Qt Programming
    Replies: 2
    Last Post: 4th March 2009, 11:49
  4. Display a QWidget using multi-screen
    By tarod in forum Qt Programming
    Replies: 3
    Last Post: 30th June 2008, 14:02
  5. how to display a window full screen??
    By Seema Rao in forum Qt Programming
    Replies: 1
    Last Post: 8th May 2006, 12: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
  •  
Qt is a trademark of The Qt Company.