I'm working on a small plugin for QGIS 3.12+ and regardless of what i try i'm unable to perform the simple task of retrieving the number of items in a QList that's returned by QListWidget.selectedItems()
I'm not well versed in python, but have read through the docs and tried each of the below with all of them failing.
What am i missing?
#Returns items as i can loop though them with: for item in selected:
selected = self.dlg.qListWidgetLayers.selectedItems()
#TypeError: count() takes exactly one argument (0 given)
#Docs claim there's a count that doesn't need the parameter...
intTotal = selected.count()
#AttributeError: 'list' object has no attribute 'size'
intTotal = selected.size()
#AttributeError: 'list' object has no attribute 'length'
intTotal = selected.length()
#AttributeError: 'list' object has no attribute 'len'
intTotal = selected.len() #<- This attempt is incorrect, should actually be len(selected)