Fluent-Qt

내비게이션

Stepper 스테퍼

완료, 오류 및 사용 가능 상태와 함께 애플리케이션이 제어하는 단계를 표시합니다.

예제

Stepper 스테퍼: 애플리케이션이 제어하는 단계

사용법

애플리케이션이 제어하는 단계

단계를 클릭하면 이동을 요청합니다. 완료, 오류 및 사용 가능 여부는 현재 단계와 독립적으로 유지됩니다.

#include <FluentQt/Navigation.h>
using namespace fluent::navigation;

auto* stepper = new Stepper(this);
const QVector<QPair<QString, QString>> steps{
    {"Account", "Basic info"}, {"Workspace", "Select tier"},
    {"Billing", "Payment method"}, {"Review", "Confirm setup"}
};
for (int i = 0; i < steps.size(); ++i) {
    StepperItem item(steps[i].first, steps[i].second);
    if (i == 0) item.state = Stepper::Completed;
    if (i == 3) item.enabled = false;
    stepper->addItem(item);
}
stepper->setCurrentIndex(1);
connect(stepper, &Stepper::stepRequested, stepper, &Stepper::setCurrentIndex);
connect(stepper, &Stepper::currentIndexChanged, statusLabel, [statusLabel](int i) {
    statusLabel->setText(QString("Current step: %1").arg(i + 1));
});
connect(toggleError, &Button::clicked, stepper, [stepper] {
    stepper->setItemState(1, stepper->itemAt(1).state == Stepper::Error ? Stepper::Pending : Stepper::Error);
});

fluent::navigation::Stepper

상속 대상 QWidget · FluentElement · QMLPlus

호출자가 상태를 제어하는 다단계 진행률 표시기입니다. 클릭 시 stepRequested()만 발생하며, 현재 단계와 완료 또는 오류 상태는 메서드를 통해 업데이트합니다.

생성자

소멸자

열거형

enum State

애플리케이션에서 관리하는 단계 완료 상태입니다.

  • Pending
  • Completed
  • Error

메서드

bool setItem(int index, const StepperItem& item)

현재 인덱스를 이동하지 않고 단계 메타데이터를 업데이트합니다.

void setCurrentIndex(int index)

현재 단계 인덱스를 설정하거나 (비활성화된 단계 포함) -1을 전달하여 지웁니다. 범위를 벗어난 인덱스는 무시됩니다.

QRect itemGeometry(int index) const

이 위젯 좌표계에서의 단계 지오메트리를 반환합니다.

속성

int itemCount
읽기 itemCount()알림 신호 itemCountChanged()
int currentIndex
읽기 currentIndex()쓰기 setCurrentIndex()알림 신호 currentIndexChanged()
Qt::Orientation orientation
읽기 orientation()쓰기 setOrientation()알림 신호 orientationChanged()
bool animationEnabled
읽기 isAnimationEnabled()쓰기 setAnimationEnabled()알림 신호 animationEnabledChanged()

시그널

void stepRequested(int index)

탐색을 요청하며, 호출자가 수락 여부를 결정합니다.

보호된 멤버

메서드

fluent::FluentElement에서 상속됨

열거형

enum Theme

디자인 토큰을 해석할 때 사용되는 전역 시각적 테마.

  • Light = 0
  • Dark = 1
  • HighContrast = 2

메서드

static void setTheme(Theme theme)

전역 테마를 업데이트하고 활성 FluentElement 인스턴스에 알립니다.

static void setThemeDeferred(Theme theme)

현재 상호 작용을 차단하지 않고 보이는 항목 우선의 일괄 테마 새로 고침을 예약합니다.

static Theme currentTheme()

현재 활성화된 전역 테마를 반환합니다.

static bool themeUsesDarkAppearance(Theme theme)

테마가 어두운 배경의 크롬 및 머티리얼 토큰을 사용하는지 여부를 반환합니다.

static void refreshTheme()

디자인 토큰 변경 후 다시 그리도록 현재 테마를 재브로드캐스트합니다.

