octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: opening unknown file types in external applications


From: Torsten
Subject: Re: opening unknown file types in external applications
Date: Tue, 23 Apr 2013 20:58:16 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130329 Thunderbird/17.0.5

On 23.04.2013 19:53, John W. Eaton wrote:
> The following change allows a double click on a data file in the file
> browser to load the file into the Octave workspace instead of opening
> it in the editor.
> 
>   http://hg.savannah.gnu.org/hgweb/octave/rev/04fb96f4bea1
> 
> All other files are still opened in the editor.  That's great for text
> files, but not so good for PDF files.
> 
> What I'd like to do now is recognize text files and open them in the
> editor, but ask the OS or desktop environment to open all other files
> in an appropriate external application.  Is there some more or less
> standard way of doing that?

This one should do the job:

QDesktopServices::openUrl (
   QUrl::fromLocalFile ( const QString & localFile )
);

http://qt-project.org/doc/qt-4.8/qdesktopservices.html#openUrl

Torsten



reply via email to

[Prev in Thread] Current Thread [Next in Thread]