QListWidget, choice and revert
-
I am using a QListWidget to allow selection of a data source, when a choice is made I check the content on the form for changes and if any changes have been made but not submitted I prompt the user to make a decision either to stay on the form with no change in selection or to go ahead with the new selection.
Is there any way to get the original selection index from the QListWidget at the time the prompt is given to the user so that if the decision is not to change the list can be reverted back to the original position?
-
@jsulm , thank you, I'm using the currentItemChanged signal which has current and previous parameters which are of type QListWidgetItem, looking at the help page for this class:
https://doc.qt.io/qt-5/qlistwidgetitem.htmlHow do I determine its position in the list?
[Edit], Sorry I see now, using the setCurrentItem of the QListWidget and passing the item.