show only memos from selcted contact - work in progress
This commit is contained in:
@@ -62,6 +62,8 @@ void ChatModel::showMessages()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void ChatModel::renderChatBox(QListWidget &view)
|
void ChatModel::renderChatBox(QListWidget &view)
|
||||||
{
|
{
|
||||||
/*for(auto &c : this->chatItems)
|
/*for(auto &c : this->chatItems)
|
||||||
@@ -82,8 +84,15 @@ void ChatModel::renderChatBox(QListWidget *view)
|
|||||||
view->takeItem(0);
|
view->takeItem(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//QModelIndex index = parent->listContactWidget->currentIndex();
|
||||||
|
// QString itemText = index.data(Qt::DisplayRole).toString();
|
||||||
|
|
||||||
|
|
||||||
for(auto &c : this->chatItems)
|
for(auto &c : this->chatItems)
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|
||||||
|
// if ("" == QString(c.second.getAddress())){ ////// ToDo: render only memos from selected contact
|
||||||
QDateTime myDateTime;
|
QDateTime myDateTime;
|
||||||
|
|
||||||
myDateTime.setTime_t(c.second.getTimestamp());
|
myDateTime.setTime_t(c.second.getTimestamp());
|
||||||
@@ -93,6 +102,10 @@ void ChatModel::renderChatBox(QListWidget *view)
|
|||||||
line += QString(c.second.getMemo()) + QString("\n");
|
line += QString(c.second.getMemo()) + QString("\n");
|
||||||
view->addItem(line);
|
view->addItem(line);
|
||||||
line ="";
|
line ="";
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,6 +102,7 @@ class ChatModel
|
|||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
std::map<long, ChatItem> chatItems;
|
std::map<long, ChatItem> chatItems;
|
||||||
|
QTableView* parent;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
ChatModel() {};
|
ChatModel() {};
|
||||||
|
|||||||
@@ -992,16 +992,11 @@ void MainWindow::setupchatTab() {
|
|||||||
///////// Set selected Zaddr for Chat with Doubleklick
|
///////// Set selected Zaddr for Chat with Doubleklick
|
||||||
|
|
||||||
QObject::connect(ui->listContactWidget, &QTableView::doubleClicked, [=] () {
|
QObject::connect(ui->listContactWidget, &QTableView::doubleClicked, [=] () {
|
||||||
for (auto p : AddressBook::getInstance()->getAllAddressLabels()) {
|
|
||||||
QModelIndex index = ui->listContactWidget->currentIndex();
|
QModelIndex index = ui->listContactWidget->currentIndex();
|
||||||
QString itemText = index.data(Qt::DisplayRole).toString();
|
QString itemText = index.data(Qt::DisplayRole).toString();
|
||||||
ui->ContactZaddr->setText(itemText);
|
ui->ContactZaddr->setText(itemText);
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ui->listContactWidget->setCurrentRow(1)
|
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user