void ContactsTable::onSelectionChanged (const QItemSelection &selected, const QItemSelection &deselected) { QItemSelectionModel* selection_model = ui->contact_table->selectionModel(); QModelIndexList indexes = selection_model->selectedRows(); bool oneRow = (indexes.size() == 1); if (oneRow) { QModelIndex mapped_index = _sorted_addressbook_model->mapToSource(indexes[0]); auto contact_id = _addressbook_model->getContact(mapped_index).wallet_index; Q_EMIT contactOpened(contact_id); } else { ui->contact_details_view->setCurrentWidget(ui->page_message); } }
void ContactsTable::openContact( const QModelIndex& index ) { QModelIndex mapped_index = _sorted_addressbook_model->mapToSource(index); auto contact_id = _addressbook_model->getContact(mapped_index).wallet_index; Q_EMIT contactOpened( contact_id ); }
void ContactsTable::openContact( const QModelIndex& index ) { auto contact_id = _addressbook_model->getContact(index).wallet_index; Q_EMIT contactOpened( contact_id ); }