Results 1 to 11 of 11

Thread: Starting assistant from command line

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2007
    Posts
    9
    Thanked 4 Times in 1 Post

    Unhappy Starting assistant from command line

    Hello,

    I find myself too often switching between my editor of choice and the assistant. Is it possible to do something like :

    > assistant -index QScrollBar

    which could open the assistant and find the given word (QWidget in this case) in the index.

    Is this possible (or anything in this direction would also help) ?

    Thanks.

    MDE

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Starting assistant from command line

    see "assistant -help"

  3. #3
    Join Date
    Feb 2007
    Posts
    9
    Thanked 4 Times in 1 Post

    Default Re: Starting assistant from command line

    Well, of course I did. Am I missing something here ?

    Usage: assistant [option]
    Options:
    -file Filename assistant opens the specified file
    -server reads commands from a socket after
    assistant has started
    -profile fileName starts assistant and displays the
    profile specified in the file fileName.
    -addContentFile file adds the content file 'file' to the set of
    documentation available by default
    -removeContentFile file removes the content file 'file' from the
    documentation available by default
    -docPath path sets the Qt documentation root path to
    'path' and starts assistant
    -hideSidebar assistant will hide the sidebar.
    -resourceDir assistant will load translations from
    this directory.
    -help shows this help.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Starting assistant from command line

    Two first options are important. The first one loads a specified file and the other turns assistant into a server which you can send commands to, including the thing you want to achieve. Unfortunately I haven't seen the command list anywhere in the docs, so you'd have to look into the sources.

    Edit: Ok, looks like the command name is the page name you wish to open.
    Last edited by wysota; 21st March 2007 at 09:58.

  5. #5
    Join Date
    Feb 2007
    Posts
    9
    Thanked 4 Times in 1 Post

    Default Re: Starting assistant from command line

    Thanks wysota. Obviously the command doc and (in my case) a small executable which can talk to assistant is missing.

    I looked into building a small app which uses the QAssistantClient. but it doesn't seem trivial . Unfortunately I have got real work to do

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Starting assistant from command line

    Why not trivial? I think it should be quite simple.

  7. #7
    Join Date
    Feb 2007
    Posts
    9
    Thanked 4 Times in 1 Post

    Default Re: Starting assistant from command line

    The QAssistantClient::showPage method is asking for a html page filepath. All I need is to get assistant to show the page for say QWidget.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Starting assistant from command line

    I don't see a problem...

  9. #9
    Join Date
    Feb 2007
    Posts
    9
    Thanked 4 Times in 1 Post

    Unhappy Re: Starting assistant from command line

    Let me help you There are two problems right now:

    1. Getting assistant to get to the right page, showPage needs an html file path, like:

    ac.showPage( qtdir + "/doc/html/" + phrase.toLower() + ".html" );

    This means getting assistant locating a phrase like "setClipping" is not possible. Index searching can not be done remotely

    2. Everytime a new QAssistantClient is created, a new assistant process is forked. Not really cool.

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Starting assistant from command line

    Quote Originally Posted by mderdem View Post
    1. Getting assistant to get to the right page, showPage needs an html file path, like:

    ac.showPage( qtdir + "/doc/html/" + phrase.toLower() + ".html" );

    This means getting assistant locating a phrase like "setClipping" is not possible. Index searching can not be done remotely
    If you want to search by method name, you can do one of two things:
    a) locate assistant's index file and do the search yourself there
    or
    b) use CTags or a simmilar method to build your own index file and then you can quickly find the proper class for a method and ask assistant to fetch it.

    2. Everytime a new QAssistantClient is created, a new assistant process is forked. Not really cool.
    So don't start a new QAssistantClient but instead reuse the old one.

  11. #11
    Join Date
    Feb 2007
    Posts
    9
    Thanked 4 Times in 1 Post

    Default Re: Starting assistant from command line

    Thanks for the ideas. Obviously you are not bounded by the time limitations I suffer from.

    What you offer is certainly doable. But the purpose is to reuse the assistant and it's features. It would be easier to write a macro in my editor which does a grep and prepares a list of html files and let's me pick one of them.

Similar Threads

  1. Qt Assistant path
    By aamer4yu in forum Installation and Deployment
    Replies: 3
    Last Post: 1st February 2007, 14:23
  2. Replies: 1
    Last Post: 18th July 2006, 12:06
  3. Qt assistant under linux
    By jochen_r in forum Newbie
    Replies: 8
    Last Post: 10th January 2006, 08:39

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.