

The “menu at the top of the screen” is just one possible visualization.
Essentially an application that supports this can “export” its menu so that it can be consumed by another process.
In the case of the “global menu” this is Plasma (applet).
However, the data can also be consumed for example by a window decoration plugin, like this one https://discuss.kde.org/t/decoration-with-locally-integrated-menu/29492
There are likely many more possibilities. Maybe a Kwin effect that shows the menu as a circle of options around the mouse cursor’s current position.
Probably just replacing “KF5” with “KF6” in the cmake file and changing the version from “5.90” to something like “6.0” (or higher)