I have a qml file ToggleSwitch.qml
which I want to import to my widgets. Basically I want to integrate qml with widget
ToggleSwitch.qml
Switch
{
checked:true
}
In Mainwindow.cpp
I want do something like this
Mainwindow.cpp
QQuickWidget *quickWidget = new QQuickWidget;
quickWidget->setSource(QUrl("qrc:/Resources/ToggleSwitch.qml"));
QVBoxLayout *vBox = new QVBoxLayout;
vBox->addWidget(quickWidget);
I tried this above code but it does not work. It throws error unresolved external symbol