void MessageListView::selectedMessages(QList<WIZMESSAGEDATA>& arrayMsg) { QList<QListWidgetItem*> items = selectedItems(); foreach(QListWidgetItem* item, items) { MessageListViewItem* pItem = dynamic_cast<MessageListViewItem*>(item); arrayMsg.push_back(pItem->data()); }
void MessageListView::addMessage(const WIZMESSAGEDATA& msg, bool sort) { MessageListViewItem* pItem = new MessageListViewItem(msg); int nHeight = Utils::StyleHelper::thumbnailHeight() + Utils::StyleHelper::margin() * 2; pItem->setSizeHint(QSize(sizeHint().width(), nHeight)); addItem(pItem); if (sort) { sortItems(); } Q_EMIT sizeChanged(count()); }
void MessageListView::addMessage(const WIZMESSAGEDATA& msg, bool sort) { if (msg.nDeleteStatus == 1) { // qDebug() << "[Message]Deleted message would not be displayed : " << msg.title; return; } MessageListViewItem* pItem = new MessageListViewItem(msg); int nHeight = Utils::StyleHelper::thumbnailHeight() + Utils::StyleHelper::margin() * 5; pItem->setSizeHint(QSize(sizeHint().width(), nHeight)); addItem(pItem); if (sort) { sortItems(); } Q_EMIT sizeChanged(count()); }