Exemple #1
0
void NoteView::addClicked()
{
	AddDialog dialog;
	if( dialog.exec() )
	{
        Note note( dialog.getNoteNameEdit().toStdString(), dialog.getNoteTextEdit().toStdString() );
        _controller->addNote( note );
	}

}
//! [2]
void AddressWidget::addEntry()
{
    AddDialog aDialog;

    if (aDialog.exec()) {
        QString name = aDialog.nameText->text();
        QString address = aDialog.addressText->toPlainText();

        addEntry(name, address);
    }
}
Exemple #3
0
//! [1]
void NewAddressTab::addEntry()
{
    AddDialog aDialog;
    
    if (aDialog.exec()) {
        QString name = aDialog.nameText->text();
        QString address = aDialog.addressText->toPlainText();
        
        emit sendDetails(name, address);
    }
}
void WaypointWidget::addEntry()
{
    AddDialog aDialog;

    if (aDialog.exec()) {
        QString name = aDialog.nameText->text();
        QString waypoint = aDialog.waypointText->toPlainText();

        addEntry(name, waypoint);
    }
}
void TableView::addAction()
{
    AddDialog dialog;

    if (dialog.exec())
    {
        QString description = dialog.description->text();
        QString username = dialog.username->text();
        QString password = dialog.password->text();

        addAction(description, username, password);
    }
}
Exemple #6
0
void AddressOverviewWindow::addEntry()
{
    AddDialog aDialog;

    if (aDialog.exec()) {
        QString firstName = aDialog.getFirstName();
        QString lastName = aDialog.getLastName();
        QString address = aDialog.getAddress();
        QString city = aDialog.getCity();
        QString zipCode = aDialog.getZipCode();

        addEntry(firstName,lastName,address,city,zipCode);
    }
}
void TableView::modAction()
{
    QModelIndexList indexes = selectionModel()->selectedIndexes();
    if (indexes.isEmpty())
        return;
    QModelIndex index, index1;
    index = indexes.at(0);
    index1 = passModel->index(index.row(), 0, QModelIndex());
    QString username, password, description;
    QVariant varName = passModel->data(index1, Qt::DisplayRole);
    description = varName.toString();
    index1 = passModel->index(index.row(), 1, QModelIndex());
    varName = passModel->data(index1, Qt::DisplayRole);
    username = varName.toString();
    index1 = passModel->index(index.row(), 2, QModelIndex());
    varName = passModel->data(index1, Qt::DisplayRole);
    password = varName.toString();

    AddDialog dialog;
    dialog.setWindowTitle(tr("Edit a contact"));
    dialog.description->setText(description);
    dialog.username->setText(username);
    dialog.password->setText(password);

    if (dialog.exec())
    {
        QString descripMod = dialog.description->text();
        QString usernameMod = dialog.username->text();
        QString passwordMod = dialog.password->text();
        index1 = passModel->index(index.row(), 0, QModelIndex());
        passModel->setData(index1, descripMod, Qt::EditRole);
        index1 = passModel->index(index.row(), 1, QModelIndex());
        passModel->setData(index1, usernameMod, Qt::EditRole);
        index1 = passModel->index(index.row(), 2, QModelIndex());
        passModel->setData(index1, passwordMod, Qt::EditRole);
    }
}