Qt Learning: the use of QListWidget.
Important functions of the QListWidget class:
1.void addItem (const QWidgetItem*); / / add an item. You need to create an object for an item first.
Examples are as follows:
QListWidgetItem * ite = new QListWidgetItem;ite- > setText (QString::fromLocal8Bit ("Hangzhou"); ui.listWidget- > addItem (ite); 123
2.void addItems (const QStringList &); / / add multiple items, which are pre-placed in the QStringList container or stored in a temporary container. Examples are as follows:
Ui.listWidget- > addItems (QStringList ()