Results 1 to 1 of 1

Thread: qml deployment problem

  1. #1
    Join Date
    Aug 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default qml deployment problem

    I write a qml program to retrieve the photos album from flickr website, using the following js code, it works fine.
    function flickrGetPhotoSets()
    {
    req = new XMLHttpRequest();
    req.onreadystatechange = flickrGetPhotoSetsResponse;//parseFunc
    var url = "http://api.flickr.com/services/rest/?method=flickr.photosets.getList&api_key=apikey &user_id=userid&format=json"
    req.open("POST", url, true);
    // req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    req.setRequestHeader("Content-Encoding", "UTF-8");
    req.send();
    }
    function flickrGetPhotoSetsResponse()
    {
    console.log("taobao response start...");
    if (req.readyState == XMLHttpRequest.HEADERS_RECEIVED)
    {
    }
    else if (req.readyState == XMLHttpRequest.DONE)
    {
    if(req.responseText.length == 0 || req.responseText == null)
    {
    return;
    }
    console.log( req.responseText);
    var rsp= req.responseText.toString();
    var start = rsp.indexOf("(") + 1;
    console.log("string start:"+start);
    var end = rsp.length - 1;
    var jSONString = rsp.substring( start, end);
    console.log(jSONString);
    photosetJson = JSON.parse(jSONString);
    background.formatAlbumListModel();
    }
    }


    Then I try to retrieve photo albums from another website, using the similar js code as following code , it runs fine as picture 2 when I using Qt Creator to compile


    function taotaoGetAccessToken()
    {
    req = new XMLHttpRequest();
    req.onreadystatechange = renrenGetAccessTokenResponse;//parseFunc
    var url = "https://graph.taotao.com/oauth/token?grant_type=password&username=username&passwo rd=password&client_id=clientid &client_secret=clientsecret&scope=read_user_alb um read_user_photo"
    req.open("POST", url, true);
    // req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    req.setRequestHeader("Content-Encoding", "UTF-8");
    req.send();
    }
    function taotaoGetAccessTokenResponse()
    {
    console.log("taotao response start...");
    if (req.readyState == XMLHttpRequest.HEADERS_RECEIVED)
    {
    }
    else if (req.readyState == XMLHttpRequest.DONE)
    {
    if(req.responseText.length == 0 || req.responseText == null)
    {
    return;
    }
    console.log( req.responseText);
    var rsp= req.responseText.toString();
    var accesstokenJson= JSON.parse(rsp);
    accesstoken= accesstokenJson["access_token"]
    var paraArray =
    [
    "api_key=" + "apikey"
    ,"method="+ "photos.getAlbums"
    ,"access_token=" + accesstoken
    ,"format=" + "JSON"
    ,"v=" + "1.0"
    ,"uid=" + "224243671" //"243571487"
    ];
    //
    paraArray.sort();
    var signString= paraArray.join("");
    signString= signString+ "signstring"
    console.log( signString);
    var sign= hex_md5(signString);
    paraArray.push("sig="+sign)
    taotaoGetAlbumsApiURL= "http://api.taotao.com/restserver.do?"+paraArray.join("&");
    console.log("API URL:"+ taotaoGetAlbumsApiURL);
    taotaoGetPhotoSets(taotaoGetAlbumsApiURL)
    }
    }
    function taotaoGetPhotoSets(apirul)
    {
    req = new XMLHttpRequest();
    req.onreadystatechange = taotaoGetPhotoSetsResponse;//parseFunc
    var url = apirul
    req.open("POST", url, true);
    // req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
    req.setRequestHeader("Content-Encoding", "UTF-8");
    req.send();
    }
    function taotaoGetPhotoSetsResponse()
    {
    console.log("taotao response start...");
    if (req.readyState == XMLHttpRequest.HEADERS_RECEIVED)
    {
    }
    else if (req.readyState == XMLHttpRequest.DONE)
    {
    if(req.responseText.length == 0 || req.responseText == null)
    {
    return;
    }
    console.log( req.responseText);
    var rsp= req.responseText.toString();
    photosetJson= JSON.parse(rsp);
    // if (photosetJson["error_code"]==undefined)
    background.formatTaotaoAlbumListModel();
    // else
    // {
    // taotaoGetPhotoSets(taotaoGetAlbumsApiURL);
    // console.log("get photoset return error code");
    // }
    }
    }


    However, when I deploy the second program, it is not working as in Qt Creator. It displays as pictures 3, in the release folder, besides the compiled exe file, I do include libgcc_s_dw2-1.dll, mingwm10.dll, imageformats, and qt related dlls, the first application can be deployed successfully when I including these files. This is really a weird problem, what is the problem of the second part js code for deployment, why the second part js code can run successfully in Qt creator but fails in deployment? Ps: the two parts js code both linked to the same qml.
    Attached Images Attached Images

Similar Threads

  1. problem with qml + webkit deployment
    By tereks in forum Qt Quick
    Replies: 5
    Last Post: 10th June 2011, 11:39
  2. Mac deployment problem
    By MarkSutton71 in forum Installation and Deployment
    Replies: 1
    Last Post: 15th May 2011, 04:12
  3. !!!! problem deployment of a Mac
    By eric_vi in forum Installation and Deployment
    Replies: 0
    Last Post: 21st May 2010, 15:38
  4. deployment problem in solaris9
    By omprakash in forum Installation and Deployment
    Replies: 1
    Last Post: 6th July 2008, 19:01
  5. mac deployment problem
    By munna in forum Installation and Deployment
    Replies: 1
    Last Post: 6th December 2006, 14:38

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.