Results 1 to 9 of 9

Thread: key Press which key

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    201
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows
    Thanks
    22

    Default Re: key Press which key

    any body can help me for thiss???

  2. #2
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: key Press which key

    install event filter on your line edit and process QKeyEvent.
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  3. #3
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: key Press which key

    or subclass QLineEdit and then:
    Qt Code:
    1. void YourLineEdit::keyPressEvent(QKeyEvent *e)
    2. {
    3. if (Qt::Key_Plus == e->key())
    4. qDebug("+ was pressed I ignore that")
    5. else
    6. QLineEdit::keyPressEvent(e);
    7. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. how to Simulate the keyboard press
    By duduqq in forum Qt Programming
    Replies: 3
    Last Post: 9th August 2008, 16:50
  2. Replies: 2
    Last Post: 2nd April 2008, 14:19
  3. Replies: 1
    Last Post: 24th October 2007, 18:34
  4. Replies: 7
    Last Post: 14th October 2007, 22:04
  5. QTextEdit and "Enter" press
    By krivenok in forum Qt Programming
    Replies: 2
    Last Post: 28th March 2006, 12:10

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.