이 페이지에서

Utils::BaseAspect Class

class Utils::BaseAspect

BaseAspect 클래스는 어스펙트를 구현하는 클래스들에 대한 공통 기반을 제공합니다. 더 보기...

Header: #include <BaseAspect>
Inherits: QObject
Inherited By:

Utils::AspectContainer, Utils::TextDisplay, and Utils::TypedAspect

공개 유형

enum Announcement { DoEmit, BeQuiet }

공개 함수

BaseAspect(Utils::AspectContainer *container = nullptr)
virtual ~BaseAspect() override
virtual void apply()
virtual void cancel()
QString displayName() const
virtual void fromMap(const Utils::Store &map)
QString labelText() const
virtual void setAutoApply(bool on)
void setEnabler(Utils::BoolAspect *checker)
void setLabelPixmap(const QPixmap &labelPixmap)
void setLabelText(const QString &labelText)
void setSettingsKey(const Utils::Key &key)
void setSettingsKey(const Utils::Key &group, const Utils::Key &key)
void setToolTip(const QString &tooltip)
virtual void setVariantValue(const QVariant &value, Utils::BaseAspect::Announcement howToAnnounce = DoEmit)
void setVisible(bool visible)
Utils::Key settingsKey() const
virtual void toMap(Utils::Store &map) const
void writeToSettingsImmediatly() const

보호된 함수

virtual void addToLayoutImpl(Layouting::Layout &parent)

상세 설명

어스펙트는 속성이나 특정 객체의 관련 속성 모음과 같은 데이터 덩어리이며, 시각화나 영구 저장 같은 일반적인 작업에 대한 동작 설명이 함께 포함됩니다.

간단한 어스펙트의 예로는, 사용자 인터페이스에서 QCheckBox 로 표시되는 부울 속성이나, 파일 시스템에서 디렉터리를 선택하기 위해 PathChooser 로 표시되는 문자열 속성 등이 있습니다.

어스펙트 구현체는 일반적으로 데이터를 시각화 및 영구 저장하거나 ID를 사용할 수 있지만, 이 중 어느 것도 필수 사항은 아닙니다.

파생 클래스는 addToLayout()을 구현하여 UI를 생성할 수 있습니다.

UI를 내부 데이터와 동기화하려면 guiToBuffer() 및 bufferToGui() 를 구현하십시오.

멤버 유형 문서

enum BaseAspect::Announcement

값이 변경될 때 신호를 전송할지 여부.

상수값설명
Utils::BaseAspect::DoEmit0신호를 발산합니다.
Utils::BaseAspect::BeQuiet1신호를 발산하지 않습니다.

멤버 함수 설명

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

기본 어스펙트를 생성합니다.

container 가 null이 아닌 경우, 해당 어스펙트가 컨테이너에 알립니다.

[override virtual noexcept] BaseAspect::~BaseAspect()

BaseAspect 를 파괴합니다.

[virtual protected] void BaseAspect::addToLayoutImpl(Layouting::Layout &parent)

레이아웃 빌더를 사용하여 지정된 parent 를 통해 이 요소의 시각적 표현을 레이아웃에 추가합니다.

[virtual] void BaseAspect::apply()

위젯에서 사용자가 직접 변경한 내용을 바탕으로 이 속성의 값을 업데이트합니다.

값이 변경되면 changed() 이벤트를 발생시킵니다.

[virtual] void BaseAspect::cancel()

위젯에서 사용자가 변경한 내용을 모두 삭제하고, 어스펙트의 값을 기반으로 위젯 내용을 복원합니다.

이는 ` isAutoApply `가 false인 경우에만 적용됩니다.

QString BaseAspect::displayName() const

이 작업이 메뉴나 일반적으로 ‘Book’ 스타일 대소문자 표기법이 사용되는 다른 위치에 표시될 때 사용해야 할 문자열을 반환합니다.

표시 이름이 설정되지 않은 경우, 레이블 텍스트가 대체 값으로 사용됩니다.

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

map 에 저장된 이 BaseAspect 의 내부 값을 가져옵니다.

QString BaseAspect::labelText() const

이 측면의 시각적 표현에 포함된 개별 레이블의 현재 텍스트를 반환합니다.

setLabelText()도 참조하십시오 .

[virtual] void BaseAspect::setAutoApply(bool on)

자동 적용 모드를 설정합니다. 자동 적용 모드가 ‘ off ’인 경우, 프로그래밍 방식으로 ` apply() `가 호출되기 전까지는 사용자가 이 어스펙트의 위젯을 조작하더라도 어스펙트의 ` value `는 변경되지 않습니다.

setSettingsKey()도 참조하십시오 .

void BaseAspect::setEnabler(Utils::BoolAspect *checker)

이 어스펙트의 활성화 상태를 ‘ checker ’의 선택 여부에 따라 결정하도록 합니다.

void BaseAspect::setLabelPixmap(const QPixmap &labelPixmap)

이 측면의 시각적 표현에서 별도의 레이블에 대한 픽스맵으로 ` labelPixmap `을 설정합니다.

void BaseAspect::setLabelText(const QString &labelText)

이 측면의 시각적 표현에서 별도의 레이블에 표시될 텍스트로 ‘ labelText ’를 설정합니다.

labelText()도 참조하십시오 .

void BaseAspect::setSettingsKey(const Utils::Key &key)

설정에 액세스할 때 사용할 key 를 설정합니다.

settingsKey()도 참조하십시오 .

void BaseAspect::setSettingsKey(const Utils::Key &group, const Utils::Key &key)

설정에 액세스할 때 사용할 key 및 group 을 설정합니다.

settingsKey()도 참조하십시오 .

void BaseAspect::setToolTip(const QString &tooltip)

이 측면의 시각적 표현에 대한 툴팁으로 “ tooltip ”을 설정합니다.

[virtual] void BaseAspect::setVariantValue(const QVariant &value, Utils::BaseAspect::Announcement howToAnnounce = DoEmit)

value 를 설정합니다.

howToAnnounce 가 DoEmit 로 설정된 경우, valueChanged 신호를 발생시킵니다.

파생 클래스의 타입화된 setValue() 을 우선적으로 사용합니다.

void BaseAspect::setVisible(bool visible)

visible 의 값에 따라 이 측면의 시각적 표시를 보이게 하거나 숨깁니다. 기본적으로 표시됩니다.

Utils::Key BaseAspect::settingsKey() const

설정에 액세스할 때 사용할 키를 반환합니다.

setSettingsKey()도 참조하십시오 .

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

이 ` BaseAspect `의 내부 값을 `Store map`에 저장합니다.

void BaseAspect::writeToSettingsImmediatly() 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.