Application QML Type

많은 QML 컴포넌트가 공유하는 글로벌 애플리케이션 상태 속성에 대한 액세스를 제공합니다. 더 보기...

Import Statement: import QtQuick

속성

신호

상세 설명

애플리케이션 싱글톤은 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참조하세요 .

프로퍼티 문서

arguments : list<string>

실행 파일이 호출된 인수의 문자열 목록입니다.


displayName : string

이 속성은 QGuiApplication 인스턴스에 설정된 애플리케이션 표시 이름을 나타냅니다. 애플리케이션 표시 이름을 설정하기 위해 이 프로퍼티에 쓸 수 있습니다.

Binding {
    target: Application
    property: "displayName"
    value: "My Awesome Application"
}

domain : string

QCoreApplication 인스턴스에 설정된 조직 도메인입니다. 조직 도메인을 설정하기 위해 이 속성에 쓸 수 있습니다.


font : font [read-only]

QGuiApplication::font()에서 반환한 기본 애플리케이션 글꼴을 반환합니다.


layoutDirection : enumeration [read-only]

이 읽기 전용 속성은 애플리케이션의 기본 레이아웃 방향을 쿼리하는 데 사용할 수 있습니다. 시스템 시작 시 기본 레이아웃 방향은 애플리케이션의 언어에 따라 달라집니다. 텍스트 및 그래픽 요소를 오른쪽에서 왼쪽으로 읽는 로캘의 경우 이 속성의 값은 Qt.RightToLeft, 읽기 방향이 왼쪽에서 오른쪽으로 흐르는 경우 Qt.LeftToRight 입니다. 이 속성에 바인딩하여 두 레이아웃 방향을 모두 지원하도록 애플리케이션 레이아웃을 사용자 지정할 수 있습니다.

사용 가능한 값은 C++ Qt::LayoutDirection 열거형을 참조하세요.

RowLayout {
    layoutDirection: Application.layoutDirection
}

name : string

QCoreApplication 인스턴스에 설정된 애플리케이션 이름입니다. 애플리케이션 이름을 설정하기 위해 이 프로퍼티에 쓸 수 있습니다.


organization : string

QCoreApplication 인스턴스에 설정된 조직 이름입니다. 조직 이름을 설정하기 위해 이 속성에 쓸 수 있습니다.


screens : list<Screen> [read-only]

연결된 모든 화면에 대한 설명이 포함된 배열입니다. 배열의 요소는 Screen 첨부된 개체와 동일한 속성을 가진 개체입니다. 실제로 이 배열은 QGuiApplication::screens()에서 반환한 화면 목록에 해당합니다. 배열 요소는 이름, 너비, 높이 등과 같은 속성을 검사하는 것 외에도 창 항목의 화면 속성에 할당할 수 있으므로 C++ 쪽의 QWindow::setScreen()의 대안으로 사용할 수 있습니다.

Screen, Window, Window.screen참조하세요 .


state : enumeration [read-only]

이 속성은 애플리케이션의 현재 상태를 나타냅니다.

가능한 값은 C++ Qt::ApplicationState 열거형을 참조하세요.

Timer {
    interval: 1000; repeat: true
    active: Application.state === Qt.Qt.ApplicationActive
    onTriggered: imageFetcher.fetchLatestImages()
}

styleHints : StyleHints [read-only]

styleHints 속성은 플랫폼별 스타일 힌트 및 설정을 제공합니다. 자세한 내용은 QStyleHints 문서를 참조하세요.

다음 예제에서는 styleHints 을 사용하여 마우스를 누르거나 터치 해제할 때 항목에 초점을 맞출지 여부를 결정합니다:

import QtQuick

MouseArea {
    id: button

    onPressed: {
        if (!Application.styleHints.setFocusOnTouchRelease)
            button.forceActiveFocus()
    }
    onReleased: {
        if (Application.styleHints.setFocusOnTouchRelease)
            button.forceActiveFocus()
    }
}

supportsMultipleWindows : bool [read-only]

플랫폼이 여러 창을 지원하는 경우 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.