Results 1 to 3 of 3

Thread: How to open a Pdf file from Qt

  1. #1
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Question How to open a Pdf file from Qt

    Hi All,

    I m using Qt 4.2.2 on my Intel Mac.

    I have a PDF file in the Resource File and I have a Button on ToolBar say Open.
    What I want is that when I click the Open button the PDF file Should be open in its default application Preview in case of Mac.

    If anybody knows then plz help me.

    Thanks.

  2. #2
    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: How to open a Pdf file from Qt

    I don't think you can open a file from a resource using the default system handler. You'd have to extract the file to a real file first and then use QDesktopServices::openUrl.

  3. The following 2 users say thank you to wysota for this useful post:

    sindy (21st March 2013), vishal.chauhan (28th March 2007)

  4. #3
    Join Date
    Dec 2006
    Posts
    211
    Thanks
    27
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: How to open a Pdf file from Qt

    Thnaks.

    Yes Now I m able to do that.
    Last edited by vishal.chauhan; 28th March 2007 at 08:30.

Similar Threads

  1. Replies: 3
    Last Post: 7th October 2015, 19:43
  2. QDesktopServices open url & local file & pdf or doc
    By patrik08 in forum Qt Programming
    Replies: 9
    Last Post: 14th April 2012, 04:42
  3. Sending Binary File with QFTP
    By nbkhwjm in forum Newbie
    Replies: 2
    Last Post: 7th March 2007, 18:10
  4. Qt 4.1.4 on VS2005 error- cannot open input file 'qtmain.lib'
    By Ashish in forum Installation and Deployment
    Replies: 10
    Last Post: 11th October 2006, 16:05
  5. QProcess open all file -> url.dll,FileProtocolHandler
    By patrik08 in forum Qt Programming
    Replies: 2
    Last Post: 26th June 2006, 17:07

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.