add new background images to chatlist
This commit is contained in:
@@ -3,27 +3,21 @@
|
||||
#include "mainwindow.h"
|
||||
|
||||
void ContactModel::renderContactList(QListView* view)
|
||||
{
|
||||
{ // QStandardItem(const QIcon & icon, const QString & text)
|
||||
QStandardItemModel* contact = new QStandardItemModel();
|
||||
//}
|
||||
for(auto &c : AddressBook::getInstance()->getAllAddressLabels())
|
||||
{
|
||||
// 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"
|
||||
// }
|
||||
//}
|
||||
//QStandardItem* Items = new QStandardItem();
|
||||
QStandardItem* Items1 = new QStandardItem(QIcon("res/darkwing.png"),c.getName());
|
||||
// contact->appendRow(Items);
|
||||
contact->appendRow(Items1);
|
||||
view->setModel(contact);
|
||||
view->setIconSize(QSize(80,100));
|
||||
view->setUniformItemSizes(true);
|
||||
view->setDragDropMode(QAbstractItemView::DropOnly);;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user