Fluent-Qt

Scrolling

PipsPager

Dot-style pagination for moving through a small set of pages.

Example

PipsPager: PipsPager integrated with FlipView

Usage

PipsPager integrated with FlipView

The pager and FlipView keep their selected page indexes synchronized.

#include <FluentQt/Scrolling.h>
using namespace fluent::scrolling;

auto* flipView = new FlipView(this);
flipView->setShowPageIndicator(false);
for (QWidget* page : pages)
    flipView->addPage(page);

auto* pager = new PipsPager(this);
pager->setNumberOfPages(flipView->pageCount());
pager->setMaxVisiblePips(5);

connect(pager, &PipsPager::selectedPageIndexChanged,
        flipView, &FlipView::setCurrentIndex);
connect(flipView, &FlipView::currentIndexChanged,
        pager, &PipsPager::setSelectedPageIndex);

fluent::scrolling::PipsPager

Inherits QWidget · FluentElement · QMLPlus

Fluent page indicator with selectable pips and navigation buttons.

Constructors

Properties

int numberOfPages

Total number of pages represented by the pager.

Read numberOfPages()Write setNumberOfPages()Notify numberOfPagesChanged()
int selectedPageIndex

Currently selected page index.

Read selectedPageIndex()Write setSelectedPageIndex()Notify selectedPageIndexChanged()
int maxVisiblePips

Maximum number of page pips visible at once.

Read maxVisiblePips()Write setMaxVisiblePips()Notify maxVisiblePipsChanged()
Qt::Orientation orientation

Primary layout or motion orientation.

Read orientation()Write setOrientation()Notify orientationChanged()
PipsPagerButtonVisibility previousButtonVisibility

Visibility mode for the previous-page button.

Read previousButtonVisibility()Write setPreviousButtonVisibility()Notify previousButtonVisibilityChanged()
PipsPagerButtonVisibility nextButtonVisibility

Visibility mode for the next-page button.

Read nextButtonVisibility()Write setNextButtonVisibility()Notify nextButtonVisibilityChanged()
int pipCellSize

Layout cell size reserved for each pip.

Read pipCellSize()Write setPipCellSize()Notify pipCellSizeChanged()
int inactivePipDiameter

Diameter used by inactive pips.

Read inactivePipDiameter()Write setInactivePipDiameter()Notify inactivePipDiameterChanged()
int selectedPipDiameter

Diameter used by the selected pip.

Read selectedPipDiameter()Write setSelectedPipDiameter()Notify selectedPipDiameterChanged()
int navigationButtonSize

Size of pager navigation buttons.

Read navigationButtonSize()Write setNavigationButtonSize()Notify navigationButtonSizeChanged()
int navigationIconSize

Icon size used by pager navigation buttons.

Read navigationIconSize()Write setNavigationIconSize()Notify navigationIconSizeChanged()
bool selectionAnimationEnabled

Whether pip selection animation is enabled.

Read selectionAnimationEnabled()Write setSelectionAnimationEnabled()Notify selectionAnimationEnabledChanged()
int selectionAnimationDuration

Duration of pip selection animation in milliseconds.

Read selectionAnimationDuration()Write setSelectionAnimationDuration()Notify selectionAnimationDurationChanged()
qreal selectedVisualOffset

Shiboken maps every Q_PROPERTY to a Python constructor keyword. These two properties remain in the real Qt meta-object for C++ compatibility, but are implementation-only in the Python API.

Read selectedVisualOffset()Write setSelectedVisualOffset()
qreal visibleWindowOffset

Offset of the visible pip window.

Read visibleWindowOffset()Write setVisibleWindowOffset()

Methods

int numberOfPages() const

Total number of pages represented by the pager.

void setNumberOfPages(int pages)

Total number of pages represented by the pager.

int selectedPageIndex() const

Currently selected page index.

void setSelectedPageIndex(int index)

Currently selected page index.

int maxVisiblePips() const

Maximum number of page pips visible at once.

void setMaxVisiblePips(int count)

Maximum number of page pips visible at once.

Qt::Orientation orientation() const

Primary layout or motion orientation.

void setOrientation(Qt::Orientation orientation)

Primary layout or motion orientation.

PipsPagerButtonVisibility previousButtonVisibility() const

Visibility mode for the previous-page button.

PipsPagerButtonVisibility nextButtonVisibility() const

Visibility mode for the next-page button.

int pipCellSize() const

Layout cell size reserved for each pip.

