Giter Site home page Giter Site logo

quickdownload's Introduction

QuickDownload

Easy way to download files with Qt QML and C++

Features

  • Asynchronous downloads
  • Supports Qt URL schemes (http, https, ftp, custom)
  • Uses QSaveFile = no corrupt or partial file downloads.
  • Possible to set custom NetworkAccessManager via C++
  • Self-register QML type. Plug'n'play.

Install

qpm

Setup qpm as described in the Usage for App Developers section

qpm install com.blackgrain.qml.quickdownload

Manual install

Plugin

cd /path/to/projects
git clone [email protected]:Larpon/QuickDownload.git

Open quickdownload.pro in QtCreator and build. The result should be a *.so plugin file.

Linked

Clone from github

cd /path/to/your/qt/project/vendor/folder
git clone [email protected]:Larpon/QuickDownload.git

Include quickdownload.pri in your projects .pro file

include(<path to extensions/vendor folder>/QuickDownload/quickdownload.pri)

NOTE quickdownload.pri auto-register the QML type Download via the Q_CORE_STARTUP_FUNCTION macro.

Usage

import QtQuick 2.0
import com.blackgrain.qml.quickdownload 1.0

Item {

    Download {
        id: download1

        url: "http://placehold.it/350x150"
        destination: "file:///tmp/test.png"

        running: true

        followRedirects: true
        onRedirected: console.log('Redirected',url,'->',redirectUrl)

        onStarted: console.log('Started download',url)
        onError: console.error(errorString)
        onProgressChanged: console.log(url,'progress:',progress)
        onFinished: console.info(url,'done')

    }

    Download {
        id: download2

        url: "ftp://speedtest.tele2.net/5MB.zip"
        destination: "file:///tmp/QuickDownload_test.zip"

        overwrite: true
        running: !download1.running

        onStarted: console.log('Started download',url)
        onError: console.error(errorString)
        onProgressChanged: console.log(url,'progress:',progress)
        onFinished: console.info(url,'done')
    }

    Download {
        id: download3

        url: "ftp://demo:[email protected]/readme.txt"
        destination: "file:///tmp/QuickDownload_test_readme.txt"

        overwrite: true
        running: true

        onStarted: console.log('Started download',url)
        onError: console.error(errorString)
        onProgressChanged: console.log(url,'progress:',progress)
        onFinished: console.info(url,'done')
    }

}

quickdownload's People

Contributors

larpon avatar sirius avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

quickdownload's Issues

Qml module not found.

Installed the package with qpm:

E:\Users\Me> qpm install com.blackgrain.qml.quickdownload
INFO: Package com.blackgrain.qml.quickdownload has a different license (MIT) than it's dependant (NONE).
Installing [email protected]

And added an import:

import com.blackgrain.qml.quickdownload 1.0

However, Qt Designer can't find the package:

qrc:/main.qml:3:1: module "com.blackgrain.qml.quickdownload" is not installed

Multiple dynamic downloads

Hi @larpon, I just came across this project and was wondering something. So in my application the user needs to download multiple files: the user clicks a button and the download starts, the user clicks the button again and a new download starts again (up to 15 times). Now would this be possible with your plugin? I see that you need instantiate a Download class in QML for each download, but how can I dynamically generate a Download each time I need it? Something like

Button{
    function downloadSomething(url)
    {
    // how to create a Download dynamically???
    }
    id: button
    onClicked: downloadSomethingNew(webview.url)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.