Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple dynamic downloads #6

Closed
daljit97 opened this issue Jul 21, 2019 · 3 comments
Closed

Multiple dynamic downloads #6

daljit97 opened this issue Jul 21, 2019 · 3 comments

Comments

@daljit97
Copy link

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)
}
@larpon
Copy link
Owner

larpon commented Jul 21, 2019

Hi @daljit97 - nice if you can find use for this project 🙂

One solution would be to create Download elements on the fly with dynamic object creation.

Maybe wrap the functionality up in a DownloadManager QML type that connects to each new download's signals and keep internal track of who's done etc.

That's one way to do it 🤔🙂

@daljit97
Copy link
Author

@larpon yeah I thought about using components as well. Your idea about constructing a DownloadManager seems nice although I need to check how long will that take. Thanks a lot for your input.

@larpon
Copy link
Owner

larpon commented Jul 22, 2019

No problem 🙂 Happy coding!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants