QListView.indexAt in PyQt5 returning wrong index?
问题 I'm trying to pop up a context menu when a user right-clicks on an item in a QListView and a different context menu if the user right-clicks outside of any of the items (any of the whitespace). What I'm finding is that the index I'm receiving when performing the indexAt command is not accurate, and I can't figure out why. I initialize the QListView as its own class: class RBKDataTypesTab(QWidget): def __init__(self): super().__init__() self.models = [] grid = QGridLayout() self.list =