Results 1 to 3 of 3

Thread: Launching Qt Assistant from code on Mac

  1. #1
    Join Date
    May 2010
    Posts
    9
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Launching Qt Assistant from code on Mac

    The recommended way of launching Qt Assistant as a custom help viewer is to start a process. The example on that page works great for Linux, but how does one achieve this on Mac, where the Qt Assistant is in an app bundle? Right now I am doing this:

    Qt Code:
    1. args << QLatin1String("-collectionFile")
    2. << helpPath_
    3. << QLatin1String("-enableRemoteControl");
    4.  
    5. #ifdef Q_WS_MAC
    6. QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/Assistant.app/Contents/MacOS/Assistant");
    7. #else
    8. QString app = QLatin1String("assistant");
    9. #endif
    10.  
    11. process_->start(app, args);
    12. process_->waitForStarted();
    To copy to clipboard, switch view to plain text mode 

    This is working, but seems very hackish and fragile to me. Is there a cross-platform way of doing this? If not, is that the recommended way of launching an application within an app bundle as a process? Is the internal folder structure of a Mac app bundle stable?

    Thanks for any pointers.

  2. #2
    Join Date
    Aug 2009
    Posts
    23
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Launching Qt Assistant from code on Mac

    "open Assistant.app" ? however i don't know how to pass arguments to Assistant in that case (man open)

  3. #3
    Join Date
    May 2010
    Posts
    9
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Launching Qt Assistant from code on Mac

    Well, I gave that a try, but the QProcess doesn't seem to "hang on," so the remote control commands get orphaned. I tried using the -W parameters as well, but it didn't make a difference.

Similar Threads

  1. Problems launching a windows exe from Qt (using QProcess)
    By smacchia in forum Qt Programming
    Replies: 8
    Last Post: 21st March 2012, 11:05
  2. Segmentation fault after Launching Qt app
    By payal in forum Qt Programming
    Replies: 2
    Last Post: 3rd March 2010, 20:05
  3. Launching a PDF in platform independant way
    By JPNaude in forum Qt Programming
    Replies: 2
    Last Post: 30th September 2008, 20:04
  4. Launching external web browser from within Qt App
    By JimDaniel in forum Qt Programming
    Replies: 1
    Last Post: 31st October 2007, 19:22
  5. Launching problem
    By Salazaar in forum Newbie
    Replies: 5
    Last Post: 29th October 2007, 12:18

Tags for this Thread

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.