switch to listview for contacts
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user