×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Jul 2012
    Posts
    6

    error QNetworkAccessManager

    I am using QNetworkAccessManager to download data and add to database but device (e5) very hot when use..

    I do not know why

    help me...



    example:

    nam = new QNetworkAccessManager(parent);
    // new line
    Initialize();
    QObject::connect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleNetworkReply(QNetworkReply*)));



    void NetworkApi:ownLoadCatalouge()
    {

    QObject::connect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleNetworkReply(QNetworkReply*)));


    isDownloadCatalouge=true;
    QNetworkRequest request(QUrl("http://apps.imark.com.vn:8080/MobileWsFC/FCProductCatalougeWS.asmx/getAll"));

    QByteArray data;


    data.remove(0,1);

    nam->post(request,data);

    }


    void NetworkApi::handleNetworkReply(QNetworkReply* reply)
    {

    disconnect(nam, SIGNAL(finished(QNetworkReply*)), this, SLOT(handleNetworkReply(QNetworkReply*)));
    //QVariant statusCodeV = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute);
    // no error received?
    if (reply->error() == QNetworkReply::NoError)
    {
    QString stringXML(reply->readAll()); // raw xml

    qDebug(QString("\n\n---------------\n").append(stringXML).toUtf8());


    emit GetDataReceived(&stringXML);


    }
    else
    {

    }

    reply->deleteLater();
    Initialize();

    }





    void DownLoadCatalouge::showEvent(QShowEvent *)
    {

    ui->label->setText("Dang tai du lieu loai san pham, vui long doi...");
    ui->label_2->setText("");
    if(dbMag->DeleteTableCatalouge())
    {
    connect(networkApi,SIGNAL(commError(QString*)),this,SLOT(NetworkError(QString*)));

    connect(networkApi,SIGNAL(GetDataReceived(QString*)),this,SLOT(ProcessDownLoadCatalouge(QString*)));
    networkApi->DownLoadCatalouge();
    // connect(networkApi,SIGNAL(DownLoadCatalougeReceived(QString*)),this,SLOT(ProcessDownLoadCatalouge(QString*)));
    }
    else
    {
    QMessageBox::warning(this,tr("Thông Báo"),"Loi xoa du lieu loai san pham cu");

    }
    }


    void DownLoadCatalouge::ProcessDownLoadCatalouge(QString *xmlData)
    {
    disconnect(networkApi,SIGNAL(commError(QString*)),this,SLOT(NetworkError(QString*)));

    disconnect(networkApi,SIGNAL(GetDataReceived(QString*)),this,SLOT(ProcessDownLoadCatalouge(QString*)));


    QDomDocument xml("ICamera_Response_downloadCatalouge");
    xml.setContent(*xmlData);

    QDomElement rootNode = xml.documentElement();
    QString akjsdh= rootNode.nodeName();
    if(rootNode.nodeName()=="ArrayOfBizProductCatalouge")
    {
    QDomNode rootNode1=rootNode.firstChild();
    while(!rootNode1.isNull())
    {

    QString caID=rootNode1.firstChild().firstChild().nodeValue();
    QString nameCata=rootNode1.firstChild().nextSibling().firstChild().nodeValue();
    QString isDoiThu=rootNode1.firstChild().nextSibling().nextSibling().firstChild().nodeValue();
    if(caID!="" && nameCata!="" && isDoiThu!="")
    {
    int bCheck =dbMag->AddNewCatalouge(caID,nameCata,isDoiThu);
    if(bCheck==-1)
    {
    QMessageBox::warning(this,tr("Thông Báo"),"Loi Insert Catalouge");
    }
    }
    rootNode1=rootNode1.nextSibling();
    }
    result="Tai thanh cong loai du lieu";
    //disconnect(networkApi,SIGNAL(DownLoadCatalougeReceived(QString*)),this,SLOT(ProcessDownLoadCatalouge(QString*)));
    }
    else
    {
    result="Tai khong thanh cong loai du lieu";
    }

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: error QNetworkAccessManager

    Basically your Subject line says that you have error with usage of this API, and your text says that your device just gets hot, so you might want to explain on what the actual problem is, as well as give more information on the device used, Qt versions etc.

  3. #3
    Registered User
    Join Date
    Jul 2012
    Posts
    6

    Re: error QNetworkAccessManager

    I use the API is not faulty, but when using the hot and the battery power, on nokia E5, qt 4.7.1

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: error QNetworkAccessManager

    There could be something wrong with your device. Basically this API should not in general make device very hot, of course when the network is used there are more processing as well as the transmission takes power, which both can cause some heat.

    Anyway, I'm rather certain that the API itself would not be causing the problems, All and all you can always make bug report for it.

    For future queries, do remember to make the subject of the question to match the actual problem you are having, it makes it easier to help you.

  5. #5
    Registered User
    Join Date
    Jul 2012
    Posts
    6

    Re: error QNetworkAccessManager

    thanks...

    E5 is symbian os 9.3, s60 rel. 3.2, but when build i using "Edit build configuration : Qt 4.7.1 for symbian^1(qt SDK ) debug " will it affect anything?


    and I use a timer to check if any data equa true will upload," _timerUpload->start(300000)"

    help me fix it

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,166

    Re: error QNetworkAccessManager

    Sorry missed the device, please check: http://qt-project.org/wiki/Support-for-Symbian

    Basically your device is not supporting Qt 4.7, thus you should use Qt 4.6.3 instead

Similar Threads

  1. QNetworkAccessManager compilation error on device
    By xiaohanlouie in forum [Archived] Qt SDKs and Tools
    Replies: 3
    Last Post: 2011-03-31, 07:56

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×