Nesta página

Utils::Id Class

class Utils::Id

A classe `Id` encapsula um identificador que é único dentro de um processo específico do ` Qt Creator ` em execução. Mais...

Header: #include <utils/id.h>

Funções públicas

QByteArrayView name() const
QString suffixAfter(Utils::Id baseId) const
QVariant toSetting() const
QString toString() const
Utils::Id withPrefix(const char *prefix) const
Utils::Id withSuffix(qsizetype suffix) const
Utils::Id withSuffix(QStringView suffix) const
Utils::Id withSuffix(char suffix) const
Utils::Id withSuffix(const char *suffix) const
Utils::Id withSuffix(int suffix) const

Membros públicos estáticos

Utils::Id fromSetting(const QVariant &variant)

Descrição detalhada

Utils::Id é usado como um recurso para identificar objetos de interesse de maneira mais segura em termos de tipos e mais rápida do que um simples ` QString ` ou ` QByteArray ` proporcionaria.

Um id está associado a um nome ASCII simples de 7 bits, utilizado para exibição e persistência.

Documentação da função membro

[static] Utils::Id Id::fromSetting(const QVariant &variant)

Reconstrói um id a partir do valor persistente variant.

Veja também toSetting().

QByteArrayView Id::name() const

Retorna uma representação interna do id.

QString Id::suffixAfter(Utils::Id baseId) const

Extraia uma parte da representação da string do ID. Essa função pode ser usada para separar a parte base especificada por baseId, utilizada na geração de um ID com withSuffix().

Veja também withSuffix().

QVariant Id::toSetting() const

Retorna um valor persistente que representa o id, adequado para ser armazenado em QSettings.

Veja também fromSetting().

QString Id::toString() const

Retorna uma representação em string do id, adequada para exibição na interface do usuário.

Isso não deve ser usado para criar uma versão persistente do Id; use toSetting() em vez disso.

Veja também fromString() e toSetting().

Utils::Id Id::withPrefix(const char *prefix) const

Cria um ID derivado.

Isso pode ser usado para criar grupos de IDs que pertencem logicamente uns aos outros. O nome interno associado será gerado acrescentando-se “ prefix ” no início.

Utils::Id Id::withSuffix(qsizetype suffix) const

Cria um ID derivado.

Isso pode ser usado para criar grupos de IDs que pertencem logicamente a um mesmo conjunto. O nome interno associado será gerado acrescentando-se “ suffix ”.

Utils::Id Id::withSuffix(QStringView suffix) const

Esta é uma função sobrecarregada.

Utils::Id Id::withSuffix(char suffix) const

Esta é uma função sobrecarregada.

Utils::Id Id::withSuffix(const char *suffix) const

Esta é uma função sobrecarregada.

Utils::Id Id::withSuffix(int suffix) const

Esta é uma função sobrecarregada.

Copyright © The Qt Company Ltd. and other contributors. 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.