Results 1 to 2 of 2

Thread: TextEdit created by QAbstractItemDelegate can't receive Escape key event?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2011
    Posts
    12
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default TextEdit created by QAbstractItemDelegate can't receive Escape key event?

    Hi guys,

    I have a QTableView to display a bunch of data, which is stored in a QStyledItemDelegate. I also want to edit the data sometime, so I use a QAbstractItemDelegate to create an editor (of QTextEdit type) when I double click on the cell. However, I want to handle the key Press event myself, but I never catch Key_Escape pressing in the Text Edit editor (Other keys such as Enter and Ascii can be captured). I checked the code, and found that Escape is directly connected to QTableView's closeEditor() function, which is a virtual method and is automatically invoked. As far as I know, key press event is the bottom layer of event handling, but it is not true with such case.

    I do need to capture the Escape key press event so that I can handle it myself, can anyone tell me how to do this? Thanks!
    Last edited by quantity; 8th November 2011 at 09:32.

Similar Threads

  1. Replies: 2
    Last Post: 11th August 2011, 10:55
  2. QGraphicsItem can't receive mouse leave/enter event
    By wshn13 in forum Qt Programming
    Replies: 1
    Last Post: 22nd June 2011, 08:32
  3. Do the layout class can receive the mouse event?
    By tszzp in forum Qt Programming
    Replies: 3
    Last Post: 23rd December 2009, 08:07
  4. Replies: 6
    Last Post: 3rd September 2008, 14:27
  5. Catching escape event with QMdiSubWindow
    By y.shan in forum Qt Programming
    Replies: 0
    Last Post: 3rd September 2008, 13:02

Tags for this Thread

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.