it.setData(Qt::UserRole, 1);
it.setData(Qt::UserRole+1, 2);
qWarning() << it.data(Qt::UserRole);
qWarning() << it.data(Qt::UserRole + 1);
QListWidgetItem it;
it.setData(Qt::UserRole, 1);
it.setData(Qt::UserRole+1, 2);
qWarning() << it.data(Qt::UserRole);
qWarning() << it.data(Qt::UserRole + 1);
To copy to clipboard, switch view to plain text mode
works fine, so please go ahead and try to debug your code yourself.
And a minimal example would be better. Also the use of [CODE] could make your code more readable.
Bookmarks