Hi,
I tried adding an icon with a text to QListView.
it shows the icon on top of the text. I want it to show it on next to each other like <Icon><Text>
how to do it?
Here is below my code:
// String List Model 2
// List View 2
lv2->setModel(sim2);
lv2->setFixedSize(200, 200);
lv2->setWrapping(false);
// String List Model 2
sim2 = new QStandardItemModel;
// List View 2
lv2 = new QListView;
lv2->setModel(sim2);
lv2->setViewMode(QListView::IconMode);
lv2->setFlow(QListView::TopToBottom);
sim2->appendRow(new QStandardItem(QIcon(":/Images/LEDOn.jpg"), "Test1"));
sim2->appendRow(new QStandardItem(QIcon(":/Images/LEDOff.jpg"), "Test2"));
lv2->setFixedSize(200, 200);
lv2->setWrapping(false);
To copy to clipboard, switch view to plain text mode
i have attached the output "Sample1.png"
Bookmarks