Nesta página

QPropertyChangeHandler Class

template <typename Functor> class QPropertyChangeHandler

A classe `QPropertyChangeHandler` controla o ciclo de vida do callback de alteração instalado em um ` QProperty`. Mais...

Cabeçalho: #include <QPropertyChangeHandler>
CMake: find_package(Qt6 REQUIRED COMPONENTS Core)
target_link_libraries(mytarget PRIVATE Qt6::Core)
qmake: QT += core
Herdado de: QPropertyObserver

Descrição detalhada

QPropertyChangeHandler é uma classe modelo em que o parâmetro de modelo Functor especifica o tipo da função de retorno de chamada que é invocada quando o valor da propriedade é alterado.

O `QPropertyChangeHandler<Functor>` é criado ao registrar um callback em um ` QProperty ` para monitorar alterações no valor da propriedade, utilizando ` QProperty::onValueChanged ` e ` QProperty::subscribe`. Enquanto o manipulador de alterações estiver ativo, o callback permanece instalado.

Uma instância do manipulador pode ser transferida entre escopos de C++ usando a semântica de movimentação.

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