to open a path on explorer.exe is running so:
process.start("explorer.exe", QStringList() << "x:\path\xx\");
and running
and to open browser + url runnig to on window...
process.start(browser, QStringList() << url); /* browser is the full path to exe */

But /Applications/Firefox.app + url is a path....
How i can open firefox + url and finder + url? on qprocess....
Thanks in advance of every answer.


Qt Code:
  1. void Tab_Oggetto::OpenPath()
  2. {
  3. /* apri cartella pathfileroot */
  4. QString xapri = pathfileroot;
  5. xapri.replace(QString("/"),"\\");
  6. qDebug() << "### pathfileroot " << xapri;
  7. #if defined(Q_WS_WIN)
  8. QProcess process;
  9. process.setReadChannelMode(QProcess::MergedChannels);
  10. process.start("explorer.exe", QStringList() << xapri);
  11. if (!process.waitForFinished()) {
  12. QMessageBox::information( this, tr( "Errore del sistema operativo" ),tr("Explorer non risponde. Aggiornate Window update! Errore ritornato %1").arg(process.errorString()));
  13. } else {
  14. qDebug() << "### reade " << process.readAll();
  15. }
  16. #endif
  17. }
  18.  
  19. void Tab_Oggetto::OpenBrowserPath()
  20. {
  21. /* pref_browser http://wellson.ciz.ch/webdav/ */
  22. QString browser = Global_Config(APPLICATION_SETTING,"pref_browser");
  23. QString url = WWW_DOMAIN_USER + PATH_OGGETTI_HTML + QString::number(UNIXTIMEDIR) + "/it/";
  24.  
  25. qDebug() << "### browser " << browser;
  26. qDebug() << "### url " << url;
  27. if (browser.size() < 3) {
  28. QMessageBox::information( this, tr( "Informazione Browser." ),tr("Non avete ancora configurato un Applicativo Browser nelle preferenze!"));
  29. } else {
  30. QProcess process;
  31. process.setReadChannelMode(QProcess::MergedChannels);
  32. process.start(browser, QStringList() << url);
  33. if (!process.waitForFinished()) {
  34. QMessageBox::information( this, tr( "Errore del browser!" ),tr("Il programma Browser configurato risponde con un errore ... %1").arg(process.errorString()));
  35. } else {
  36. qDebug() << "### reade " << process.readAll();
  37. }
  38. }
  39.  
  40. }
To copy to clipboard, switch view to plain text mode