void setPipCellSize(int size)

Layout cell size reserved for each pip.

int inactivePipDiameter() const

Diameter used by inactive pips.

void setInactivePipDiameter(int diameter)

Diameter used by inactive pips.

int selectedPipDiameter() const

Diameter used by the selected pip.

void setSelectedPipDiameter(int diameter)

Diameter used by the selected pip.

int navigationButtonSize() const

Size of pager navigation buttons.

void setNavigationButtonSize(int size)

Size of pager navigation buttons.

int navigationIconSize() const

Icon size used by pager navigation buttons.

void setNavigationIconSize(int size)

Icon size used by pager navigation buttons.

bool selectionAnimationEnabled() const

Whether pip selection animation is enabled.

void setSelectionAnimationEnabled(bool enabled)

Whether pip selection animation is enabled.

int selectionAnimationDuration() const

Duration of pip selection animation in milliseconds.

void setSelectionAnimationDuration(int durationMs)

Duration of pip selection animation in milliseconds.

Signals

void numberOfPagesChanged(int pages)

Total number of pages represented by the pager.

void selectedPageIndexChanged(int index)

Currently selected page index.

void maxVisiblePipsChanged(int count)

Maximum number of page pips visible at once.

void orientationChanged(Qt::Orientation orientation)

Primary layout or motion orientation.

void pipCellSizeChanged(int size)

Layout cell size reserved for each pip.

void inactivePipDiameterChanged(int diameter)

Diameter used by inactive pips.

void selectedPipDiameterChanged(int diameter)

Diameter used by the selected pip.

void navigationButtonSizeChanged(int size)

Size of pager navigation buttons.

void navigationIconSizeChanged(int size)

Icon size used by pager navigation buttons.

void selectionAnimationEnabledChanged(bool enabled)

Whether pip selection animation is enabled.

void selectionAnimationDurationChanged(int durationMs)

Duration of pip selection animation in milliseconds.

Enumerations

enum class PipsPagerButtonVisibility
  • Collapsed
  • Visible
  • VisibleOnPointerOver

Destructors

Subclass interfaces

Methods

Inherited from fluent::FluentElement

Methods

static void setTheme(Theme theme)

Updates the global theme and notifies active FluentElement instances.

static void setThemeDeferred(Theme theme)

Schedules a visible-first batched theme refresh without blocking the current interaction.

static Theme currentTheme()

Returns the currently active global theme.

static bool themeUsesDarkAppearance(Theme theme)

Returns whether a theme uses dark-backed chrome and material tokens.

static void refreshTheme()

Re-broadcasts the current theme to repaint after a design-token change.

static int themeGeneration()

Monotonic counter bumped on every theme change, for staleness checks.

Theme effectiveTheme() const

Resolves the theme used by this element, honoring an inherited QWidget override.

bool effectiveThemeUsesDarkAppearance() const

Returns whether this element's effective theme uses dark-backed chrome.

QJsonObject themeOverrides() const

Returns this element's authored overrides.

void clearThemeOverrides()

Restores all token fields to global theme defaults.

const Colors& themeColorsRef() const

Non-copying access to the active color set (for hot paint paths).

Material::AcrylicToken themeAcrylic() const

Material, elevation, and adaptive layout tokens.

QColor themeBackdrop(bool active) const

Window-chrome backdrop color for the given activation state.

virtual void onThemeUpdated()

Called after the global theme changes.

Enumerations

enum Theme

Global visual theme used when resolving design tokens.

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

Types and aliases

struct Colors

Design token snapshots returned to components.

Inherited from fluent::QMLPlus

Methods

AnchorLayout::Anchors* anchors()

Returns mutable anchors for the QWidget host.

void setState(const QString& name)

Applies a named state, or clears state when name is empty.

void addState(const QMLState& state)

Registers or replaces a named state definition.

void evaluateStates()

Reevaluates conditions; the first registered true condition wins.

QMLPlusRuntime* runtime()

Returns the lazy host-owned state observation object.

void setAnchors(const AnchorLayout::Anchors& anchors)

Replaces all host anchors and invalidates the parent layout.

void resetAnchors()

Clears all host anchors and invalidates the parent layout.

void addTransition(const StateTransition& transition)

Registers a state transition in precedence order.

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

Sets the default animation for this host's managed property writes.

void clearBehavior(const char* propertyName)

Removes the default animation for future managed writes.

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

Writes a host property through Behavior without removing its binding.

All inherited Qt members:QWidget