Skip to content

fym201/qml-http-uploader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

qml-http-uploader

in main.ccp file:

qmlRegisterUncreatableType<HttpPostField>("HttpUp", 1, 0, "HttpPostField", "Can't touch this");
qmlRegisterType<HttpPostFieldValue>("HttpUp", 1, 0, "HttpPostFieldValue");
qmlRegisterType<HttpPostFieldFile>("HttpUp", 1, 0, "HttpPostFieldFile");
qmlRegisterType<HttpUploader>("HttpUp", 1, 0, "HttpUploader");

Now you can embed the uploader into the QML file by writing, e.g.:

import HttpUp 1.0
Item{
    HttpUploader{
        id: mpUploader
        onUploadStateChanged: {
            if( uploadState == HttpUploader.Done ) {
                console.log("Upload done with status " + status);
                console.log("Error is "  + errorString)
                console.log("response:" + mpUploader.responseText)
            }
        }
        onProgressChanged: {
            console.log("Upload progress = " + progress)
        }
    }
}

About

qml-http-uploader

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages