Results 1 to 7 of 7

Thread: QLineEdit and keyPressEvent(QKeyEvent *)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2007
    Posts
    31
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: QLineEdit and keyPressEvent(QKeyEvent *)

    Designer uses QListViewItem. I switched to KListView because there is no hope to find out what's wrong with QLineEdit. Something is filtering Ctrl+A before sequence reaches recently installed event handler. Some magic behind ;[

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QLineEdit and keyPressEvent(QKeyEvent *)

    QObject::event() probably

    And Ctrl+A is probably a shortcut to "Select all", so you might need to disable the shortcut.

  3. #3
    Join Date
    Mar 2007
    Posts
    31
    Thanks
    2
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: QLineEdit and keyPressEvent(QKeyEvent *)

    But how disable shortcut?

    event() - no.

    I think event is first passed through event filter chain, then to event() and finally to specific event function:

    event
    |
    event filter (n) -> event filter (n - 1) -> ... -> event filter (0) -> event() -> keyPressEvent(), where event filter (n) is latest installed event filter

    I cannot catch this sequence at event filter (n) level so it's obvious I won't catch it at event() level.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QLineEdit and keyPressEvent(QKeyEvent *)

    Quote Originally Posted by fear View Post
    But how disable shortcut?
    Hard to say without looking at the code. I'd say it's an action associated with the context menu of the widget.

    I cannot catch this sequence at event filter (n)
    What did you filter it with?

Similar Threads

  1. Pointer Question related to QLineEdit
    By ChrisReath in forum Qt Programming
    Replies: 1
    Last Post: 23rd May 2008, 15:13
  2. how to get last character of QLineEdit
    By yagabey in forum Qt Programming
    Replies: 1
    Last Post: 5th January 2008, 16:38
  3. QLineEdit and focusInEvent
    By fuzzywuzzy01 in forum Qt Programming
    Replies: 5
    Last Post: 16th August 2007, 23:05
  4. QValidator, regular expressions and QLineEdit
    By hvengel in forum Qt Programming
    Replies: 1
    Last Post: 8th August 2007, 01:25
  5. 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.