Results 1 to 2 of 2

Thread: QKeyEvent::ascii alternative in QT4

  1. #1
    Join Date
    Nov 2008
    Posts
    8
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QKeyEvent::ascii alternative in QT4

    Hi,

    In Qt3, we were using QKeyEvent::ascii() to get the ascii character of
    the key pressed, so when we press "a", we get 0x61 and when we press
    "A", we get 0x41
    IIn Qt4, tried using QKeyEvent::text()->toAscii()->toInt() but all I am
    getting is 0
    Can anyone point me as to what I should be using to get the ascii value
    of the key pressed?

    Regards
    Prasanta

  2. #2
    Join Date
    Jan 2006
    Location
    Knivsta, Sweden
    Posts
    153
    Thanks
    30
    Thanked 13 Times in 12 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11

    Default Re: QKeyEvent::ascii alternative in QT4

    QKeyEvent::text()->toAscii()[0]
    Last edited by drhex; 3rd December 2008 at 12:37.

Similar Threads

  1. alternative to qtextedit
    By Rooster in forum Newbie
    Replies: 4
    Last Post: 7th August 2008, 02:36
  2. opengl alternative to setMask() ?
    By JeanC in forum Qt Programming
    Replies: 0
    Last Post: 3rd June 2008, 15:01
  3. alternative to QMessageBox
    By incapacitant in forum Newbie
    Replies: 20
    Last Post: 24th May 2006, 14:49
  4. alternative to COM??
    By TheKedge in forum Qt Programming
    Replies: 2
    Last Post: 20th January 2006, 15:02

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.