[Qt-interest] Qt Assistant in god-mode? (Simple Text Viewer Example)
BRM
bm_witness at yahoo.com
Tue Mar 22 18:56:32 CET 2011
Your code snippet does not have any error checking other than if the process
failed to start.
In this case, it succeeded in starting but didn't have a valid file to load;
thereby your app worked as designed but not as expected.
Ben
----- Original Message ----
> From: "slayer81 at gmx.de" <slayer81 at gmx.de>
> To: qt-interest at trolltech.com
> Sent: Tue, March 22, 2011 12:37:05 PM
> Subject: [Qt-interest] Qt Assistant in god-mode? (Simple Text Viewer Example)
>
> Hello Qt people :)
>
> I adapted the SimpleTextViewer example, where a help file collection is
>started by spawning a QProcess running Qt Assistant.
> Link: http://doc.qt.nokia.com/4.7-snapshot/help-simpletextviewer.html
>
> When passing a non-existent help file as argument to Qt Assistant, it shows a
>error message, but QProcess does _not_ exit.
>
> I wonder why that's the case, because the following lines in application.cpp
>(see commented code snippet) seem to check that error, dont they?
>
> <<<<<<<<<<<<<<<< application.cpp (bool startAssistant)<<<<<<<<<<<<<<<<
> QStringList args;
> args << QLatin1String("-collectionFile")
> << QLibraryInfo::location(QLibraryInfo::ExamplesPath)
> +
>QLatin1String("/help/simpletextviewer/documentation/simpletextviewer.qhc")
> << QLatin1String("-enableRemoteControl");
>
> /* call with wrong collection file argument ... */
> proc->start(app, args);
>
> /* ... and proc will be in state QProcess::Running ... */
> if (!proc->waitForStarted()) {
> /* ... therefore you'll not see this message box (in this case)
>*/
> QMessageBox::critical(0, QObject::tr("Simple Text Viewer"),
> QObject::tr("Unable to launch Qt Assistant (%1)").arg(app));
> return false;
> }
> <<<<<<<<<<<<<<<<
>
> Doesnt change when calling with option "quiet".
> I currently use Qt 4.6.3 on Windows 7.
>
> Cheers,
> Paule
> --
> NEU: FreePhone - kostenlos mobil telefonieren und surfen!
> Jetzt informieren: http://www.gmx.net/de/go/freephone
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest
>
More information about the Qt-interest-old
mailing list