Results 1 to 3 of 3

Thread: Initiate file download on drag from between models

  1. #1
    Join Date
    Oct 2008
    Posts
    71
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Initiate file download on drag from between models

    Hi

    In my application I have two views, one shows Local QDirModel, the other shows my custom Remote model presenting a bunch of files, downloadable from internet - each file in the model has a corresponding download link.

    Now I want to be able to grab an item from the view presenting the Remote model and drop in in the view presenting the Local model. On this event I want to download the remote file and save it locally in the corresponding folder.

    What is the most appropriate way to implement this?

    Should I subclass QDirModel and reimplement QAbstractItemModel::dropMimeData? Or is there another, nicer way to accomplish this?

    Thanks
    Anton

  2. #2
    Join Date
    Oct 2008
    Posts
    71
    Thanks
    6
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Re: Initiate file download on drag from between models

    I'm sorry for impatience, but is it something complicated?

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Initiate file download on drag from between models

    Yes, you should reimplement dropMimeData. This might come in handy as well: [wiki]Extended Dir View example[/wiki].
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Drag and Drop QTableWidget in UI file.
    By tpf80 in forum Qt Programming
    Replies: 3
    Last Post: 20th January 2009, 23:02
  2. NEED HELP: How to download file without breaking function
    By codeslicer in forum Qt Programming
    Replies: 10
    Last Post: 22nd April 2008, 04:10
  3. Drag & Drop: delayed file delivery (Win & Mac)
    By Conel in forum Qt Programming
    Replies: 3
    Last Post: 19th September 2007, 16:01
  4. How to download any file through ftp server
    By thomasjoy in forum Qt Programming
    Replies: 1
    Last Post: 24th July 2007, 01:23
  5. QHttp download file problem.
    By fengtian.we in forum Qt Programming
    Replies: 12
    Last Post: 12th June 2007, 09:39

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.