Hi,
i have a QListView with an underlying QStringList as model, now i want to read out the currently selected string in my listView for further use. How would i do that?
Hi,
i have a QListView with an underlying QStringList as model, now i want to read out the currently selected string in my listView for further use. How would i do that?
Here's an example how I would do it:
Qt Code:To copy to clipboard, switch view to plain text mode
Use QAbstractItemView::currentIndex() and QModelIndex::data():You might want check if current index is valid.Qt Code:
To copy to clipboard, switch view to plain text mode
geleven (6th April 2010)
thanks, works perfectly!
Bookmarks