Is it possible to use QQuickwidget::setSource() with variable (QString or QByteArray)?
I know that I can load a file (or resource): ui->quickWidget->setSource(QUrl::fromLocalFile(":/qml/Example.qml"));
But if I have the qml code stored in a variable, I could only solve it by first writing to a file on disk and loading that file. Can it be done directly?
Maybe with the Help of a Temporary file?
https://doc.qt.io/qt-5/qtemporaryfile.html
Something like this(i dont have much time so i just did something dirty):