Results 1 to 8 of 8

Thread: Drag and Drop PDFs

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drag and Drop PDFs

    The drag and drop demo only returns a mime-type of text/uri-list regardless of what I drop into it.

    Any ideas/comments?

  2. #2
    Join Date
    Jan 2006
    Location
    Frankfurt, Germany
    Posts
    34
    Thanks
    3
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Drag and Drop PDFs

    That's ok, look here:
    http://www.ip97.com/phpgtk/tutorials...d.urilist.html

    here (linux, kde) there's also a text/plain format included.

  3. The following user says thank you to kiker99 for this useful post:

    kroenecker (3rd July 2006)

  4. #3
    Join Date
    Jan 2006
    Posts
    75
    Thanks
    8
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Drag and Drop PDFs

    I'm getting closer. I found that uri-list basically is a description of where the dropped file is located. When using mimetypes, the member function urls will return a qlist from which I can get the individual urls of all the files. I'm using QUrl::toLocalFile(). Then I can grab the file and do what I want with it.

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

    Default Re: Drag and Drop PDFs

    If you drag a file from your desktop or file manager, you'll always get the uri-list mime, regardless of the file type. If you want to get the file as application/pdf, the application you drag from has to offer the file in pdf format (meaning that it has to be able to read and maybe also write pdf files) -- like pdf readers. For example my pdf viewer (Kpdf) doesn't support dragging, so it can't offer application/pdf.

  6. The following user says thank you to wysota for this useful post:

    kroenecker (6th July 2006)

Similar Threads

  1. Drag & drop with model/view (Qt4)
    By yogeshm02 in forum Qt Programming
    Replies: 16
    Last Post: 19th September 2011, 20:36
  2. Drag and drop outside the application
    By jpn in forum Newbie
    Replies: 7
    Last Post: 27th August 2006, 15:37
  3. Drag and drop revisited
    By Big Duck in forum Newbie
    Replies: 2
    Last Post: 30th June 2006, 16:41
  4. Drag & drop for QTreeView
    By yogeshm02 in forum Qt Programming
    Replies: 2
    Last Post: 30th January 2006, 14:32
  5. Drag 'n Drop problem
    By kiker99 in forum Qt Programming
    Replies: 4
    Last Post: 16th January 2006, 16:35

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
  •  
Qt is a trademark of The Qt Company.