Utils::VariableChooser Class
class Utils::VariableChooserVariableChooser 클래스는 라인 편집기, 텍스트 편집기 또는 일반 텍스트 편집기에 Qt Creator 변수를 선택하기 위한 도구 창을 추가하는 데 사용됩니다. 더 보기...
| Header: | #include <coreplugin/variablechooser.h> |
공개 함수
| VariableChooser(QWidget *parent = nullptr) | |
| void | addMacroExpanderProvider(const Utils::MacroExpanderProvider &provider) |
| void | addSupportedWidget(QWidget *textcontrol, const QByteArray &ownName = QByteArray()) |
상세 설명
사용자가 텍스트 컨트롤을 통해 문자열을 입력할 수 있는 경우와 같이, UI에 지정된 문자열에 Qt Creator 변수를 추가할 수 있도록 허용하는 경우, 해당 컨트롤에 변수 선택기를 추가해야 합니다. 변수 선택기를 사용하면 사용자는 사용 가능한 모든 변수의 목록과 설명이 포함된 도구 창을 열 수 있습니다. 변수를 더블 클릭하면 라인 편집과 마찬가지로 해당 문자열이 해당 텍스트 컨트롤에 삽입됩니다.

변수 선택기는 부모 위젯의 모든 자식 요소에 대한 포커스 변경을 모니터링합니다. 텍스트 컨트롤이 포커스를 얻으면, 변수 선택기는 해당 컨트롤에 변수 지원이 설정되어 있는지 확인합니다. 컨트롤이 변수를 지원하는 경우, 포커스가 있는 동안 변수 선택기를 여는 도구 버튼이 컨트롤 내에 표시됩니다.
지원되는 텍스트 컨트롤은 QLineEdit, QTextEdit 및 QPlainTextEdit 입니다.
변수 선택기는 상위 위젯이 삭제되면 함께 삭제됩니다.
예시:
멤버 함수 문서
[explicit] VariableChooser::VariableChooser(QWidget *parent = nullptr)
parent 의 모든 자식 노드를 추적하여 변수 지원을 제공하는 변수 선택기를 생성합니다. 또한 소유권도 parent 로 이전됩니다.
void VariableChooser::addMacroExpanderProvider(const Utils::MacroExpanderProvider &provider)
provider 매크로 확장기 제공자를 추가합니다.
void VariableChooser::addSupportedWidget(QWidget *textcontrol, const QByteArray &ownName = QByteArray())
textcontrol 컨트롤을 변수를 지원하는 것으로 표시합니다.
컨트롤이 매크로 확장기 자체에 변수를 제공하는 경우, 사용자가 해당 변수를 선택하여 무한 재귀가 발생하는 것을 방지하기 위해 ownName 을 해당 변수 이름으로 설정하십시오.
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.