Results 1 to 5 of 5

Thread: what event should I implement in order to catch QKeySequence::Delete

  1. #1
    Join Date
    Oct 2007
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question what event should I implement in order to catch QKeySequence::Delete

    I went through all posts here and tried couple of suggestions, and it works on Windows, but it does not work on Mac. The way I understood from documentation, QKeySequence:elete key represents different bindings depends on OS. Then why it works only on Windows. Please, help me to solve this mystery .

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

    Default Re: what event should I implement in order to catch QKeySequence::Delete

    Hard to say without seeing the code, but you probably want to catch Qt::Key_Delete and not QKeySequence::Delete.

  3. #3
    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: what event should I implement in order to catch QKeySequence::Delete

    See QKeyEvent::matches() or use QShortcut instead of catching events.
    J-P Nurmi

  4. #4
    Join Date
    Oct 2007
    Posts
    16
    Thanks
    3
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: what event should I implement in order to catch QKeySequence::Delete

    i like you suggestion about QShortcut. I'll try. Thanks a lot.

  5. #5
    Join Date
    Mar 2009
    Posts
    9
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Windows

    Default Re: what event should I implement in order to catch QKeySequence::Delete

    First of all look up into ur code if you are any how capturing Delete key. Check if you have used :

    setShortcut(tr("Delete"));

    any where in your code.

    As this will capture Delete key on application level prevent the KeyPressEvent to capture Qt::Key_Delete. I have also faced the similar problem. The moment i commented this piece of line KeyPressEvent captured the Qt::Key_Delete. Thiswas the only possible way we were not able to capture key Qt::Key_Delete with keypressevent.

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.