In a Qt5 project written with Visual Studio 2019, I have to communicate very closely with several qml properties, from a c++ class. More exactly I need to be able to change the x, y, width and height properties of a qml window from my c++ class, and I also need to receive a notification, and of course know the new value, when these properties changed.

By writing a part of the code on the qml side, I could find the below solution:

qml file:

```js
...
ApplicationWindow
{
    id: mainWindow
    ...
    onXChanged: {if (mfMainFormHelper) mfMainFormHelper.onFormXChanged(mainWindow.x);}
    onYChanged: {if (mfMainFormHelper) mfMainFormHelper.onFormYChanged(mainWindow.y);}
    onWidthChanged: {if (mfMainFormHelper) mfMainFormHelper.onFormWidthChanged(mainWindow.width);}
    onHeightChanged: {if (mfMainFormHelper) mfMainFormHelper.onFormHeightChanged(mainWindow.height);}

    Connections
    {
        target: mfMainFormHelper

        onDoChangeX:
        {
            mainWindow.x = value;
        }

        onDoChangeY:
        {
            mainWindow.y = value;
        }

        onDoChangeWidth:
        {
            mainWindow.width = value;
        }

        onDoChangeHeight:
        {
            mainWindow.height = value;
        }
    }
    ...

```

WQtMainFormHelper.h

```
class WQtMainFormHelper : public QObject
{
    Q_OBJECT

    Q_SIGNALS:
        void doChangeX(int value);
        void doChangeY(int value);
        void doChangeWidth(int value);
        void doChangeHeight(int value);
    ...
    public:
    ...
        virtual Q_INVOKABLE void onFormXChanged(int value);
        virtual Q_INVOKABLE void onFormYChanged(int value);
        virtual Q_INVOKABLE void onFormWidthChanged(int value);
        virtual Q_INVOKABLE void onFormHeightChanged(int value);
    ...

```

main.cpp

```cpp
...
WQtMainFormHelper mainFormHelper;
m_pQTEngine->rootContext()->setContextProperty("mfMainFormHelper", &mainFormHelper);
...

```

This solution works very well, however it was rejected by my boss, because he demands as a constraint that all this part of the code to be exclusively written on the c++ side.

So my question is: how to achieve the exact same functionalities as above, but writing all the code in my c++ class, without **ANY** line of code on the qml side?