Skip to content

breadcrumb

_breadcrumb

Navigation breadcrumb widget.

Classes:

Name Description
FXBreadcrumb

A clickable breadcrumb trail for hierarchical navigation.

Classes

FXBreadcrumb

FXBreadcrumb(
    parent: Optional[QWidget] = None,
    separator: str = "chevron_right",
    home_icon: str = "home",
    show_navigation: bool = False,
    path_separator: str = "/",
    home_path: Optional[List[str]] = None,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets._breadcrumb.FXBreadcrumb[FXBreadcrumb]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets._breadcrumb.FXBreadcrumb
                


              click fxgui.fxwidgets._breadcrumb.FXBreadcrumb href "" "fxgui.fxwidgets._breadcrumb.FXBreadcrumb"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A clickable breadcrumb trail for hierarchical navigation.

This widget provides a navigation breadcrumb with clickable path segments, separator icons, and optional back/forward navigation. Double-click the breadcrumb to switch to edit mode for typing paths.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
separator
str

Icon name for separator between segments.

'chevron_right'
home_icon
str

Icon name for the home/root segment.

'home'
show_navigation
bool

Show back/forward navigation buttons.

False
path_separator
str

Character used to join path segments in edit mode.

'/'
home_path
Optional[List[str]]

Path segments to navigate to when home is clicked. If None, navigates to the first segment only.

None
Signals

segment_clicked: Emitted when a segment is clicked (index, path list). home_clicked: Emitted when the home segment is clicked. path_edited: Emitted when user submits a typed path (raw string). navigated_back: Emitted when navigating back in history. navigated_forward: Emitted when navigating forward in history.

Examples:

>>> breadcrumb = FXBreadcrumb(show_navigation=True)
>>> breadcrumb.set_path(["Home", "Projects", "MyProject", "Assets"])
>>> breadcrumb.segment_clicked.connect(
...     lambda idx, path: print(f"Navigate to: {'/'.join(path[:idx+1])}")
... )
>>> breadcrumb.path_edited.connect(lambda text: print(f"User typed: {text}"))

Methods:

Name Description
append_segment

Append a segment to the path.

can_go_back

Check if back navigation is available.

can_go_forward

Check if forward navigation is available.

clear

Clear the breadcrumb path.

clear_history

Clear the navigation history.

enterEvent

Brighten the strip: the pointer is somewhere over the path.

enter_edit_mode

Programmatically enter edit mode.

eventFilter

Handle escape key and focus loss to exit edit mode.

exit_edit_mode

Close the editor without submitting, as Escape does.

go_back

Navigate to the previous path in history.

go_forward

Navigate to the next path in history.

is_editing

Check if currently in edit mode.

leaveEvent

Return the strip to its resting fill: the pointer has left

navigate_to

Navigate to a specific path index, removing subsequent segments.

pop_segment

Remove and return the last segment.

set_path

Set the breadcrumb path.

Attributes:

Name Type Description
home_path Optional[List[str]]

Get the home path.

path List[str]

Return the current path segments.

Attributes
home_path property writable
home_path: Optional[List[str]]

Get the home path.

path property
path: List[str]

Return the current path segments.

Methods:
append_segment
append_segment(segment: str) -> None

Append a segment to the path.

Parameters:

Name Type Description Default
segment str

The segment string to append.

required
can_go_back
can_go_back() -> bool

Check if back navigation is available.

can_go_forward
can_go_forward() -> bool

Check if forward navigation is available.

clear
clear() -> None

Clear the breadcrumb path.

clear_history
clear_history() -> None

Clear the navigation history.

enterEvent
enterEvent(event) -> None

Brighten the strip: the pointer is somewhere over the path.

Brighten rather than fill. The strip carries STRIP_RESTING_TOKEN at all times, from construction onward, so what a hover changes is which of two fills it wears -- it is never bare.

Answered here rather than by a :hover rule in the style, because such a rule can only ever light the widget the pointer is DIRECTLY over -- which, once the path is drawn, is a segment and never the container. Measured: this widget keeps the pointer through a move onto one of its own segments and reports it lost only when it leaves for good, which is exactly when the fill should drop.

enter_edit_mode
enter_edit_mode() -> None

Programmatically enter edit mode.

eventFilter
eventFilter(obj, event)

Handle escape key and focus loss to exit edit mode.

While the editor is up this widget also filters the application, to catch a press that lands outside it: focus loss alone covers only a press that lands on something focusable, and a press on a heading, a tree's own header or the window's background moves no focus at all -- which left the editor open with the artist looking at a path they had already left.

exit_edit_mode
exit_edit_mode() -> None

Close the editor without submitting, as Escape does.

Public because a window-level Escape shortcut is delivered BEFORE the focused widget sees the key, so this widget's own Escape handling never fires while such a shortcut exists. A window that has one asks is_editing() and hands the key over by calling this.

go_back
go_back() -> bool

Navigate to the previous path in history.

Returns:

Type Description
bool

True if navigation occurred, False if at beginning of history.

go_forward
go_forward() -> bool

Navigate to the next path in history.

Returns:

Type Description
bool

True if navigation occurred, False if at end of history.

is_editing
is_editing() -> bool

Check if currently in edit mode.

leaveEvent
leaveEvent(event) -> None

Return the strip to its resting fill: the pointer has left for good. The fill is not removed, only dimmed.

navigate_to
navigate_to(index: int) -> None

Navigate to a specific path index, removing subsequent segments.

Parameters:

Name Type Description Default
index int

The index to navigate to.

required
pop_segment
pop_segment() -> Optional[str]

Remove and return the last segment.

Returns:

Type Description
Optional[str]

The removed segment, or None if path is empty.

set_path
set_path(path: List[str], record_history: bool = True) -> None

Set the breadcrumb path.

Parameters:

Name Type Description Default
path List[str]

List of path segment strings.

required
record_history bool

Whether to record this path in navigation history.

True

Functions: