hello . I am trying something like this
scene : when someone clicks on delete button , i handle it like this
Button{
text: "delete"
onClicked: {
dbman.del(id) // this one actually deletes file from db and from system , works fine
mod.deletepages(id) // this is what i am trying to implement
}
Button{
text: "delete"
onClicked: {
dbman.del(id) // this one actually deletes file from db and from system , works fine
mod.deletepages(id) // this is what i am trying to implement
}
To copy to clipboard, switch view to plain text mode
so what mod.deletepages(id) do is get the id of the page and send it to here
void listmodel
::deletepages(QString pageid
) {
qDebug() << pageid;
endInsertRows();
}
void listmodel::deletepages(QString pageid)
{
qDebug() << pageid;
beginRemoveRows(QModelIndex(),remove,remove);
endInsertRows();
}
To copy to clipboard, switch view to plain text mode
now what i have is the value not the index . how to get the index of that value .
i have tried to use m_list.indexOf(pageid) ;
but i get error " error: no matching function for call to 'QList<list>::indexOf(QString&)'
int remove = m_list.indexOf(pageid); "
^
so how to get the index
Bookmarks