In this article we will see how we can enable the accept of drops in spin box, we know we can make drag enabled using
setDragEnabled method with line edit object of spin box, but what is the use of dragging the text we can’t drop it anywhere. Allowing accept drop means that spin box has a property now to accept the drop text.
In order to do this we use
setAcceptDrops method with the spin box.
Syntax : line_edit.setAcceptDrops(True)
Argument : It takes bool as argument
Return: It returns None
Note : This method only make the accept drop property true in order to accept and display the text we have to add
dropEvent to spin box object.
Below is the implementation
Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.
To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course.