Hii, can any1 tell me what function is used to perform some action on checking or unchecking the checkbox in a listview..
below is my code, it shows the checkboxes in the listview…plz help..
fileTypes << “_*.dll†;
dir.setPath(“E:/qtpro/extâ€);
dir.setNameFilters(fileTypes);
files = dir.entryList();
parentItem = model->invisibleRootItem();
for (int i = 0; i < files.size(); ++i)
{
fileInfo = files.at(i);
myitem
->setText
(QString(â€
%0â€
).
arg(fileInfo.
fileName()));
model->setItem(i, myitem);
myitem->setCheckable(true);
}
view->setGeometry(10, 20, 256, 192);
view->setModel(model);
QStandardItemModel *model;
QListView *view;
QStandardItem *parentItem;
QStandardItem *myitem;
fileTypes << “_*.dll†;
dir.setPath(“E:/qtpro/extâ€);
dir.setNameFilters(fileTypes);
files = dir.entryList();
model = new QStandardItemModel(centralWidget);
parentItem = model->invisibleRootItem();
for (int i = 0; i < files.size(); ++i)
{
fileInfo = files.at(i);
myitem = new QStandardItem();
myitem->setText(QString(â€%0â€).arg(fileInfo.fileName()));
model->setItem(i, myitem);
myitem->setCheckable(true);
}
view = new QListView(centralWidget);
view->setGeometry(10, 20, 256, 192);
view->setModel(model);
To copy to clipboard, switch view to plain text mode
Bookmarks