Skip to main content
Formatações de código
Fonte Link
Isac
  • 25,5mil
  • 3
  • 31
  • 51

void page100::processarDados(){

void page100::processarDados(){

    QString json = reply->readAll();
    QRegExp expretion("[{}]");      //expreçao regular
    QStringList Attribute;

    Attribute = json.split(expretion);


    QStringList elementRecord;
    QRegExp exp("[:,]");        //expreçao regular

    for(int i = 1; i< Attribute.size();i+=2){
    
        elementRecord = Attribute[i].split(exp);
    
        for(int j = 0; j <elementRecord.size(); j++){

            elementRecord = Attribute[i].split(exp);

            qDebug() << elementRecord[j];
        }

    }
}

}

void page100::processarDados(){

QString json = reply->readAll();
QRegExp expretion("[{}]");      //expreçao regular
QStringList Attribute;

Attribute = json.split(expretion);


QStringList elementRecord;
QRegExp exp("[:,]");        //expreçao regular

for(int i = 1; i< Attribute.size();i+=2){

    elementRecord = Attribute[i].split(exp);

    for(int j = 0; j <elementRecord.size(); j++){

        elementRecord = Attribute[i].split(exp);

        qDebug() << elementRecord[j];
    }

}

}

void page100::processarDados(){

    QString json = reply->readAll();
    QRegExp expretion("[{}]");      //expreçao regular
    QStringList Attribute;

    Attribute = json.split(expretion);


    QStringList elementRecord;
    QRegExp exp("[:,]");        //expreçao regular

    for(int i = 1; i< Attribute.size();i+=2){
    
        elementRecord = Attribute[i].split(exp);
    
        for(int j = 0; j <elementRecord.size(); j++){

            elementRecord = Attribute[i].split(exp);

            qDebug() << elementRecord[j];
        }

    }
}

ASSERT failure in QList::operator[]: "index out of range", file ../../../../Qt485/imx28/qt-everywhere-opensource-src-4.8.5/include/QtCore/../../src/corelib/tools/qlist.h, line 477

ASSERT failure in QList::operator[]: "index out of range", file ../../../../Qt485/imx28/qt-everywhere-opensource-src-4.8.5/include/QtCore/../../src/corelib/tools/qlist.h, line 477

ASSERT failure in QList::operator[]: "index out of range", file ../../../../Qt485/imx28/qt-everywhere-opensource-src-4.8.5/include/QtCore/../../src/corelib/tools/qlist.h, line 477

ASSERT failure in QList::operator[]: "index out of range", file ../../../../Qt485/imx28/qt-everywhere-opensource-src-4.8.5/include/QtCore/../../src/corelib/tools/qlist.h, line 477

adicionou 873 caracteres ao conteúdo
Fonte Link
Gabriel Silva
  • 734
  • 3
  • 8
  • 25
QString json = reply->readAll();
QRegExp expretion("[{}]");      //expreçao regular
QStringList Attribute;

Attribute = json.split(expretion);


QStringList elementRecord;
QRegExp exp("[:,]");        //expreçao regular

for(int i = 1; i< Attribute.size();i+=2){

    elementRecord = Attribute[i].split(exp);

    for(int j = 0; j <elementRecord.size(); j++){

        elementRecord = Attribute[i].split(exp);

        ui->saida->setPlainTextqDebug(elementRecord[j]); << elementRecord[j];
    }

}

inserir a descrição da imagem aqui

[
  {
    "idInstallation": 0,
    "project_Code": 0,
    "runId": 4,
    "block": "RUN_1",
    "input": "PLC_DigIn_1",
    "state": "1",
    "operation": true,
    "allDescription": null,
    "reducedDescription": "Test",
    "tstId": 0
  },
  {
    "idInstallation": 0,
    "project_Code": 0,
    "runId": 5,
    "block": "RUN_2",
    "input": "PLC_DigIn_2",
    "state": "1",
    "operation": true,
    "allDescription": null,
    "reducedDescription": "Test 2",
    "tstId": 0
  },
  {
    "idInstallation": 0,
    "project_Code": 0,
    "runId": 8,
    "block": "RUN_3",
    "input": "PLC_DigIn_3",
    "state": "1",
    "operation": true,
    "allDescription": null,
    "reducedDescription": "Test 3",
    "tstId": 0
  }
]
QString json = reply->readAll();
QRegExp expretion("[{}]");      //expreçao regular
QStringList Attribute;

Attribute = json.split(expretion);


QStringList elementRecord;
QRegExp exp("[:,]");        //expreçao regular

for(int i = 1; i< Attribute.size();i+=2){

    elementRecord = Attribute[i].split(exp);

    for(int j = 0; j <elementRecord.size(); j++){

        elementRecord = Attribute[i].split(exp);

        ui->saida->setPlainText(elementRecord[j]);
    }

}

inserir a descrição da imagem aqui

QString json = reply->readAll();
QRegExp expretion("[{}]");      //expreçao regular
QStringList Attribute;

Attribute = json.split(expretion);


QStringList elementRecord;
QRegExp exp("[:,]");        //expreçao regular

for(int i = 1; i< Attribute.size();i+=2){

    elementRecord = Attribute[i].split(exp);

    for(int j = 0; j <elementRecord.size(); j++){

        elementRecord = Attribute[i].split(exp);

        qDebug() << elementRecord[j];
    }

}
[
  {
    "idInstallation": 0,
    "project_Code": 0,
    "runId": 4,
    "block": "RUN_1",
    "input": "PLC_DigIn_1",
    "state": "1",
    "operation": true,
    "allDescription": null,
    "reducedDescription": "Test",
    "tstId": 0
  },
  {
    "idInstallation": 0,
    "project_Code": 0,
    "runId": 5,
    "block": "RUN_2",
    "input": "PLC_DigIn_2",
    "state": "1",
    "operation": true,
    "allDescription": null,
    "reducedDescription": "Test 2",
    "tstId": 0
  },
  {
    "idInstallation": 0,
    "project_Code": 0,
    "runId": 8,
    "block": "RUN_3",
    "input": "PLC_DigIn_3",
    "state": "1",
    "operation": true,
    "allDescription": null,
    "reducedDescription": "Test 3",
    "tstId": 0
  }
]
Fonte Link
Gabriel Silva
  • 734
  • 3
  • 8
  • 25
Carregando