Before QDesktopServices qt4.2 i use this function to open explorer file url & other mailto:xxx ecc....
/* open file browser explorer finder pdf doc ecc... url mail ecc on other programm */
void Base_Function
::OpenUrl_File_Dir_Dektop( QString item
) {
#if defined(Q_WS_WIN)
s << "url.dll,FileProtocolHandler" << item;
p.
startDetached(QString("rundll32.exe") , s
);
#endif
#if defined Q_WS_MAC
macs << item; /* oeffnet der default browser */
m.
startDetached(QString("open") , macs
);
/* open file weburl .... finder e other */ #endif
}
/* open file browser explorer finder pdf doc ecc... url mail ecc on other programm */
void Base_Function::OpenUrl_File_Dir_Dektop( QString item )
{
#if defined(Q_WS_WIN)
QProcess p;
QStringList s;
s << "url.dll,FileProtocolHandler" << item;
p.startDetached(QString("rundll32.exe") , s );
#endif
#if defined Q_WS_MAC
QProcess m;
QStringList macs;
macs << item; /* oeffnet der default browser */
m.startDetached(QString("open") , macs ); /* open file weburl .... finder e other */
#endif
}
To copy to clipboard, switch view to plain text mode
Now QDesktopServices open only Url http:/..... or mail to ....
& !not open file pdf or doc or other same as up write function....
wath is the location of QDesktopServices to expand this class? and Add other url different as http://
but now QDesktopServices is super to open url on linux.... method "open" exist only on mac...
#include <QDesktopServices>
#define HOME_DIR_YOUR \
QUrl youhome
(HOME_DIR_YOUR
);
/* filee path not open */ QUrl youhome1
("http://www.qtcentre.org/forum/");
/* running open browser*/
#include <QDesktopServices>
#define HOME_DIR_YOUR \
QString( "%1/ale.png" ).arg( QDir::homePath())
QUrl youhome(HOME_DIR_YOUR); /* filee path not open */
QUrl youhome1("http://www.qtcentre.org/forum/"); /* running open browser*/
QDesktopServices::openUrl (youhome);
To copy to clipboard, switch view to plain text mode
Bookmarks