i wish to display the file icon of listview.cpp in the QListView Widget...but am just getting the text passed to the constructor i.e. "nupul"
What is wrong?
#include <QApplication>
#include <QListWidget>
int main(int argc, char *argv[])
{
QIcon icon
("/Qt/4.1.0/project/listview/listview.cpp");
l->addItem(item);
l->show();
return app.exec();
}
#include <QApplication>
#include <QListWidget>
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
QListWidget *l=new QListWidget(0);
l->setViewMode(QListView::IconMode);
QIcon icon("/Qt/4.1.0/project/listview/listview.cpp");
QListWidgetItem *item=new QListWidgetItem(icon, "nupul",l,0);
l->addItem(item);
l->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Thanks
Nupul
Bookmarks