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を動的に作成する必要があり、 ComponentAから id を介してアクセスできないComponentB にComponentCを作成する必要があります。
では、これは 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 }
しかし、それが期待される動作であるかどうかはわかりません...