switch to listview for contacts

This commit is contained in:
DenioD
2020-05-03 13:28:41 +02:00
parent 765bedde80
commit c8b274ecfe
6 changed files with 28 additions and 15 deletions

View File

@@ -2,15 +2,28 @@
#include "addressbook.h"
#include "mainwindow.h"
void ContactModel::renderContactList(QListWidget* view)
void ContactModel::renderContactList(QListView* view)
{
while(view->count() > 0)
{
view->takeItem(0);
}
QStandardItemModel* contact = new QStandardItemModel();
//}
for(auto &c : AddressBook::getInstance()->getAllAddressLabels())
{
view->addItem(c.getName());
// view->addItem(c.getName());
QStandardItem* Items = new QStandardItem(c.getName());
contact->appendRow(Items);
// view->setItemDelegate({text: contact})
// width: view->width })
// height: avatar.implicitHeight,
// leftPadding: avatar.implicitWidth + 32})
// Image {
// id: avatar
// source: "qrc:/" + modelData.replace(" ", "_") + ".png"
// }
//}
view->setModel(contact);
}