I have a pointer to a third party QListView object, which is simply displaying rows of text. What is the best way of getting a hold of that string of text?
I have a pointer to a third party QListView object, which is simply displaying
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The model, accessible by
QListView::model(), holds the items. You can do something like this:You also mention you would like to obtain the updated strings when text is written – you can do this by connecting the model’s
dataChanged()signal to your function that extracts strings. SeeQAbstractItemModel::dataChanged().