extracting a item from a QListWidget question
I have a QListWidget lwFoo whch cantains a column of QString items.
I double clicked on an item and got an index, but what I want is the item itself. In Ot3 terminalogy the "text"!!!.
I can't make heads or tails of documentation to do this.
I would appreciate is if someone could give me the code or explain the documentation in an understandable format.
I think I found a way
Code:
inputText = wow->text();
or
Code:
inputText = lwCurrentList->item ( index ) -> text();
tsk! tsk! tsk!
Thanks.
Re: extracting a item from a QListWidget question
If you have an index you can simply call index.data() to retrieve a QVariant with the data, but the snippet you have written will also work.
By the way - you could have connected to the itemDoubleClicked() signal to get the actual item right away.