Utils::Id Class
class Utils::IdTřída `Id` zapouzdřuje identifikátor, který je jedinečný v rámci konkrétního spuštěného procesu Qt Creator. Více...
| Header: | #include <utils/id.h> |
Veřejné funkce
| 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 |
Statické veřejné členy
| Utils::Id | fromSetting(const QVariant &variant) |
Podrobný popis
Utils::Id slouží jako nástroj k identifikaci objektů zájmu typově bezpečnějším a rychlejším způsobem, než by poskytovaly prosté příkazy ` QString ` nebo ` QByteArray `.
K identifikátoru je přiřazen běžný 7-bit-clean ASCII název, který se používá pro zobrazení a trvalé uložení.
Dokumentace členských funkcí
[static] Utils::Id Id::fromSetting(const QVariant &variant)
Rekonstruuje identifikátor z trvalé hodnoty variant.
Viz také toSetting().
QByteArrayView Id::name() const
Vrátí interní reprezentaci identifikátoru.
QString Id::suffixAfter(Utils::Id baseId) const
Vytáhne část řetězcového zápisu identifikátoru. Tuto funkci lze použít k oddělení základní části určené pomocí baseId, která se používá při generování identifikátoru pomocí withSuffix().
Viz také withSuffix().
QVariant Id::toSetting() const
Vrací trvalou hodnotu představující identifikátor, který je vhodný k uložení v QSettings.
Viz také fromSetting().
QString Id::toString() const
Vrací řetězcovou reprezentaci identifikátoru, která je vhodná pro zobrazení v uživatelském rozhraní.
Tuto funkci byste neměli používat k vytvoření trvalé verze identifikátoru, místo toho použijte funkci toSetting().
Viz také fromString() a toSetting().
Utils::Id Id::withPrefix(const char *prefix) const
Vytvoří odvozené ID.
Tuto funkci lze použít k vytvoření skupin identifikátorů, které k sobě logicky patří. Přidružený interní název bude vygenerován tak, že se na začátek přidá předpona „ prefix “.
Utils::Id Id::withSuffix(qsizetype suffix) const
Vytvoří odvozené ID.
Tuto funkci lze použít k vytvoření skupin identifikátorů, které k sobě logicky patří. Přidružený interní název bude vygenerován připojením koncovky „ suffix “.
Utils::Id Id::withSuffix(QStringView suffix) const
Toto je přetížená funkce.
Utils::Id Id::withSuffix(char suffix) const
Toto je přetížená funkce.
Utils::Id Id::withSuffix(const char *suffix) const
Toto je přetížená funkce.
Utils::Id Id::withSuffix(int suffix) const
Toto je přetížená funkce.
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.