How to instantiate C++ component in QML - WITH Parameterized Constructor
<p>In hypothetical example, I have a C++ component - </p>

<pre><code>class Board : public QObject
{
    Q_OBJECT
public:
    //Q_PROPERTYs go here
    explicit Board(int rows, int columns)
    {
        matrix = std::vector&lt;int&gt;(rows, std::vector&lt;int&gt;(columns, 0));
    }

    ~Board()
    {
        matrix.clear();
    }

    Q_INVOKABLE void checkAndUpdateAdjecentCells(int row, int column);
    //setters and getters here.

signals:
    void matrixUpdated();

private:
    Board(QObject *parent) = default; //i intend to do this.
    Board(Board&amp; b) = delete;
    int nRows_, nCols_;
    std::vector&lt;std::vector&gt; matrix;
};
</code></pre>

<p>registered in <code>main()</code> like - </p>

<pre><code>qmlRegisterType&lt;Board&gt;("SameGameBackend", 1, 0, "BubbleBoard");
</code></pre>

<p><strong>Question</strong> </p>

<p>How do I instantiate this in QML such that the parameterized constructor is invoked ?</p>

<p>Expected QML code -</p>

<pre><code>BubbleBoard{
    id: bboard
    rows: 10
    columns: 10
}
</code></pre>

<hr>

<p>We can extend this question to include initializer list.
Had <code>nRows_</code> and <code>nCols_</code> been <code>const int</code>, 
constructor would have been </p>

<pre><code>explicit Board(int rows, int columns):nRows_(rows), nCols_(columns){}
</code></pre>

<p>Is it possible to instantiate such components from inside QML ?</p>