Results 1 to 3 of 3

Thread: AssistantClient - Qt4.4

Threaded View

Previous Post Previous Post   Next Post Next Post
  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

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
  •  
Qt is a trademark of The Qt Company.