Results 1 to 15 of 15

Thread: Posting a QKeyEvent to a QLineEdit

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Posting a QKeyEvent to a QLineEdit

    QLineEdit uses QKeyEvent::text() for inserting text.
    Qt Code:
    1. QApplication::postEvent(_line_edit,
    2. new QKeyEvent(QEvent::KeyPress,
    3. Qt::Key_A,
    4. Qt::NoModifier,
    5. "a")); // <-QKeyEvent::text
    To copy to clipboard, switch view to plain text mode 
    J-P Nurmi

  2. The following user says thank you to jpn for this useful post:

    cocheci (31st May 2006)

Similar Threads

  1. a box around QLineEdit?
    By GreyGeek in forum Qt Tools
    Replies: 13
    Last Post: 8th February 2006, 15: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
  •  
Qt is a trademark of The Qt Company.