Results 1 to 4 of 4

Thread: keypress while editing an item in QListWidget

Hybrid View

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

    Default Re: keypress while editing an item in QListWidget

    Subclass QItemDelegate and override createEditor() so that it always installs your event filter on the created editor widget:
    Qt Code:
    1. QWidget* MyItemDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
    2. {
    3. QWidget* editor = QItemDelegate::createEditor(parent, option, index);
    4. editor->installEventFilter(eventFilter);
    5. return editor;
    6. }
    To copy to clipboard, switch view to plain text mode 
    and use this item delegate for your list widget..
    J-P Nurmi

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

    Beluvius (4th April 2006)

  3. #2
    Join Date
    Mar 2006
    Posts
    14
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: keypress while editing an item in QListWidget

    Thanks, I got it now. I would have never thought of that one yet. Lots to learn...

Similar Threads

  1. Help on QListWidget InternalMove item signal
    By tho97 in forum Qt Programming
    Replies: 3
    Last Post: 14th February 2009, 01:13
  2. QListWidget and selecting an item
    By invictus in forum Newbie
    Replies: 4
    Last Post: 19th June 2007, 11:59
  3. Replies: 1
    Last Post: 19th April 2007, 22:23
  4. QTreeWidget item editing: want column specificity
    By McKee in forum Qt Programming
    Replies: 12
    Last Post: 10th December 2006, 22:12
  5. extract item from QListWidget
    By impeteperry in forum Qt Programming
    Replies: 2
    Last Post: 13th May 2006, 19:41

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.