Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6885751
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T05:40:25+00:00 2026-05-27T05:40:25+00:00

I need to process some data AFTER a drop event has occured on a

  • 0

I need to process some data AFTER a drop event has occured on a widget.

i.e a user selects some items in list A and drops them in list B. My program needs to compare the 2 lists after B has added the items selected from A.

Any ideas?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T05:40:26+00:00Added an answer on May 27, 2026 at 5:40 am

    Here’s a PyQt script that demonstrates two ways to trap drop events:

    from PyQt4 import QtGui, QtCore
    
    class Window(QtGui.QMainWindow):
        def __init__(self):
            QtGui.QMainWindow.__init__(self)
            widget = QtGui.QWidget(self)
            self.setCentralWidget(widget)
            layout = QtGui.QVBoxLayout(widget)
            self.listA = ListWidget(self)
            self.listB = QtGui.QListWidget(self)
            self.listB.viewport().installEventFilter(self)
            for widget in (self.listA, self.listB):
                widget.setAcceptDrops(True)
                widget.setDragEnabled(True)
                for item in 'One Two Three Four Five Six'.split():
                    widget.addItem(item)
                layout.addWidget(widget)
    
        def eventFilter(self, source, event):
            if (event.type() == QtCore.QEvent.Drop and
                source is self.listB.viewport()):
                self.listB.dropEvent(event)
                if event.isAccepted():
                    print 'eventFilter', self.listB.count()
                return True
            return QtGui.QMainWindow.eventFilter(self, source, event)
    
    class ListWidget(QtGui.QListWidget):
        def __init__(self, parent):
            QtGui.QListWidget.__init__(self, parent)
    
        def dropEvent(self, event):
            QtGui.QListWidget.dropEvent(self, event)
            if event.isAccepted():
                print 'dropEvent', self.count()
    
    if __name__ == '__main__':
    
        import sys
        app = QtGui.QApplication(sys.argv)
        window = Window()
        window.show()
        sys.exit(app.exec_())
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm a beginner to php. i need to use php function which process some
I need to do some process injection using C++ but I would prefer to
I need execute some code before Windows shutdown process each time. So, I want
We need to identify and then process switch/case statements in code based on some
I need to add some lightweight syntactic sugar to JavaScript source code, and process
I need to process the incoming predefined ASN format data(coming from verity of clients
I need to write some data in a temporary file and to store this
here is the controller to login form, after the login process the user will
It's a very common scenario: some process wants to drop a file on a
I have an application where i need to write some data to the serial

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.