dmateer
9th June 2010, 22:09
The recommended way (http://doc.qt.nokia.com/4.6/assistant-custom-help-viewer.html) 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:
QStringList args;
args << QLatin1String("-collectionFile")
<< helpPath_
<< QLatin1String("-enableRemoteControl");
#ifdef Q_WS_MAC
QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/Assistant.app/Contents/MacOS/Assistant");
#else
QString app = QLatin1String("assistant");
#endif
process_->start(app, args);
process_->waitForStarted();
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.
QStringList args;
args << QLatin1String("-collectionFile")
<< helpPath_
<< QLatin1String("-enableRemoteControl");
#ifdef Q_WS_MAC
QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QLatin1String("/Assistant.app/Contents/MacOS/Assistant");
#else
QString app = QLatin1String("assistant");
#endif
process_->start(app, args);
process_->waitForStarted();
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.