Solved. The error message, speaking about a "window", is a bit misleading, as we need to set not the window itself, but the window's contentItem() as a parent.
For posterity, my working code:
QQuickWindow *mainWindow = qobject_cast<QQuickWindow*>(m_engine->rootObjects().value(0));
QQmlComponent boxComp( m_engine, QUrl( "qrc:/UserInteractionBox.qml" ) );
QVariantMap initialProperties;
initialProperties["parent"] = QVariant::fromValue(mainWindow->contentItem());
initialProperties["title"] = m_title;
initialProperties["text"] = m_text;
QQmlContext *ctxt = m_view->rootContext();
auto obj = boxComp.createWithInitialProperties(initialProperties,ctxt);
QMetaObject::invokeMethod(obj, "open");
As for the Dialog, my starting point is simply:
import QtQuick 2.0
import QtQuick.Controls 2.15
Dialog {
id: userInteractionBox
property string text: ""
TextArea {
anchors.fill: parent
text: userInteractionBox.text
}
}