このページでは

Utils::StringAspect Class

class Utils::StringAspect

文字列アスペクトとは、あるオブジェクトの文字列のようなプロパティと、可視化や永続化といった一般的な操作におけるその挙動の説明とを組み合わせたものです。詳細...

Header: #include <StringAspect>
Inherits: Utils::TypedAspect

パブリック型

enum DisplayStyle { LabelDisplay, LineEditDisplay, TextEditDisplay, PasswordLineEditDisplay }

パブリック関数

StringAspect(Utils::AspectContainer *container = nullptr)
void makeCheckable(Utils::CheckBoxPlacement checkBoxPlacement, const QString &checkerLabel, const Utils::Key &checkerKey)
void setDisplayFilter(const std::function<QString (const QString &)> &displayFilter)
void setDisplayStyle(Utils::StringAspect::DisplayStyle displayStyle)
void setElideMode(Qt::TextElideMode elideMode)
void setHistoryCompleter(const Utils::Key &historyCompleterKey)
void setPlaceHolderText(const QString &placeHolderText)

再実装されたパブリック関数

virtual void fromMap(const Utils::Store &map) override
virtual void toMap(Utils::Store &map) const override

詳細な説明

文字列アスペクトは、たとえば、外部コマンドのパラメータ、ファイルシステム内のパス、あるいは単なる文字列などを表すことができます。

文字列は、QLabel 、QLineEdit 、QTextEdit 、またはUtils::PathChooser を使用して表示できます。

視覚的な表現には、多くの場合、実際の値の表示の前にラベルが含まれます。

メンバ型のドキュメント

enum StringAspect::DisplayStyle

DisplayStyle 列挙型は、文字列のアスペクトの主な視覚的特徴を表します。

定数値説明
Utils::StringAspect::LabelDisplay0QLabel に基づいており、この場所でユーザーが変更できないテキスト(たとえば、ビルドシステムで定義された実行ファイルの名前など)に使用されます。
Utils::StringAspect::LineEditDisplay1QLineEdit に基づいており、通常 1 行に収まる、ユーザーが編集可能な文字列に使用されます。
Utils::StringAspect::TextEditDisplay2QTextEdit に基づいており、多くの場合、1行に収まらない、ユーザーが編集可能な文字列に使用されます。
Utils::StringAspect::PasswordLineEditDisplay3QLineEdit に基づいており、パスワード文字列に使用されます。

Utils::PathChooserも参照してください 。

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

StringAspect::StringAspect(Utils::AspectContainer *container = nullptr)

文字列の「aspect」container を生成します。

[override virtual] void StringAspect::fromMap(const Utils::Store &map)

BaseAspect::fromMap (const Utils::Store &map)を再実装します。

void StringAspect::makeCheckable(Utils::CheckBoxPlacement checkBoxPlacement, const QString &checkerLabel, const Utils::Key &checkerKey)

checkBoxPlacement に準拠したcheckerLabel を持つチェックボックスを、ラインエディットに追加します。

checkerKey が空でない場合、チェックボックスの状態は永続化されます。

void StringAspect::setDisplayFilter(const std::function<QString (const QString &)> &displayFilter)

この文字列アスペクトの値の外観を微調整するための「displayFilter 」を設定します。

void StringAspect::setDisplayStyle(Utils::StringAspect::DisplayStyle displayStyle)

displayStyle に基づいて、アスペクトの主な表示特性を選択します。

注: すべてのStringAspect 機能が、すべての表示スタイルで利用できるわけではありません 。

「Utils::StringAspect::DisplayStyle」も参照してください 。

void StringAspect::setElideMode(Qt::TextElideMode elideMode)

elideMode をラベルの省略モードとして設定します。

void StringAspect::setHistoryCompleter(const Utils::Key &historyCompleterKey)

行編集およびパス選択画面の履歴補完設定のキーとして、historyCompleterKey を設定します。

Utils::PathChooser::setExpectedKind()も参照してください 。

void StringAspect::setPlaceHolderText(const QString &placeHolderText)

placeHolderText を、行およびテキスト表示用のプレースホルダーとして設定します。

[override virtual] void StringAspect::toMap(Utils::Store &map) const

BaseAspect::toMap (Utils::Store &map)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.