Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当单击ComponentA的按钮时,我需要动态创建ComponentC ,并且必须在 ComponentB 中创建ComponentC ,该 ComponentB不能通过ComponentA的 id 访问。
那么如何使用 QML 来实现呢?
谢谢。
信号可以返回被调用槽返回的对象:
int B::slot() { return 12; } void A::test() { connect( this, SIGNAL(sig()), objectB, SLOT(slot()); int i = emit sig(); // i should be equal to 12 }
但是,我不知道这是否是预期的行为......