このページでは

Utils::Id Class

class Utils::Id

Id クラスは、特定のQt Creator プロセス内で一意となる識別子をカプセル化しています。詳細...

Header: #include <utils/id.h>

パブリック関数

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

静的パブリックメンバー

Utils::Id fromSetting(const QVariant &variant)

詳細な説明

Utils::Id は、単純な `QString ` や `QByteArray ` よりも、より型安全かつ高速な方法で、対象となるオブジェクトを特定するための機能として使用されます。

ID は、表示および永続化に使用される、通常の 7 ビットクリーン ASCII 名に関連付けられています。

メンバ関数のドキュメント

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

永続化された値 `variant` から ID を再構築します。

toSetting()も参照してください 。

QByteArrayView Id::name() const

IDの内部表現を返します。

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

IDの文字列表現の一部を抽出します。この関数は、withSuffix() を使用してIDを生成する際に指定された、baseId で指定された基本部分を切り分けるために使用できます。

withSuffix()も参照してください 。

QVariant Id::toSetting() const

QSettings に格納するのに適した ID を表す永続的な値を返します。

fromSetting()も参照してください 。

QString Id::toString() const

UI での表示に適した ID の文字列表現を返します。

これは、IDの永続的なバージョンを作成するために使用すべきではありません。代わりにtoSetting() を使用してください。

fromString() およびtoSetting()も参照してください 。

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

派生IDを生成します。

これにより、論理的に関連するIDのグループを作成できます。関連付けられる内部名は、先頭に「prefix 」を付加して生成されます。

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

派生IDを生成します。

これにより、論理的に関連するIDのグループを作成できます。関連付けられる内部名は、「suffix 」を末尾に付加して生成されます。

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

これはオーバーロードされた関数です。

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

これはオーバーロードされた関数です。

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

これはオーバーロードされた関数です。

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

これはオーバーロードされた関数です。

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.