What signal is emitted while `CurrentItem` is changed in a View?
-
I have a QListView that every time i click on an item it sets a QLable text the same as the Item like this
def set_label_text(self, index) text_for_label = some_model.data(index, qtc.Qt.DisplayRole) label.setText( text_for_label )
It is connected to
clicked
signal of theQListView
like this:sites_box.clicked.connect(self.set_label_text)
I want to Test it in my tests suite so i thought to invoke item selection like this
rows = sites_model.rowCount() iv = {} for row in range(rows): model_text = some_model.data(sites_model.index(row, 0), qtc.Qt.DisplayRole) some_view.selectionModel().setCurrentIndex( sites_model.index(row,0), qtc.QItemSelectionModel.ClearAndSelect ) label_text = self.mainWin.ui.stackedWidget.findChild(qtw.QLabel).text() self.assertEqual(model_text,label_text)
But the apparently this dosent invokes the
clicked
signal so the label isn't changing..
Is there ant other signal i can connect to?. -
I have a QListView that every time i click on an item it sets a QLable text the same as the Item like this
def set_label_text(self, index) text_for_label = some_model.data(index, qtc.Qt.DisplayRole) label.setText( text_for_label )
It is connected to
clicked
signal of theQListView
like this:sites_box.clicked.connect(self.set_label_text)
I want to Test it in my tests suite so i thought to invoke item selection like this
rows = sites_model.rowCount() iv = {} for row in range(rows): model_text = some_model.data(sites_model.index(row, 0), qtc.Qt.DisplayRole) some_view.selectionModel().setCurrentIndex( sites_model.index(row,0), qtc.QItemSelectionModel.ClearAndSelect ) label_text = self.mainWin.ui.stackedWidget.findChild(qtw.QLabel).text() self.assertEqual(model_text,label_text)
But the apparently this dosent invokes the
clicked
signal so the label isn't changing..
Is there ant other signal i can connect to?.