I want to use QPropertyAnimation to animate the transparency of a QDeclarativeView .But,it doesn't work.It's nothing to change and no errors, but I use property "geometry",it works.I have no ideas.
Here is my main.cpp code:
int main(int argc, char *argv[])
{
QApplication a(argc, argv, true);
QDeclarativeView* view;
QDeclarativeContext *context;
QDeclarativeEngine* engine;
Connector* connector;
view = new QDeclarativeView();
connector = new Connector();
context = view->rootContext();
context->setContextProperty("Connector", connector);
context->setContextProperty("gRadioQMLDir", QDir::currentPath());
view->setSource(QUrl::fromLocalFile("qml/Main.qml"));
view->setViewportUpdateMode(QGraphicsView::MinimalViewportUpdate);
view->show();
QPropertyAnimation animation(view, "windowOpacity");
animation.setDuration(30000);
animation.setStartValue(0.0);
animation.setEndValue(1.0);
animation.start();
return a.exec();
}