Well, creating QML UIs should work very similarly to the web windows. If you look at marketplace.js you’ll see that the JS does very little other than create an OverlayWebWindow and a toolbar to manage the window’s visibility.
I can create another script flockOfFish.js that does almost the exact same thing, but using an OverlayWindow instead of an OverlayWebWindow. The
source URL that I pass to the window points to QML content, rather than HTML content. Specifically it points at this QML document I’ve created.
Inside that QML I create a layout of controls… a background rectangle, a small red rectangle in the upper left corner, a label with some text and a button. The button itself is wired up to add a new short-lived box entity near the origin when clicked. Note that the Entitity interface is being called almost in exactly the same way it would be in a script. The important difference here is that I’m calling
addEntity2 function doesn’t exist in the public client, so the button won’t work for you if you attempt this (in fact in writing up this demo I’ve discovered and fixed several bugs related to loading QML over the network and into an OverlayWindow, so much of this might not work).
Eventually, all the script interfaces that are available in pure JS scripts should be available in QML interfaces as well. QML itself is perfect for creating rich responsive user interfaces, containing lots of basic control types and has lots of functionality for devising new types as well as customizing the look and feel of the UI.
Here’s a short video on creating QML UI…