I want to get the index of item of QListView and set at this item focus. The items are strings! How can I make it?
I have made this is:
Code:
void LicenceBuilder::findLeftSN(const QString& new_SN) { if(new_SN.isEmpty()) return; QSqlTableModel model; model.setTable("DeviceList"); model.select(); QStringList listNames, selList; for(int i=0; i<model.rowCount(); ++i) { listNames.append(record.value("serialNumber").toString()); } if(name.indexOf(new_SN, 0, Qt::CaseInsensitive) != -1) selList.append(name); /// What to do?????? }
This slot must find index of item and set focus. Help me, please!