Application QML Type
多くの QML コンポーネントが共有するグローバルなアプリケーション状態プロパティへのアクセスを提供します。詳細...
Import Statement: | import QtQuick |
プロパティ
- arguments : list<string>
- displayName : string
- domain : string
- font : font
- layoutDirection : enumeration
- name : string
- organization : string
- screens : list<Screen>
- state : enumeration
- styleHints : StyleHints
- supportsMultipleWindows : bool
- version : string
信号
詳細説明
Application シングルトンはQApplication のプロパティのサブセットを QML アプリケーションに公開します。
また、QCoreApplication::aboutToQuit() と同じaboutToQuit() シグナルも提供します。
import QtQuick Window { id: root visible: true width: 800 height: 680 title: `${Application.name} (${Application.version})` Connections { target: Application function onAboutToQuit() { console.log("Bye!") } } }
SystemPaletteも参照してください 。
プロパティのドキュメント
displayName : string |
このプロパティは、QGuiApplication インスタンスに設定されているアプリケーション表示名を表します。このプロパティは、アプリケーション表示名を設定するために書き込むことができます。
Binding { target: Application property: "displayName" value: "My Awesome Application" }
domain : string |
QCoreApplication インスタンスに設定されている組織ドメインです。組織ドメインを設定するには、このプロパティに書き込むことができます。
font : font |
QGuiApplication::font() が返すデフォルトのアプリケーション・フォントを返す。
layoutDirection : enumeration |
この読み取り専用プロパティを使用して、アプリケーションのデフォルトのレイアウト方向を照会できます。システム起動時のデフォルトのレイアウト方向は、アプリケーションの言語によって異なります。このプロパティは、テキストやグラフィック要素が右から左に読まれるロケールではQt.RightToLeft
の値を持ち、左から右に読まれるロケールではQt.LeftToRight
の値を持ちます。こ のプ ロ パテ ィ をバ イ ン ド す る こ と で、 アプ リ ケーシ ョ ンの レ イ ア ウ ト をカ ス タ マ イ ズ し て両方の レ イ ア ウ ト 方向に対応 さ せ る こ と がで き ます。
取り得る値については、C++Qt::LayoutDirection enumを参照してください。
RowLayout { layoutDirection: Application.layoutDirection }
name : string |
これは、QCoreApplication インスタンスに設定されているアプリケーション名です。このプロパティに書き込むことで、アプリケーション名を設定できます。
organization : string |
これは、QCoreApplication インスタンスに設定されている組織名です。組織名を設定するために、このプロパティに書き込むことができます。
接続されているすべての画面の説明を含む配列。配列の要素は、Screen 添付オブジェクトと同じプロパティを持つオブジェクトです。実際には、この配列はQGuiApplication::screens() によって返される画面リストに対応する。name、width、heightなどのプロパティを調べるだけでなく、配列の要素をWindowアイテムのscreenプロパティに代入することもできるので、C++側のQWindow::setScreen ()の代替としても機能する。
Screen 、Window 、Window.screenも参照して ください。
state : enumeration |
このプロパティはアプリケーションの現在の状態を表します。
取り得る値については、C++のQt::ApplicationState 列挙型を参照してください。
Timer { interval: 1000; repeat: true active: Application.state === Qt.Qt.ApplicationActive onTriggered: imageFetcher.fetchLatestImages() }
styleHints : StyleHints |
styleHints
プロパティは、プラットフォーム固有のスタイル・ヒントと設定を提供します。詳細はQStyleHints のドキュメントを参照してください。
次の例では、styleHints
を使用して、マウスを押したときと離したときのどちらにフォーカスを当てるかを指定します:
import QtQuick MouseArea { id: button onPressed: { if (!Application.styleHints.setFocusOnTouchRelease) button.forceActiveFocus() } onReleased: { if (Application.styleHints.setFocusOnTouchRelease) button.forceActiveFocus() } }
supportsMultipleWindows : bool |
プラットフォームがマルチウィンドウをサポートしている場合、true
を返します。いくつかの組み込みプラットフォームはマルチウィンドウをサポートしていません。
version : string |
これは、QCoreApplication インスタンスに設定されているアプリケーションのバージョンです。アプリケーションのバージョンを設定するには、このプロパティに書き込むことができます。
シグナル・ドキュメント
aboutToQuit() |
このシグナルは、アプリケーションがメイン・イベント・ループを終了しようとするときに発せられます。このシグナルは、アプリケーションが最後のクリーンアップを行う必要がある場合に特に便利です。この状態では、ユーザーとの対話はできません。詳しくはWindow.closing を参照してください。
注: 対応するハンドラはonAboutToQuit
。
QCoreApplication::aboutToQuitも参照してください 。
© 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.