コード例 #1
0
QStringList MainWindow::checkElements(QDomElement element){
    QDomNode child = element.firstChild();
    QStringList errors;
    while (!child.isNull()) {
        QString tagName = child.toElement().tagName();
        if(tagName == "label") {
            errors << checkLabel(child.toElement());
        } else if (tagName == "line") {
            errors << checkLine(child.toElement());
        } else if (tagName == "button") {
            errors << checkButton(child.toElement());
        } else if (tagName == "lineEdit") {
            errors << checkLineEdit(child.toElement());
        } else if (tagName == "spinBox") {
            errors << checkSpinBox(child.toElement());
        } else if (tagName == "checkBox") {
            errors << checkCheckBox(child.toElement());
        } else if (tagName == "radioGroup") {
            errors << checkRadioGroup(child.toElement());
        } else if (tagName == "tweet") {
            errors << checkTweetWidget(child.toElement());
        } else if (tagName == "tabSet") {
            errors << checkTabLayout(child.toElement());
        } else if (tagName == "challongeMatch") {
            errors << checkChallongeWidget(child.toElement());
        } else if (tagName == "cli") {
            //errors << checkCLI(child.toElement());
        }
        child = child.nextSibling();
    }
    return errors;
}
コード例 #2
0
bool AnagraficaAddDialog::checkValues(void)
{
    qDebug() << "AnagraficaAddDialog::checkValues()";

    //Controllo denominazione
    if ((ui->aziendaRB->isChecked() || ui->fornitoreRB->isChecked() ||
            ui->paRB->isChecked()) && ui->denominazioneLE->text().isEmpty()) {
        ui->denominazioneLE->setStyleSheet(css::warning);
        showDialogError(this, ERR019, MSG016);
        return false;
    }

    //Controllo nome e cognome
    if (ui->clienteRB->isChecked() && (ui->nomeLE->text().isEmpty() ||
            ui->cognomeLE->text().isEmpty())) {
        ui->nomeLE->setStyleSheet(css::warning);
        ui->cognomeLE->setStyleSheet(css::warning);
        showDialogError(this, ERR020, MSG033);
        return false;
    }

    //Controllo se i campi obbligatori sono stati inseriti.
    if (!checkLineEdit(ui->pivaLE, "partita IVA") ||
            !checkLineEdit(ui->codFiscaleLE, "codice fiscale") ||
            !checkLineEdit(ui->indirizzoLE, "indirizzo") ||
            !checkComboBox(ui->cittaCB, "citta") ||
            !checkComboBox(ui->provinciaCB, "provincia") ||
            !checkComboBox(ui->capCB, "CAP") ||
            !checkComboBox(ui->statoCB, "stato"))
        return false;

    if (!controlloPartitaIva(m_mapPersona[ph::PRT_IVA]))
        if (!showDialogWarning(this, ERR023, MSG019)) //NOTE codice errore 023
            return false;

    if (m_mapPersona[ph::COD_FISCALE] != m_mapPersona[ph::PRT_IVA])
        if (!controlloCodiceFiscale(m_mapPersona[ph::COD_FISCALE]))
            if (!showDialogWarning(this, ERR024, MSG020)) //NOTE codice errore 024
                return false;

    return true;
}
コード例 #3
0
ファイル: main.cpp プロジェクト: KubaO/stackoverflown
 void add(QLineEdit *l, QValidator *v) {
    l->setValidator(v);
    connect(l, SIGNAL(textChanged(QString)), SLOT(checkLineEdit()));
    m_needsValid++;
    checkValidity(l);
 }