I have this slot and I want to be able to use the string that is at the index being passed through. How can I get to it?
void Dialog::on_list_Favorites_2_clicked(const QModelIndex &index)
{
}
Since you're using QListWidget
instead of QListView
you should also use the signal itemClicked(QListWidgetItem*)
instead of clicked(const QModelIndex &)
.
void Dialog::on_list_Favorites_2_itemClicked(QListWidgetItem* item)
{
qDebug() << item->text();
}