This is the beginning of BSA’s property editor. A property editor is a specialized grid that can edit objects and is very common in dveloper tools. Rather than produsing hundreds of IO diialogs you use a generic editor that you pass a list of variables. The way this will work is that it show the properties for the visual component you have selected. Having one of these in your arsenal is a powerfully tool in many applications.
Doing this in QML provided some learnings – firstly I have done this in more classic GUI solutions and you have to think completely different with QML. But, it was actually very easy to do this thought it represent a bit of work. The common trick is to use the standard edit components located in the cells at right, but I got a surprice…
I have a DataGrid as well and for each cell I added all edit controls and just made the one I used visible – big mistake – QML handled it, but starting the grid became slow because you multiply the number of components that needs to be initialized by 3 dimensions. While the GPU’s make everything look easy and you can get away with a lot of stupid code – you also must be very aware that there are limits. And one of the is how you pass information between GPU and CPU. If I create my grid large enought it will not load at all and as it grows it uses more time to grow.
My aproach is simple – I am still learning so it is try and fail – in this case I added logic so it only create the components it used + I am very well aware that my DataGrid with inline edit only can handle a limited number of columns and rows, so I can’t use this for massive data visualization – but, that is ok because it will typically be a few columns and rows – my grid handle thousands if I must – which is more than sufficient for this type of usage.
If I ever need to have in-line edit on even larger datagrids I will need to add logic to minimalize the number of components I throw into the GPU. QML actually have a build in mechanism for this that I will be using for Real-Time visualization components. But, it is a bit of work to set this up properly.
The property editor will take me a few days to get right, but it is one of the most important building blocks in BSA itself.