CPP-Reference in Kdevelop

Hello everyone, I’m working with Kdevelop 5.12.230805. As soon as I hover the mouse over for example cout in the editor, the documentation for “cout” appears in a window. The same works for string, for example. But not for other keywords such as while, return, char, etc.
However, the file cppreference-doc-en-cpp.qch is located under /usr/share/qt5/doc/, as are all other Qt-related files. Solution?
Tnx for an answer!

Hi everyone,

I stumbled across the solution to my own post from December 2024: Place the cursor on a keyword (e.g., return), then press Ctrl+Alt+D. A window with a selection will open. Scroll to “return” and press Enter. The corresponding documentation will then be displayed. Of course, this requires that cppreference-doc-en-cpp.qch is included in KDevelop.
Greatings

Hi,

The hovering works only for user defined types (that includes all STL types). Keywords and language defined types aren’t available that way.

A second condition is that the keyword has to be in the QCH index, otherwise the automatic finding won’t work. For instance, we recently discovered that none of the STL Concepts are in the index, so the documentation for those won’t work.

You may check the index by loading the QCH into Qt Assistant and browsing the documentation there.

I’d recommend putting the cppreference QCH somewhere in your home (I have a ~/docs) and configuring kdevelop (Settings → Documentation → Qt Help) to use that file. Files in /usr may be overwritten/removed by your package manager.

Thank you very much for your advise. My solution is to put the cursor on a keyword (for example int) and press Ctrl+Alt+d. After that I see the documentation in cpp-reference of int.

Hi bednar, tnx for your statement. But it works with (most) keywords too: Put the cursor for example on “float”, then press Ctrl+Alt+d. After that a window will open with a lot of token (beginning with “float…”). If you scroll down, you’ll see “float”. A click on it will open the cpp-reference with the explantion of the keyword “float”. Best regards Michael