Utils::FancyLineEdit Class
class Utils::FancyLineEditFancyLineEdit クラスは、いくつかのオプション機能を備えた拡張ラインエディットです。詳細...
| Header: | #include <FancyLineEdit> |
| Inherits: | Utils::CompletingLineEdit |
| Inherited By: | Utils::ClassNameValidatingLineEdit and Utils::FileNameValidatingLineEdit |
パブリック関数
| void | setValidationFunction(const Utils::FancyLineEdit::ValidationFunction &fn) |
静的パブリックメンバー
| Utils::FancyLineEdit::ValidationFunction | defaultValidationFunction() |
詳細な説明
FancyLineEdit インスタンスには以下を含めることができます:
- メニューに接続された、片側に埋め込まれたピクマップ。
- フォーカスがなく、かつ空の場合、グレー表示のヒントテキスト(「ここに文字を入力してください」など)が表示されます。changed シグナルに接続したりテキストを照会したりする際は、isShowingHintText() が true を返す場合(つまり、有効なユーザー入力が含まれていない場合)、テキストがそのヒントテキストに設定されていることに注意する必要があります。
- 履歴補完機能。
- validationFunction を設定することで、テキストフィールドの内容を検証する機能。
無効な場合、テキストの色は赤くなり、ツールチップにエラーメッセージが表示されます。このアプローチは、ユーザーが特定の文字を入力できないようにするQValidator よりも、ユーザーへの干渉が少ないものです。
ヒントテキストが表示されている場合、検証状態は「DisplayingInitialText」となります。これは無効な状態ですが、赤くマークされることはありません。
メンバ関数のドキュメント
[static] Utils::FancyLineEdit::ValidationFunction FancyLineEdit::defaultValidationFunction()
デフォルトの検証関数を返します。この関数は、行編集フィールドのバリデータ同期的に実行します。
setValidationFunction()も参照してください 。
void FancyLineEdit::setValidationFunction(const Utils::FancyLineEdit::ValidationFunction &fn)
fn に対して、同期または非同期の検証関数を設定します。非同期の検証関数は、FancyLineEdit インスタンスが破棄された後も実行を継続できます。シャットダウン中、非同期の検証関数は、プラグインインスタンスが削除される直前まで実行を継続できます(その時点で、プラグインマネージャーはそれらの処理が完了するのを待ってから処理を続行します)。
defaultValidationFunction()も参照してください 。
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.