Example #1
0
void AutoFillWidget::setFormData(const QVector<PasswordEntry> &data)
{
    m_data = data;

    for (int i = 0; i < data.count(); ++i) {
        const PasswordEntry d = data.at(i);
        if (d.username.isEmpty()) {
            continue;
        }

        QPushButton* button = new QPushButton(this);
        button->setIcon(QIcon(":icons/other/login.png"));
        button->setStyleSheet("text-align:left;font-weight:bold;");
        button->setText(d.username);
        button->setProperty("data-index", i);
        button->setFlat(true);

        ui->gridLayout->addWidget(button, i, 0);
        connect(button, SIGNAL(clicked()), this, SLOT(loginToPage()));
    }
}
Example #2
0
void AutoFillWidget::setFormData(const QVector<PasswordEntry> &data)
{
    m_data = data;

    for (int i = 0; i < data.count(); ++i) {
        const PasswordEntry d = data.at(i);
        if (d.username.isEmpty()) {
            continue;
        }

        QPushButton* button = new QPushButton(this);
        button->setText(tr("Login"));
        button->setToolTip(d.username);
        button->setProperty("data-index", i);
        QLabel* label = new QLabel(this);
        label->setText(tr("Login as <b>%1</b>").arg(d.username));

        ui->gridLayout->addWidget(label, i, 0);
        ui->gridLayout->addWidget(button, i, 1);
        connect(button, SIGNAL(clicked()), this, SLOT(loginToPage()));
    }
}