I've successfully added elements using
list.push(element)
But how do I remove them? I've tried the following, but none of them seem to work.
list.pop()
list.pop_front()
list.remove()
list.remove(int)
list.remove(element)
For people who always keep ending up on this page, like I did: I found a very hacky solution to remove an element from a list<QtObject>
.
myList = Array.from(myList).filter(r => r !== elementIWant2Remove)
This is not very elegant, but it does the trick, if you need to remove an element.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With