QUntypedBindable Class

쿼트형 바인더블은 QProperty\<T\>QObjectBindableProperty 과 같은 바인더블 프로퍼티에 대한 모든 유형의 T 에 대한 통일된 인터페이스입니다. 더 보기...

헤더: #include <QUntypedBindable>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
이후: Qt 6.0
상속된 사람:

QBindable

공용 함수

QUntypedBindable()
QUntypedBindable(Property *property)
QPropertyNotifier addNotifier(Functor f)
QUntypedPropertyBinding binding() const
bool hasBinding() const
(since 6.1) bool isReadOnly() const
bool isValid() const
QUntypedPropertyBinding makeBinding(const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION) const
(since 6.2) QMetaType metaType() const
QPropertyChangeHandler<Functor> onValueChanged(Functor f) const
bool setBinding(const QUntypedPropertyBinding &binding)
QPropertyChangeHandler<Functor> subscribe(Functor f) const
(since 6.1) QUntypedPropertyBinding takeBinding()

상세 설명

QUntypedBindable은 바인딩 가능한 프로퍼티를 감싸는 완전히 타입이 지워진 제네릭 인터페이스입니다. 이 인터페이스를 사용하면 프로퍼티의 유형을 모르거나 바인딩 가능한 프로퍼티의 종류(예: QProperty 또는 QObjectBindableProperty)를 신경 쓰지 않고도 프로퍼티와 상호 작용할 수 있습니다. 대부분의 사용 사례에서는 QBindable<T>(프로퍼티 구현보다 일반적이지만 유형이 고정되어 있음)를 사용하는 것이 좋습니다.

멤버 함수 문서

[constexpr noexcept] QUntypedBindable::QUntypedBindable()

기본값은 QUntypedBindable을 생성합니다. 유효하지 않은 상태입니다.

isValid()도 참조하십시오 .

template <typename Property> QUntypedBindable::QUntypedBindable(Property *property)

property 프로퍼티에서 QUntypedBindable을 생성합니다. Property가 const이면, QUntypedBindable은 읽기 전용이 됩니다. property 이 null이면, QUntypedBindable은 유효하지 않습니다.

isValid() 및 isReadOnly()도 참조하세요 .

template <typename Functor> QPropertyNotifier QUntypedBindable::addNotifier(Functor f)

f 을 변경 핸들러로 설치합니다. 기본 속성이 변경될 때마다 반환된 QPropertyNotifier 및 속성이 유지되는 한 f 이 호출됩니다.

이 메서드는 경우에 따라 반환되는 객체가 템플릿이 아니므로 onValueChanged()보다 사용하기 쉽습니다. 따라서 예를 들어 클래스의 멤버로 더 쉽게 저장할 수 있습니다.

onValueChanged() 및 subscribe()도 참조하세요 .

QUntypedPropertyBinding QUntypedBindable::binding() const

기본 프로퍼티의 바인딩이 있는 경우 바인딩을 반환하고, 그렇지 않으면 기본으로 구성된 QUntypedPropertyBinding을 반환합니다.

setBinding() 및 hasBinding()도 참조하세요 .

bool QUntypedBindable::hasBinding() const

기본 속성에 바인딩이 있는 경우 true 을 반환합니다.

[since 6.1] bool QUntypedBindable::isReadOnly() const

QUntypedBindable 이 읽기 전용이면 참을 반환합니다.

이 함수는 Qt 6.1에 도입되었습니다.

bool QUntypedBindable::isValid() const

QUntypedBindable 가 유효하면 참을 반환합니다. 유효하지 않은 QUntypedBindable 에서 호출된 메서드는 달리 명시되지 않는 한 일반적으로 효과가 없습니다.

QUntypedPropertyBinding QUntypedBindable::makeBinding(const QPropertyBindingSourceLocation &location = QT_PROPERTY_DEFAULT_BINDING_LOCATION) const

지정된 소스를 사용하여 기본 프로퍼티의 값을 반환하는 바인딩을 만듭니다 location.

[since 6.2] QMetaType QUntypedBindable::metaType() const

QUntypedBindable 이 생성된 프로퍼티의 메타타입을 반환합니다. 바인더블이 유효하지 않으면 유효하지 않은 메타타입이 반환됩니다.

이 함수는 Qt 6.2에 도입되었습니다.

isValid()도 참조하세요 .

template <typename Functor> QPropertyChangeHandler<Functor> QUntypedBindable::onValueChanged(Functor f) const

f 을 변경 핸들러로 설치합니다. 기본 속성이 변경될 때마다 반환된 QPropertyChangeHandler 및 속성이 유지되는 한 f 이 호출됩니다. 값이 변경될 때마다 컨텍스트에 따라 핸들러가 즉시 호출되거나 지연됩니다.

onValueChanged() 및 subscribe()도 참조하세요 .

bool QUntypedBindable::setBinding(const QUntypedPropertyBinding &binding)

기본 속성의 바인딩을 binding 으로 설정합니다. QUntypedBindable 이 읽기 전용이거나 null이거나 binding 의 유형이 기본 속성의 유형과 일치하는 경우에는 아무런 영향을 미치지 않습니다.

바인딩이 성공적으로 설정되면 true 을 반환합니다.

binding()도 참조하세요 .

template <typename Functor> QPropertyChangeHandler<Functor> QUntypedBindable::subscribe(Functor f) const

f 에 이어 onValueChanged(f) 으로 호출하는 것처럼 동작합니다,

onValueChanged()도 참조하세요 .

[since 6.1] QUntypedPropertyBinding QUntypedBindable::takeBinding()

프로퍼티에서 현재 설정된 바인딩을 제거하고 반환합니다. 바인딩이 설정되어 있지 않으면 기본으로 구성된 QUntypedPropertyBinding을 반환합니다.

이 함수는 Qt 6.1에 도입되었습니다.

© 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.