Results 1 to 8 of 8

Thread: How to cancel pending signals?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Join Date
    Dec 2009
    Posts
    49
    Thanks
    3
    Thanked 2 Times in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to cancel pending signals?

    Thanks for your answer anda_skoa, but I'm not sure I fully understand.

    Right now, I create a context menu (QMenu) with the QTreeWidget as parent, then add an action to that menu that will delete the selected item(s):

    Qt Code:
    1. QMenu* menu = new QMenu(treeWidget());
    2. ...
    3. menu->addAction("Delete", this, SLOT(slot_delete()), QKeySequence(Qt::Key_Delete));
    4. ...
    5. menu->exec(treeWidget()->mapToGlobal(point));
    To copy to clipboard, switch view to plain text mode 
    And here is a slot_delete():

    Qt Code:
    1. void MyItem::slot_delete()
    2. {
    3. // Do a bunch of stuff here, might take some time.
    4.  
    5. delete this;
    6. }
    To copy to clipboard, switch view to plain text mode 
    How would I change this?

    I'm not sure how first hiding or taking out the item in slot_delete() would fix the problem.
    Last edited by dictoon; 8th October 2015 at 16:42.

Similar Threads

  1. Replies: 6
    Last Post: 18th January 2012, 20:21
  2. Replies: 5
    Last Post: 16th September 2010, 19:45
  3. Pending network replies won't let program to quit
    By novichkov in forum Qt Programming
    Replies: 0
    Last Post: 4th August 2010, 19:28
  4. Cancelling a pending database insert
    By innerhippy in forum Qt Programming
    Replies: 3
    Last Post: 30th October 2008, 08:53
  5. closing file objects of pending requests in QHttp
    By nisha0609 in forum Qt Programming
    Replies: 1
    Last Post: 18th January 2007, 10:52

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.