wallacesoh
In class .h file, instead of
QListWidgetItem *item[2]
To copy to clipboard, switch view to plain text mode
do this,
QList<QListWidgetItem*> item;
QList<QListWidgetItem*> item;
To copy to clipboard, switch view to plain text mode
In .cpp file, do this
for(int i = 0; i < strList.size(); i++)
{
....
....
}
// Access the item using at operator like this item.at(i);
for(int i = 0; i < strList.size(); i++)
{
item.append(new QListWidgetItem());
....
....
}
// Access the item using at operator like this item.at(i);
To copy to clipboard, switch view to plain text mode
This way, you can add QListWidgetItems dynamically without need to predefine the number of items.
Bookmarks