Hey Man,
I am not the best at C++ but this is how I would go about it...
Firstly, create a class for each of your QListItem's by using the following:
{
public:
};
class MyListItem : QListWidgetItem
{
public:
QPixmap *icon_to_be_shown;
};
To copy to clipboard, switch view to plain text mode
Now you will want to create the QListWidget itself and also create your actual item:
void Main()
{
//Create Our QListWidget
//Create Our Item
MyListItem *itm = new MyListItem;
itm->setText("My Item");
itm->icon_to_be_shown = "PATH TO PICTURE";
//Add Our Item To Our List
mylist->addItem(itm);
}
void Main()
{
//Create Our QListWidget
QListWidget *mylist = new QListWidget;
//Create Our Item
MyListItem *itm = new MyListItem;
itm->setText("My Item");
itm->icon_to_be_shown = "PATH TO PICTURE";
//Add Our Item To Our List
mylist->addItem(itm);
}
To copy to clipboard, switch view to plain text mode
Hope this bit of code helps man, also you should look into QListWidget as oppose to QList =)
Matt
Bookmarks