Results 1 to 3 of 3

Thread: AssistantClient - Qt4.4

  1. #1
    Join Date
    Oct 2006
    Location
    Bangalore
    Posts
    32
    Qt products
    Qt4
    Platforms
    Windows

    Question AssistantClient - Qt4.4

    Hi,

    I am working in Qt4.4.

    I am trying to show a custom html page in Qt's Assistant.

    As per information in Qt Assistant, I am using QProcess to achieve the same.
    when I try to show some html page, I get this standard 404 - "The page could not be found" error after assistant gets launched.

    The html page I am trying to show is existing for sure in the path given to "SetSource".

    Following is the code. I am not sure what am I missing here.
    As a matter of fact, I get this page not found error if I try to load an html page from Qt's Assistant documentation for example,
    path = "C:/Qt/4.4.0/doc/html/templates.html".

    Please let me know whats wrong with my code ...

    Can anyone pls tell me also, if it is possible to add my application specific help contents to the existing help contents in the Qt Assistant?
    For Ex:
    "Qt Assistant Manual"
    " QMake Manual"
    ......
    "MyApplication Manual"

    Kindly Let me know.

    Qt Code:
    1. void MainWindow::showHelp()
    2. {
    3. // Check if assistent is already running
    4. if (d->process->state() == QProcess::Running)
    5. return;
    6.  
    7. // start the process bt giving assistent path as argument
    8. QString app = QLibraryInfo::location(QLibraryInfo::BinariesPath) + QDir::separator();
    9. #if !defined(Q_OS_MAC)
    10. app += QLatin1String("assistant");
    11. #else
    12. app += QLatin1String("Assistant.app/Contents/MacOS/Assistant");
    13. #endif
    14.  
    15. args << QLatin1String("-enableRemoteControl");
    16.  
    17. // Launch the assistant
    18. d->process->start(app, args);
    19.  
    20. if (!d->process->waitForStarted())
    21. {
    22. QMessageBox::critical(this, tr("Remote Control"),
    23. tr("Could not start Qt Assistant from %1.").arg(app));
    24.  
    25. return;
    26. }
    27.  
    28. // Show the desired page : THE PROBLEM IS HERE
    29. QString command = QLatin1String("SetSource ") + "C:/demos/temp.html";
    30. sendCommand(command);
    31. }
    32.  
    33. void MainWindow::sendCommand(const QString &cmd)
    34. {
    35. if (d->process->state() != QProcess::Running)
    36. return;
    37. if (!d->process->isWritable() || d->process->bytesToWrite() > 0)
    38. {
    39. QMessageBox::information(this,"ERROR","Unable to send request: Assistant is not responding.");
    40. return;
    41. }
    42.  
    43. QTextStream str(d->process);
    44. str << cmd << QLatin1Char('\0') << endl;
    45. return;
    46. }
    To copy to clipboard, switch view to plain text mode 

    Best Regards
    Last edited by jpn; 15th May 2008 at 11:15. Reason: missing [code] tags

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: AssistantClient - Qt4.4

    I guess you look at "Simple Text Viewer" example in the Qt Demo... it uses the QAssistantClient class.
    You will find the example in examples/assistant directory of ur Qt installation.

    Hope this helps

  3. #3
    Join Date
    Oct 2006
    Location
    Bangalore
    Posts
    32
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: AssistantClient - Qt4.4

    Hi,
    Sadly, simpleTextViewer example doesn't show anything when Help->Help Contents is triggered. Actually , it internally calls showpage() of assistantclient to show simpleTextViewer's index.html

    Here, I am quoting the information provided in Qt Assistant for QAssistantClient class.

    "The QAssistantClient class provides a means of using Qt Assistant as an application's help tool.
    Note: This class is obsolete and only required when using the old Qt Assistant, now called assistant_adp. If you want to use the new Qt Assistant as a remote help viewer, simple create a QProcess instance and specify assistant as its executable. "


    The code pasted by me in my question is almost copy paste of the other Qt Example
    examples\help\remotecontrol.

    My Problem or my Questions remain same:
    1. How can I show other HTML pages in Qt Assistant? I am already using "SetSource " and the html path which is not working as explained in my last qn.

    2. How can I add to the contents of Qt Assistant , My application help contents, If at all its possible

    Best Regards

Similar Threads

  1. phonon on QT4.4
    By coolk in forum Installation and Deployment
    Replies: 15
    Last Post: 15th January 2009, 13:38
  2. Qt4.4 QSsl Won't Compile with MSVC2008
    By Surye in forum Installation and Deployment
    Replies: 2
    Last Post: 9th May 2008, 17:52
  3. Qt4.4 On Mac
    By coolk in forum Installation and Deployment
    Replies: 3
    Last Post: 1st April 2008, 22:08
  4. Qt4.4 binaries for windows
    By mm in forum Installation and Deployment
    Replies: 3
    Last Post: 13th February 2008, 20:55

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.