QML グローバルオブジェクト
QML JavaScript ホスト環境では、以下のホストオブジェクトと関数を実装しています。これらはビルトインされていますので、QMLで読み込まれたJavaScriptのコードから、インポートを追加することなく利用することができます:
- Qt object: QML環境固有のヘルパーメソッドやプロパティを提供するQMLオブジェクト。
- qsTr(),qsTranslate(),qsTrId(),QT_TR_NOOP()(),QT_TRANSLATE_NOOP(),QT_TRID_NOOP() 関数:QML 環境で文字列や 文字列リテラルを翻訳するための QML 関数。
- gc()関数:ガベージコレクションを手動で起動するQML関数。
- print()関数:コンソールに出力を出力する QML 関数。
- console オブジェクト:FireBug コンソール API のサブセットを実装しています。
- XMLHttpRequestDOMException:W3C XMLHttpRequest 仕様のサブセットを実装しています。
注意: QQmlEngine のグローバルオブジェクトを変更するためにglobalObject() 関数を使用することはできません。 詳細については、JavaScript 環境の制限を参照してください。
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.