void accountmanagerdialog::on_editButton_clicked() { QList<QListWidgetItem*> selected = ui->listWidget->selectedItems(); if(selected.isEmpty()) return; QListWidgetItem *thisOne = selected.first(); Account *acc = getAccount(thisOne); AccountDialog *accDiag = new AccountDialog(0,acc); accDiag->exec(); }
void accountmanagerdialog::on_addButton_clicked() { AccountDialog *accDiag = new AccountDialog(0); switch(accDiag->exec()) { case QDialog::Accepted: { ui->listWidget->addItem(makeListItem(accDiag->account)); break; } case QDialog::Rejected: return; } }
void MainWindow::add() { AccountDialog *accountdialog = new AccountDialog(m, 1); accountdialog->exec(); }
void MainWindow::update() { AccountDialog *accountdialog = new AccountDialog(m, 2); accountdialog->exec(); }