tonka3000 / vscode-qt-tools

Qt tools extension for Visual Studio Code
MIT License
41 stars 10 forks source link

Can I use qt assistant like that in Qt Creator? #62

Open playgithub opened 3 years ago

playgithub commented 3 years ago

e.g. Press F1 to show help for the keyword under cursor

tonka3000 commented 3 years ago

Hi @playgithub ,

do you mean something like?

image

This is already built-in, but I have a small bug, so it don't use the selected word. But I could ship a fix for that. Right now it don't use the word where cursor is, only an active selection.

Using the word directly in Qt Assistant was my first idea, but I could not find a solid way to call assistant with the correct command line arguments to get correct results. If you know how I can correctly pass the arguments (without knowing the full path + version) I would add this feature.

playgithub commented 3 years ago

Hi @playgithub ,

do you mean something like?

Yes, Qt Assistant as an external windows.

image

This is already built-in, but I have a small bug, so it don't use the selected word. But I could ship a fix for that. Right now it don't use the word where cursor is, only an active selection.

Using the word directly in Qt Assistant was my first idea, but I could not find a solid way to call assistant with the correct command line arguments to get correct results. If you know how I can correctly pass the arguments (without knowing the full path + version) I would add this feature.

I'm new about this, the doc seems relevant: https://doc.qt.io/qt-5/assistant-custom-help-viewer.html#using-qt-assistant-remotely

tonka3000 commented 3 years ago

I'm aware of that section in the docs. The problem is the url I have to generate.

ba.append("setSource qthelp://com.mycompany.1_0_0/doc/index.html\n");

I also tried to set the search keyword, but it never worked.

playgithub commented 3 years ago

Have activateKeyword been tried?

QByteArray ba;
ba.append("activateKeyword <Keyword>");
process->write(ba);
Command Brief Description
activateKeyword Inserts the specified into the line edit of the index dock widget and activates the corresponding item in the index list. If such an item has more than one link associated with it, a topic chooser will be shown.