Results 1 to 4 of 4

Thread: Qprocess MAC OSX - Open Finder path xx & Open firefox arg url...

  1. #1
    Join Date
    May 2006
    Posts
    788
    Thanks
    49
    Thanked 48 Times in 46 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question Qprocess MAC OSX - Open Finder path xx & Open firefox arg url...

    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 

  2. #2
    Join Date
    Feb 2006
    Location
    France
    Posts
    50
    Thanked 2 Times in 2 Posts
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qprocess MAC OSX - Open Finder path xx & Open firefox arg url...

    I can translate your project to french if u want.

    Contat me on pasnox@gmail.com.

    P@sNox,

  3. The following user says thank you to pasnox for this useful post:

    patrik08 (29th June 2006)

  4. #3
    Join Date
    Jan 2006
    Location
    Mountain View, CA
    Posts
    279
    Thanked 42 Times in 37 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qprocess MAC OSX - Open Finder path xx & Open firefox arg url...

    Quote Originally Posted by patrik08
    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.
    Use the OSX "open" command, e.g:

    process.start("open", QStringList() << "x:\path\xx\");
    process.start("open", QStringList() << url);

    Both will open the directory file/path with the correct application respectively. In this case that will be the Finder and the default web browser.

    To specifically use Firefox, you can use "open -a", e.g:
    process.start("open", QStringList() << "-a" << "Firefox" << url);
    Last edited by Chicken Blood Machine; 29th June 2006 at 18:31.
    Save yourself some pain. Learn C++ before learning Qt.

  5. The following 2 users say thank you to Chicken Blood Machine for this useful post:

    gaddlord (25th August 2010), patrik08 (29th June 2006)

  6. #4
    Join Date
    Aug 2010
    Posts
    4
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Qprocess MAC OSX - Open Finder path xx & Open firefox arg url...

    What about Q_WS_X11? how we can open a folder in the default Linux "explorer"?

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.