我通过一个中介类连接了 C++ 和 QML,并且一切都在两个方向上工作,但这让我感到困惑。
这就是我连接中介类的方式:
// Initialize Mediator between QML and C++
QmlCppMediator m_qmlCppMediator;
QDeclarativeContext *context = viewer.rootContext();
context->setContextProperty("cppInterface", &m_qmlCppMediator);
如何从 C++ 中触发普通的属性动画?