[Solved] Quotes included when gets info from QListWidgetItem.
-
I add QStrigs to QListWidgetItem (custom) as follows:
@
QList<QString> CustomItem::listItemsAvailable = QList<QString>() << QString("One")
<< QString("Two")
<< QString("Three);
@When I try to get the selected item, as follows:
@
QString text = currentItem()->text();
qDebug () << text;
@I returns the selected List Item, but with quotes, so, qDebug() writes: "One", for example. With qoutes.
How it comes?
Thank you.
-
Your string does not contain quotes.
QDebug prints quotes around all QStrings.
@
QString qstr("Hello");
qDebug() << "Hello" << qstr;
@
gives@
Hello "Hello"
@ -
Oh boy, thank you, and sorry for that.
-
You're welcome, and no need to be sorry! We all learn by asking questions. :)