I have an qt widgets application. I want to add the switch control to my form. I added to my form QDeclarative widget and add this line to the code but nothing shown.
ui->declarativeView->setSource(QUrl::fromLocalFile("test.qml"));
This is the content of the qml file (I added this file to the resources) It display in qtcreator under resources/[project_name.qrc]/test.qml
import QtQuick 2.4
import QtQuick.Controls 1.3
Button{
text:aaaa
}
I added the pro file : qt += declarative
What am i doing wrong??
I'm using Qt 5.4.1 QtCreator 3.3.1.