static int themeGeneration()

유효성 검사를 위해 테마가 변경될 때마다 증가하는 단조 카운터.

Theme effectiveTheme() const

상속된 QWidget 재정의를 준수하여 이 요소에서 사용하는 테마를 확인합니다.

bool effectiveThemeUsesDarkAppearance() const

이 요소의 유효 테마가 어두운 배경의 크롬을 사용하는지 여부를 반환합니다.

bool setThemeOverrides(const QJsonObject& overrides)

이 요소의 희소 색상, 반경 및 글꼴 토큰 재정의를 교체합니다.

QJsonObject themeOverrides() const

이 요소에 지정된 재정의 설정을 반환합니다.

void clearThemeOverrides()

모든 토큰 필드를 전역 테마 기본값으로 복원합니다.

const Colors& themeColorsRef() const

빈번한 그리기 경로를 위한 활성 색상 세트의 무복사 접근.

Material::AcrylicToken themeAcrylic() const

재질, 고도 (elevation) 및 적응형 레이아웃 토큰.

QColor themeBackdrop(bool active) const

지정된 활성화 상태에 대한 창 chrome 배경색.

virtual void onThemeUpdated()

전역 테마가 변경된 후 호출됩니다.

타입 및 별칭

struct Colors

컴포넌트에 반환되는 디자인 토큰 스냅샷.

fluent::QMLPlus에서 상속됨

메서드

AnchorLayout::Anchors* anchors()

QWidget 호스트의 변경 가능한 앵커를 반환합니다.

void setState(const QString& name)

이름으로 등록된 상태를 적용하거나, @p name 값이 비어 있으면 기본 상태를 복원합니다. 알 수 없는 이름은 무시되며, 상태를 벗어날 때 기존 바인딩이 다시 시작됩니다.

void addState(const QMLState& state)

명명된 상태 정의를 등록하거나 교체합니다. 활성 상태를 교체하면 즉시 적용됩니다.

void evaluateStates()

등록 순서대로 상태 조건을 재평가하여 첫 번째로 일치하는 상태를 활성화하며, 일치하는 항목이 없으면 기본 상태를 활성화합니다. 종속성 속성이 알림을 보낼 때도 자동으로 실행되며, extend를 사용하는 파생 상태는 순환하거나 누락되지 않는 한 상위 상태의 변경 사항을 상속합니다.

QMLPlusRuntime* runtime()

이 호스트가 소유하고 지연 생성하는 상태 관찰자를 반환합니다.

void setAnchors(const AnchorLayout::Anchors& anchors)

모든 호스트 앵커를 교체하고 상위 레이아웃을 무효화합니다.

void resetAnchors()

모든 호스트 앵커를 지우고 부모 레이아웃을 무효화합니다.

void bind(const char* targetProp, QObject* source, const char* sourceProp, PropertyBinder::Direction dir = PropertyBinder::OneWay)

PropertyBinder::bind()를 통해 @p source의 @p sourceProp을 이 QWidget 호스트의 @p targetProp에 바인딩합니다.

void addTransition(const StateTransition& transition)

우선순위 순서대로 상태 전환을 등록합니다.

void setBehavior(const char* propertyName, const PropertyAnimation& animation)

writeProperty() 또는 바인딩을 통해 @p propertyName에 쓸 때 사용되는 기본 애니메이션을 설정합니다. 명시적 StateTransition 규칙이 우선하며, 직접 C++ setter 호출에는 애니메이션이 적용되지 않습니다.

void clearBehavior(const char* propertyName)

이후 관리되는 쓰기 작업의 기본 애니메이션을 제거합니다.

bool writeProperty(const char* propertyName, const QVariant& value)

바인딩을 제거하지 않고 Behavior를 통해 호스트 속성을 씁니다.

Qt 기본 클래스 문서: QWidget

fluent::navigation::StepperItem

단계의 텍스트, 아이콘, 상태 및 애플리케이션 데이터.

생성자

필드

메서드