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.
私はQtScriptを学び、いくつかの簡単な例を書きました。引数を単純型に制限すると、マッピングは簡単になります。
QtScriptからC++クラスに可変数の引数を渡すことができるようにしたいと思います。
Myobject.add(1, 2, 3, "4444"); Myobject.add( {first:1, second:2, third:333} );
C ++実装でメソッドを宣言する方法は?
クイック検索では、以下を使用することをお勧めしますQVariantList。
QVariantList
void Myobject::add(QVariantList& l) { for( QVariantList::const_iterator i(l.begin()); i != l.end(); ++i ) { QVariant elem(*i); if( elem.canConvert<QVariantMap>() ) { // ... } } }
私は今これをテストするためのツールを持っていません。