Counting the QListWidget Items by a QLineEdit each Drag&Drop event.
Hello Qt devs, I'm pretty new to qt and I would like to ask for a simple problem:
_ I have a MainWindow with:
+ An initial widget for storing initial items.
+ 10 list widgets for storing dropped items.
+ A line edit inside a for showing a "count" variable which count how many items in there.
What I want to do is after dropping a item in these 10 widgets, the "count" number plus one, and dragging an item outside the list widgets the "count" minus one. I tried eventFilter but after installingEventFilter to a widget, the dropped item dissappears. I have stuck at this for many hours so hopefully someone could give me a solution.
Re: Counting the QListWidget Items by a QLineEdit each Drag&Drop event.
You don't need any event filter for that.
Each list widget has a model for its data and each model has signals for when it adds or removes items.
Simply connect to these and update the count.
Cheers,
_
Re: Counting the QListWidget Items by a QLineEdit each Drag&Drop event.
Can you tell me what is this Signal, is this viewportEntered or Entered. Thanks for your reply.
Re: Counting the QListWidget Items by a QLineEdit each Drag&Drop event.