Results 1 to 19 of 19

Thread: open a file

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Posts
    201
    Thanks
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: open a file

    for the file, I never know what the user saves,

    It could be pdf, odt, dwg? So I dont know the program, any way to do it withour writing the program.

  2. #2
    Join Date
    Aug 2006
    Posts
    221
    Thanks
    3
    Thanked 29 Times in 19 Posts

    Default Re: open a file

    For what os do you write the program? Windows? Linux?

  3. #3
    Join Date
    Jan 2007
    Posts
    201
    Thanks
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: open a file

    windows xp ...

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: open a file

    then try to use ShellExecute or ShellExecuteEx.

  5. #5
    Join Date
    Oct 2008
    Posts
    37
    Thanked 2 Times in 2 Posts

    Default Re: open a file

    If you're trying to open files in their respective applications, you might want to take a look at
    openUrl in the QDesktopServices class:

    Qt Code:
    To copy to clipboard, switch view to plain text mode 

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

    aekilic (28th October 2008)

  7. #6
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: open a file

    Quote Originally Posted by chaoticbob View Post
    If you're trying to open files in their respective applications, you might want to take a look at
    openUrl in the QDesktopServices class:

    Qt Code:
    To copy to clipboard, switch view to plain text mode 
    yep, it will work too.

  8. The following user says thank you to spirit for this useful post:

    aekilic (28th October 2008)

  9. #7
    Join Date
    Jan 2007
    Posts
    201
    Thanks
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: open a file

    tried this

    Qt Code:
    1. QUrl my_url;
    2. my_url = QUrl::fromLocalFile(tmpFile->fileName());
    3. QDesktopServices::openUrl(my_url);
    To copy to clipboard, switch view to plain text mode 

    didnt work...

  10. #8
    Join Date
    Jan 2007
    Posts
    201
    Thanks
    22
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: open a file

    Dear all thank you very much, I have just understand I made a mistake for the QUrl

    Thank you very much again...

Similar Threads

  1. Replies: 5
    Last Post: 29th October 2007, 22:49
  2. open large file in qt?
    By vishal.chauhan in forum Qt Programming
    Replies: 11
    Last Post: 29th May 2007, 07:25
  3. qt-3.3.8 fail in scratchbox
    By nass in forum Installation and Deployment
    Replies: 0
    Last Post: 25th May 2007, 15:21
  4. Restrict user to open the same file
    By vermarajeev in forum General Programming
    Replies: 33
    Last Post: 25th May 2007, 08:15
  5. How to open a Pdf file from Qt
    By vishal.chauhan in forum Newbie
    Replies: 2
    Last Post: 28th March 2007, 08:24

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.