Need To Translate One Line of Code in from C++ Qt to PyQt

67 Views Asked by At

What is the equivalent of this

QModelIndex index = ui->listView->currentIndex();

in Python, if my listView is self.listView

It's all I need to know, I spent hours trying to search for an answer for a question and I only found it in C++.

EDIT:

Basically, in PyQt, to access the index of QListView you need to use QModelIndex, so I'm confused as to how to apply the QModelIndex on the QListView.

1

There are 1 best solutions below

0
Michael On

index = self.listView.currentIndex()