QMetaObject::Connection Class
class QMetaObject::ConnectionFunções públicas
| Connection() | |
| Connection(const QMetaObject::Connection &other) | |
| Connection(QMetaObject::Connection &&o) | |
| ~Connection() | |
| void | swap(QMetaObject::Connection &other) |
| operator bool() const | |
| QMetaObject::Connection & | operator=(QMetaObject::Connection &&other) |
| QMetaObject::Connection & | operator=(const QMetaObject::Connection &other) |
Descrição detalhada
Representa um identificador para uma conexão sinal-slot (ou sinal-funtor).
Pode ser usado para verificar se a conexão é válida e para desconectá-la usando ` QObject::disconnect()`. Para uma conexão sinal-funtor sem um objeto de contexto, essa é a única maneira de desconectar seletivamente essa conexão.
Como `Connection` é apenas um identificador, a conexão sinal-slot subjacente não é afetada quando `Connection` é destruída ou reatribuída.
Documentação das funções-membro
[noexcept] Connection::Connection()
Cria uma instância de Connection.
Connection::Connection(const QMetaObject::Connection &other)
Crie uma cópia do identificador da conexão other
[noexcept] Connection::Connection(QMetaObject::Connection &&o)
Move cria uma instância de Connection, fazendo com que ela aponte para o mesmo objeto para o qual o estava apontando.
[noexcept] Connection::~Connection()
Destrutor para ` QMetaObject::Connection`.
[noexcept] void Connection::swap(QMetaObject::Connection &other)
Troca esta instância de Connection por uma d other. Essa operação é muito rápida e nunca falha.
Connection::operator bool() const
Retorna true se a conexão for válida.
A conexão é válida se a chamada para QObject::connect for bem-sucedida. A conexão é inválida se QObject::connect não conseguir encontrar o sinal ou o slot, ou se os argumentos não corresponderem.
[noexcept] QMetaObject::Connection &Connection::operator=(QMetaObject::Connection &&other)
A função move-assigns atribui ` other ` a este objeto e retorna uma referência.
QMetaObject::Connection &Connection::operator=(const QMetaObject::Connection &other)
Atribui ` other ` a esta conexão e retorna uma referência a ela.
© 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.