Skip to content

fxwidgets

fxwidgets

Custom Qt widgets for fxgui.

This package provides a collection of custom Qt widgets built on top of qtpy, offering enhanced functionality and consistent styling for DCC applications.

Classes:

Name Description
FXAccordion

A multi-section collapsible accordion widget.

FXAccordionSection

Deprecated: Use FXCollapsibleWidget instead.

FXApplication

Customized QApplication class.

FXBreadcrumb

A clickable breadcrumb trail for hierarchical navigation.

FXCamelCaseValidator

Validator for camelCase without special characters or numbers.

FXCapitalizedLetterValidator

Validator for names that must start with a capital letter and contain

FXCodeBlock

A code block widget with syntax highlighting and theme-aware styling.

FXCollapsibleWidget

A widget that can expand or collapse its content.

FXColorLabelDelegate

A custom delegate to paint items with specific colors and icons based

FXDropZone

A drag and drop zone widget for file and folder selection.

FXElidedLabel

A QLabel that elides text with '...' when it doesn't fit.

FXFilePathWidget

A line edit with integrated browse button for file/folder selection.

FXFloatingDialog

A floating dialog that appears at the cursor's position.

FXFuzzySearchList

A searchable list widget with fuzzy matching capabilities.

FXFuzzySearchTree

A searchable tree widget with fuzzy matching capabilities.

FXIconLineEdit

A line edit that displays an icon on the left or right side.

FXItemDelegate

Minimal delegate that enables QIcon mode switching on hover/selection.

FXLettersUnderscoreValidator

Validator for letters and underscores, with optional numbers support.

FXLoadingOverlay

A loading overlay that blocks the parent widget.

FXLoadingSpinner

A themeable animated loading indicator.

FXLowerCaseValidator

Validator for lowercase letters only, with optional numbers and

FXMainWindow

Customized QMainWindow class.

FXNotificationBanner

Animated pop-up notification cards that slide in from the right.

FXOutputLogHandler

Custom logging handler that sends log messages to an output log widget.

FXOutputLogWidget

A reusable read-only output log widget for displaying application logs.

FXPasswordLineEdit

A custom widget that includes a password line edit with a show/hide button.

FXProgressCard

A card widget showing task/step progress.

FXRangeSlider

A slider with two handles for selecting a min/max range.

FXRatingWidget

A clickable star rating widget.

FXResizedScrollArea

A custom scroll area that emits a signal when resized.

FXSearchBar

An enhanced search input widget with built-in features.

FXSingleton

Metaclass for Qt classes that are singletons.

FXSortedTreeWidgetItem

Custom QTreeWidgetItem that provides natural sorting for strings

FXSplashScreen

Customized QSplashScreen class.

FXStatusBar

Customized QStatusBar class.

FXSystemTray

A system tray icon with a context menu.

FXTagChip

A single removable tag chip.

FXTagInput

A styled input widget that displays tags as removable chips.

FXThemeAware

Mixin that makes widgets automatically respond to theme changes.

FXThemeColors

Namespace for accessing theme colors with dot notation.

FXThemeManager

Singleton that emits theme_changed(str) when the theme changes.

FXThumbnailDelegate

Custom item delegate for showing thumbnails in tree/list views.

FXTimelineSlider

A timeline/scrubber widget perfect for DCC applications.

FXToggleSwitch

A modern iOS/Material-style animated toggle switch.

FXTooltip

A rich, theme-aware tooltip with advanced features.

FXTooltipManager

Global manager that intercepts standard Qt tooltips and shows FXTooltip instead.

FXTooltipPosition

Tooltip position relative to anchor widget.

FXValidatedLineEdit

A line edit that provides visual feedback when input is rejected.

FXWidget

Functions:

Name Description
set_tooltip

Attach an FXTooltip to a widget or item with a simple API.

Classes

FXAccordion

FXAccordion(
    parent: Optional[QWidget] = None,
    exclusive: bool = True,
    animation_duration: int = 150,
)

Bases: QWidget


              flowchart TD
              fxgui.fxwidgets.FXAccordion[FXAccordion]

              

              click fxgui.fxwidgets.FXAccordion href "" "fxgui.fxwidgets.FXAccordion"
            

A multi-section collapsible accordion widget.

Uses FXCollapsibleWidget for each section. By default, only one section can be open at a time (exclusive mode).

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
exclusive
bool

If True, only one section can be open at a time.

True
animation_duration
int

Duration of expand/collapse animation in ms.

150
Signals

section_expanded: Emitted when a section is expanded (section index). section_collapsed: Emitted when a section is collapsed (section index).

Examples:

>>> accordion = FXAccordion()
>>> accordion.add_section("General", general_content, icon="settings")
>>> accordion.add_section("Advanced", advanced_content, icon="tune")
>>> accordion.add_section("Info", info_content, icon="info")

Methods:

Name Description
__iter__

Iterate over sections.

__len__

Return the number of sections.

add_section

Add a new section to the accordion.

collapse_all

Collapse all sections.

collapse_section

Collapse a section by index.

expand_all

Expand all sections (only works if not exclusive).

expand_section

Expand a section by index.

get_section

Get a section by index.

remove_section

Remove a section by index.

Attributes:

Name Type Description
exclusive bool

Return whether accordion is in exclusive mode.

Attributes
exclusive property writable
exclusive: bool

Return whether accordion is in exclusive mode.

Functions
__iter__
__iter__()

Iterate over sections.

__len__
__len__() -> int

Return the number of sections.

add_section
add_section(
    title: str,
    content: Optional[Union[QWidget, QLayout]] = None,
    icon: Optional[str] = None,
) -> FXCollapsibleWidget

Add a new section to the accordion.

Parameters:

Name Type Description Default
title str

Section title.

required
content Optional[Union[QWidget, QLayout]]

Content widget or layout.

None
icon Optional[str]

Optional icon name for the header.

None

Returns:

Type Description
FXCollapsibleWidget

The created FXCollapsibleWidget.

collapse_all
collapse_all() -> None

Collapse all sections.

collapse_section
collapse_section(index: int) -> None

Collapse a section by index.

Parameters:

Name Type Description Default
index int

The section index to collapse.

required
expand_all
expand_all() -> None

Expand all sections (only works if not exclusive).

expand_section
expand_section(index: int) -> None

Expand a section by index.

Parameters:

Name Type Description Default
index int

The section index to expand.

required
get_section

Get a section by index.

Parameters:

Name Type Description Default
index int

The section index.

required

Returns:

Type Description
Optional[FXCollapsibleWidget]

The FXCollapsibleWidget or None if index is invalid.

remove_section
remove_section(index: int) -> None

Remove a section by index.

Parameters:

Name Type Description Default
index int

The section index to remove.

required

FXAccordionSection

FXAccordionSection(
    parent: Optional[QWidget] = None,
    title: str = "",
    icon: Optional[str] = None,
    animation_duration: int = 150,
)

Bases: FXCollapsibleWidget


              flowchart TD
              fxgui.fxwidgets.FXAccordionSection[FXAccordionSection]
              fxgui.fxwidgets._collapsible.FXCollapsibleWidget[FXCollapsibleWidget]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxwidgets._collapsible.FXCollapsibleWidget --> fxgui.fxwidgets.FXAccordionSection
                                fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets._collapsible.FXCollapsibleWidget
                



              click fxgui.fxwidgets.FXAccordionSection href "" "fxgui.fxwidgets.FXAccordionSection"
              click fxgui.fxwidgets._collapsible.FXCollapsibleWidget href "" "fxgui.fxwidgets._collapsible.FXCollapsibleWidget"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

Deprecated: Use FXCollapsibleWidget instead.

This class is kept for backward compatibility only.

FXApplication

FXApplication(*args, **kwargs)

Bases: QApplication


              flowchart TD
              fxgui.fxwidgets.FXApplication[FXApplication]

              

              click fxgui.fxwidgets.FXApplication href "" "fxgui.fxwidgets.FXApplication"
            

Customized QApplication class.

On initialization, the application loads the previously saved theme from persistent storage. If no theme was saved, defaults to "dark".

Methods:

Name Description
instance

Return the existing instance or create a new one if it doesn't

Functions
instance classmethod
instance(*args, **kwargs)

Return the existing instance or create a new one if it doesn't exist.

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.FXBreadcrumb[FXBreadcrumb]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

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


              click fxgui.fxwidgets.FXBreadcrumb href "" "fxgui.fxwidgets.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.

enter_edit_mode

Programmatically enter edit mode.

eventFilter

Handle escape key and focus loss to exit edit mode.

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.

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.

Functions
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.

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.

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.

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

FXCamelCaseValidator

FXCamelCaseValidator(parent=None)

Bases: QRegularExpressionValidator


              flowchart TD
              fxgui.fxwidgets.FXCamelCaseValidator[FXCamelCaseValidator]

              

              click fxgui.fxwidgets.FXCamelCaseValidator href "" "fxgui.fxwidgets.FXCamelCaseValidator"
            

Validator for camelCase without special characters or numbers.

This validator ensures input follows camelCase format: starts with a lowercase letter, followed by zero or more groups of an uppercase letter followed by lowercase letters.

Examples:

>>> from qtpy.QtWidgets import QLineEdit
>>> line_edit = QLineEdit()
>>> line_edit.setValidator(FXCamelCaseValidator())

FXCapitalizedLetterValidator

Bases: QValidator


              flowchart TD
              fxgui.fxwidgets.FXCapitalizedLetterValidator[FXCapitalizedLetterValidator]

              

              click fxgui.fxwidgets.FXCapitalizedLetterValidator href "" "fxgui.fxwidgets.FXCapitalizedLetterValidator"
            

Validator for names that must start with a capital letter and contain only letters.

This validator ensures the first character is uppercase and all characters are alphabetic.

Examples:

>>> from qtpy.QtWidgets import QLineEdit
>>> line_edit = QLineEdit()
>>> line_edit.setValidator(FXCapitalizedLetterValidator())

Methods:

Name Description
fixup

Automatically capitalize the first letter.

validate

Allow only letters and must start with a capital letter.

Functions
fixup
fixup(input_string: str) -> str

Automatically capitalize the first letter.

validate
validate(input_string: str, pos: int)

Allow only letters and must start with a capital letter.

FXCodeBlock

FXCodeBlock(
    code: str = "", language: str = "python", parent: Optional[QWidget] = None
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXCodeBlock[FXCodeBlock]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXCodeBlock
                


              click fxgui.fxwidgets.FXCodeBlock href "" "fxgui.fxwidgets.FXCodeBlock"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A code block widget with syntax highlighting and theme-aware styling.

This widget displays code with: - Syntax highlighting for 500+ languages via Pygments - Theme-aware background and text colors - Monospace font - Read-only, selectable text

Parameters:

Name Type Description Default
code
str

The code string to display.

''
language
str

The programming language (e.g., "python", "javascript").

'python'
parent
Optional[QWidget]

The parent widget.

None
Example

code = ''' ... def hello(): ... print("Hello, World!") ... ''' code_block = FXCodeBlock(code)

Methods:

Name Description
code

Get the current code.

set_code

Set the code to display.

set_language

Set the programming language for syntax highlighting.

Functions
code
code() -> str

Get the current code.

Returns:

Type Description
str

The code string.

set_code
set_code(code: str) -> None

Set the code to display.

Parameters:

Name Type Description Default
code str

The code string.

required
set_language
set_language(language: str) -> None

Set the programming language for syntax highlighting.

Parameters:

Name Type Description Default
language str

The language name. Supports 500+ languages via Pygments (e.g., "python", "javascript", "cpp", "rust", "go", "java"). Use get_supported_languages() to see all available options.

required

FXCollapsibleWidget

FXCollapsibleWidget(
    parent: Optional[QWidget] = None,
    title: str = "",
    icon: Optional[Union[QIcon, str]] = None,
    animation_duration: int = 150,
    max_content_height: int = 300,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXCollapsibleWidget[FXCollapsibleWidget]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXCollapsibleWidget
                


              click fxgui.fxwidgets.FXCollapsibleWidget href "" "fxgui.fxwidgets.FXCollapsibleWidget"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A widget that can expand or collapse its content.

The widget consists of a header with a toggle button and a content area that can be shown or hidden with an animation effect.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
title
str

Title displayed in the header.

''
icon
Optional[Union[QIcon, str]]

Optional icon to display before the title. Can be a QIcon, an icon name string (for fxicons), or None.

None
animation_duration
int

Duration of expand/collapse animation in ms.

150
max_content_height
int

Maximum height for content area when expanded (0 = no limit).

300
Signals

expanded: Emitted when the widget is expanded. collapsed: Emitted when the widget is collapsed.

Examples:

>>> from qtpy.QtWidgets import QLabel, QVBoxLayout
>>> collapsible = FXCollapsibleWidget(title="Settings")
>>> layout = QVBoxLayout()
>>> layout.addWidget(QLabel("Option 1"))
>>> layout.addWidget(QLabel("Option 2"))
>>> collapsible.set_content_layout(layout)
>>>
>>> # With an icon
>>> collapsible_with_icon = FXCollapsibleWidget(
...     title="Settings",
...     icon="settings"
... )

Initialize the collapsible section.

Methods:

Name Description
collapse

Collapse the widget to hide content.

expand

Expand the widget to show content.

get_icon

Get the current icon.

get_title

Get the current title text.

get_title_icon

Get the title icon (deprecated, use get_icon).

set_content_layout

Set the layout for the content area.

set_content_widget

Set the content widget directly.

set_icon

Set an icon to display before the title.

set_title

Set the title text.

set_title_icon

Set the title icon (deprecated, use set_icon).

toggle

Toggle the expanded/collapsed state.

Attributes:

Name Type Description
animation_duration int

Return the animation duration in milliseconds.

content_area QScrollArea

Return the content area (deprecated, use _content_area).

header_widget QFrame

Return the header widget (deprecated, use _header).

is_expanded bool

Return whether the widget is expanded.

max_content_height int

Return the maximum content height.

title str

Return the title text.

title_icon_label QLabel

Return the icon label (deprecated, use _icon_label).

title_label QLabel

Return the title label (deprecated, use _title_label).

toggle_button QToolButton

Return the toggle button (deprecated, use _toggle_btn).

Attributes
animation_duration property writable
animation_duration: int

Return the animation duration in milliseconds.

content_area property
content_area: QScrollArea

Return the content area (deprecated, use _content_area).

header_widget property
header_widget: QFrame

Return the header widget (deprecated, use _header).

is_expanded property
is_expanded: bool

Return whether the widget is expanded.

max_content_height property writable
max_content_height: int

Return the maximum content height.

title property
title: str

Return the title text.

title_icon_label property
title_icon_label: QLabel

Return the icon label (deprecated, use _icon_label).

title_label property
title_label: QLabel

Return the title label (deprecated, use _title_label).

toggle_button property
toggle_button: QToolButton

Return the toggle button (deprecated, use _toggle_btn).

Functions
collapse
collapse(animate: bool = True) -> None

Collapse the widget to hide content.

Parameters:

Name Type Description Default
animate bool

Whether to animate the collapse.

True
expand
expand(animate: bool = True) -> None

Expand the widget to show content.

Parameters:

Name Type Description Default
animate bool

Whether to animate the expansion.

True
get_icon
get_icon() -> Optional[QIcon]

Get the current icon.

Returns:

Type Description
Optional[QIcon]

The current icon, or None if no icon is set.

get_title
get_title() -> str

Get the current title text.

Returns:

Type Description
str

The current title text.

get_title_icon
get_title_icon() -> Optional[QIcon]

Get the title icon (deprecated, use get_icon).

set_content_layout
set_content_layout(content_layout: QLayout) -> None

Set the layout for the content area.

Parameters:

Name Type Description Default
content_layout QLayout

The layout to set for the content area.

required
set_content_widget
set_content_widget(widget: QWidget) -> None

Set the content widget directly.

Parameters:

Name Type Description Default
widget QWidget

The widget to display when expanded.

required
set_icon
set_icon(icon: Union[QIcon, str, None]) -> None

Set an icon to display before the title.

Parameters:

Name Type Description Default
icon Union[QIcon, str, None]

The icon to display. Can be: - A QIcon instance - A string icon name (resolved via fxicons.get_icon) - None to remove the icon

required

Examples:

>>> collapsible = FXCollapsibleWidget(title="Settings")
>>> collapsible.set_icon("settings")  # Using icon name
>>> collapsible.set_icon(QIcon("path/to/icon.png"))  # Using QIcon
>>> collapsible.set_icon(None)  # Remove icon
set_title
set_title(title: str) -> None

Set the title text.

Parameters:

Name Type Description Default
title str

The title text to display.

required
set_title_icon
set_title_icon(icon: Union[QIcon, str, None]) -> None

Set the title icon (deprecated, use set_icon).

toggle
toggle() -> None

Toggle the expanded/collapsed state.

FXColorLabelDelegate

FXColorLabelDelegate(
    colors_icons: Dict[str, Tuple[QColor, QColor, QColor, QIcon, bool]],
    parent: Optional[QWidget] = None,
    margin_left: int = 2,
    margin_top: Optional[int] = None,
    margin_bottom: Optional[int] = None,
)

Bases: FXThemeAware, QStyledItemDelegate


              flowchart TD
              fxgui.fxwidgets.FXColorLabelDelegate[FXColorLabelDelegate]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXColorLabelDelegate
                


              click fxgui.fxwidgets.FXColorLabelDelegate href "" "fxgui.fxwidgets.FXColorLabelDelegate"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A custom delegate to paint items with specific colors and icons based on their text content.

Note

This delegate automatically refreshes when the theme changes, ensuring that default colors (for items without explicit color mappings) stay in sync with the current theme.

Initializes the delegate with a dictionary of colors and icons.

Parameters:

Name Type Description Default
colors_icons
Dict[str, Tuple[QColor, QColor, QColor, QIcon, bool]]

A dictionary where keys are text patterns and values are tuples containing background color, border color, text/icon color, icon, and a boolean indicating if the icon should be colored.

required
parent
Optional[QWidget]

The parent object.

None
margin_left
int

The left margin for the text and icon. Defaults to 2.

2
margin_top
Optional[int]

The top margin for the text and icon. Defaults to margin_left.

None
margin_bottom
Optional[int]

The bottom margin for the text and icon. Defaults to margin_left.

None

Methods:

Name Description
paint

Paints the item with the specified colors and icons.

sizeHint

Provides the size hint for the item.

Functions
paint
paint(
    painter: QPainter, option: QStyleOptionViewItem, index: QModelIndex
) -> None

Paints the item with the specified colors and icons.

Parameters:

Name Type Description Default
painter QPainter

The painter used to draw the item.

required
option QStyleOptionViewItem

The style options for the item.

required
index QModelIndex

The model index of the item.

required
sizeHint
sizeHint(option: QStyleOptionViewItem, index: QModelIndex) -> QSize

Provides the size hint for the item.

Parameters:

Name Type Description Default
option QStyleOptionViewItem

The style options for the item.

required
index QModelIndex

The model index of the item.

required

Returns:

Type Description
QSize

The size hint for the item.

FXDropZone

FXDropZone(
    parent: Optional[QWidget] = None,
    title: str = "Drag and Drop Files Here",
    description: str = "or use the Browse Files... button below",
    accept_mode: str = "files",
    extensions: Optional[Set[str]] = None,
    multiple: bool = True,
    icon_name: str = "upload_file",
    show_formats: bool = True,
    show_buttons: bool = True,
    show_tree: bool = True,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXDropZone[FXDropZone]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXDropZone
                


              click fxgui.fxwidgets.FXDropZone href "" "fxgui.fxwidgets.FXDropZone"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A drag and drop zone widget for file and folder selection.

This widget provides a visual drop target for files and folders with: - Drag and drop support with visual feedback - Optional browse and clear buttons (external to drop area) - Customizable accepted extensions with display - Support for files, folders, or both - Visual states: default, hover, drag-active - Built-in tree view that appears after files are dropped - Tree view also accepts drag & drop for additional files - Context menu for removing individual files

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
title
str

Main title text displayed in the drop zone.

'Drag and Drop Files Here'
description
str

Description text displayed below the title.

'or use the Browse Files... button below'
accept_mode
str

What to accept - 'files', 'folders', or 'both'.

'files'
extensions
Optional[Set[str]]

Set of allowed file extensions (e.g., {'.png', '.jpg'}). If None, all extensions are accepted.

None
multiple
bool

Whether to allow multiple file/folder selection.

True
icon_name
str

Icon name to display (default: 'upload_file').

'upload_file'
show_formats
bool

Whether to display accepted formats below title.

True
show_buttons
bool

Whether to show Browse/Clear buttons.

True
show_tree
bool

Whether to show file tree after files are dropped.

True
Signals

files_dropped: Emitted when files/folders are dropped or selected. Passes a list of Path objects. files_cleared: Emitted when files are cleared. file_removed: Emitted when a single file is removed from the tree. Passes the Path that was removed. drag_entered: Emitted when a valid drag enters the drop zone. drag_left: Emitted when a drag leaves the drop zone.

Examples:

>>> # Accept image files only with tree view
>>> drop_zone = FXDropZone(
...     title="Drop Images Here",
...     description="or use the Browse Files... button below",
...     extensions={'.png', '.jpg', '.exr'},
...     show_tree=True
... )
>>> drop_zone.files_dropped.connect(lambda paths: print(paths))
>>>
>>> # Accept folders only (no tree)
>>> folder_zone = FXDropZone(
...     title="Drop Project Folder",
...     accept_mode='folders',
...     show_tree=False
... )

Methods:

Name Description
add_files

Add files to the current selection programmatically.

clear

Clear the drop zone state (programmatic clear).

eventFilter

Filter events for the drop area.

set_files

Set the selected files programmatically.

set_icon

Set the icon displayed in the drop zone.

show_file_tree

Show the file tree (hide placeholder).

show_placeholder

Show the drop placeholder (hide tree).

Attributes:

Name Type Description
accept_mode str

Return the accept mode.

description str

Return the description text.

extensions Optional[Set[str]]

Return the accepted extensions.

file_tree Optional[QTreeWidget]

Return the file tree widget (if show_tree is True).

has_files bool

Return whether files have been added.

multiple bool

Return whether multiple selection is enabled.

selected_files List[Path]

Return the list of selected files.

title str

Return the title text.

Attributes
accept_mode property writable
accept_mode: str

Return the accept mode.

description property writable
description: str

Return the description text.

extensions property writable
extensions: Optional[Set[str]]

Return the accepted extensions.

file_tree property
file_tree: Optional[QTreeWidget]

Return the file tree widget (if show_tree is True).

has_files property
has_files: bool

Return whether files have been added.

multiple property writable
multiple: bool

Return whether multiple selection is enabled.

selected_files property
selected_files: List[Path]

Return the list of selected files.

title property writable
title: str

Return the title text.

Functions
add_files
add_files(paths: List[Path]) -> None

Add files to the current selection programmatically.

Parameters:

Name Type Description Default
paths List[Path]

List of paths to add.

required
clear
clear() -> None

Clear the drop zone state (programmatic clear).

eventFilter
eventFilter(obj, event) -> bool

Filter events for the drop area.

set_files
set_files(paths: List[Path]) -> None

Set the selected files programmatically.

Parameters:

Name Type Description Default
paths List[Path]

List of paths to set as selected.

required
set_icon
set_icon(icon_name: str) -> None

Set the icon displayed in the drop zone.

Parameters:

Name Type Description Default
icon_name str

Name of the icon (from fxicons).

required
show_file_tree
show_file_tree() -> None

Show the file tree (hide placeholder).

show_placeholder
show_placeholder() -> None

Show the drop placeholder (hide tree).

FXElidedLabel

FXElidedLabel(text: str = '', parent: Optional[QWidget] = None)

Bases: QLabel


              flowchart TD
              fxgui.fxwidgets.FXElidedLabel[FXElidedLabel]

              

              click fxgui.fxwidgets.FXElidedLabel href "" "fxgui.fxwidgets.FXElidedLabel"
            

A QLabel that elides text with '...' when it doesn't fit.

This label automatically truncates text and adds an ellipsis when the text is too long to fit within the available space.

Methods:

Name Description
resizeEvent

Re-elide text when the label is resized.

setText

Set the text and store the full text for elision.

Functions
resizeEvent
resizeEvent(event) -> None

Re-elide text when the label is resized.

setText
setText(text: str) -> None

Set the text and store the full text for elision.

FXFilePathWidget

FXFilePathWidget(
    parent: Optional[QWidget] = None,
    mode: str = "file",
    placeholder: str = "Select path...",
    file_filter: str = "All Files (*)",
    default_path: Optional[str] = None,
    validate: bool = True,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXFilePathWidget[FXFilePathWidget]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXFilePathWidget
                


              click fxgui.fxwidgets.FXFilePathWidget href "" "fxgui.fxwidgets.FXFilePathWidget"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A line edit with integrated browse button for file/folder selection.

This widget provides: - File or folder mode selection - Drag & drop support - Path validation indicator - Browse button with file dialog

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
mode
str

Selection mode ('file', 'files', 'folder', 'save').

'file'
placeholder
str

Placeholder text.

'Select path...'
file_filter
str

File filter for file dialogs (e.g., "Images (.png .jpg)").

'All Files (*)'
default_path
Optional[str]

Default path for the file dialog.

None
validate
bool

Whether to show validation indicator.

True
Signals

path_changed: Emitted when the path changes. path_valid: Emitted with True/False when validation state changes.

Examples:

>>> path_widget = FXFilePathWidget(mode='file', file_filter="Python (*.py)")
>>> path_widget.path_changed.connect(lambda p: print(f"Path: {p}"))
>>>
>>> # Folder mode
>>> folder_widget = FXFilePathWidget(mode='folder')

Methods:

Name Description
clear

Clear the path input.

dragEnterEvent

Handle drag enter for file drops.

dropEvent

Handle file drop.

get_path

Return the current path.

is_valid

Return whether the current path is valid.

set_file_filter

Set the file filter.

set_mode

Set the selection mode.

set_path

Set the path.

Attributes:

Name Type Description
path str

Return the current path.

Attributes
path property writable
path: str

Return the current path.

Functions
clear
clear() -> None

Clear the path input.

dragEnterEvent
dragEnterEvent(event) -> None

Handle drag enter for file drops.

dropEvent
dropEvent(event) -> None

Handle file drop.

get_path
get_path() -> str

Return the current path.

is_valid
is_valid() -> bool

Return whether the current path is valid.

set_file_filter
set_file_filter(filter_str: str) -> None

Set the file filter.

Parameters:

Name Type Description Default
filter_str str

File filter string (e.g., "Images (.png .jpg)").

required
set_mode
set_mode(mode: str) -> None

Set the selection mode.

Parameters:

Name Type Description Default
mode str

Selection mode ('file', 'files', 'folder', 'save').

required
set_path
set_path(path: str) -> None

Set the path.

Parameters:

Name Type Description Default
path str

The file or folder path.

required

FXFloatingDialog

FXFloatingDialog(
    parent: Optional[QWidget] = None,
    icon: Optional[QPixmap] = None,
    title: Optional[str] = None,
    parent_package: Optional[int] = None,
    popup: bool = False,
)

Bases: FXThemeAware, QDialog


              flowchart TD
              fxgui.fxwidgets.FXFloatingDialog[FXFloatingDialog]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXFloatingDialog
                


              click fxgui.fxwidgets.FXFloatingDialog href "" "fxgui.fxwidgets.FXFloatingDialog"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A floating dialog that appears at the cursor's position. It closes when any mouse button except the right one is pressed.

Parameters:

Name Type Description Default
parent
QtWidget

Parent widget. Defaults to hou.qt.mainWindow().

None
icon
QPixmap

The QPixmap icon.

None
title
str

The dialog title.

None

Attributes:

Name Type Description
dialog_icon QIcon

The icon of the dialog.

dialog_title str

The title of the dialog.

drop_position QPoint

The drop position of the dialog.

dialog_position Tuple[int, int]

The position of the dialog.

parent_package int

Whether the dialog is standalone application, or belongs to a DCC parent.

popup bool

Whether the dialog is a popup or not.

Methods:

Name Description
closeEvent

Removes the parent of the dialog and closes it.

mousePressEvent

Closes the dialog when any mouse button except the right one is pressed.

set_dialog_icon

Sets the dialog's icon.

set_dialog_title

Sets the dialog's title.

show_under_cursor

Moves the dialog to the current cursor position and displays it.

Functions
closeEvent
closeEvent(event: QCloseEvent) -> None

Removes the parent of the dialog and closes it.

Parameters:

Name Type Description Default
event QCloseEvent

The close event.

required
mousePressEvent
mousePressEvent(event: QMouseEvent) -> None

Closes the dialog when any mouse button except the right one is pressed.

Parameters:

Name Type Description Default
event QMouseEvent

The mouse press event.

required
set_dialog_icon
set_dialog_icon(icon: Optional[QPixmap] = None) -> None

Sets the dialog's icon.

Parameters:

Name Type Description Default
icon QPixmap

The QPixmap icon.

None
set_dialog_title
set_dialog_title(title: str = None) -> None

Sets the dialog's title.

Parameters:

Name Type Description Default
title str

The title of the dialog.

None
show_under_cursor
show_under_cursor() -> int

Moves the dialog to the current cursor position and displays it.

Returns:

Name Type Description
int int

The result of the QDialog exec_() method, which is an integer. It returns a DialogCode that can be Accepted or Rejected.

FXFuzzySearchList

FXFuzzySearchList(
    parent: Optional[QWidget] = None,
    placeholder: str = "Search...",
    ratio: float = 0.5,
    show_ratio_slider: bool = False,
    color_match: bool = True,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXFuzzySearchList[FXFuzzySearchList]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXFuzzySearchList
                


              click fxgui.fxwidgets.FXFuzzySearchList href "" "fxgui.fxwidgets.FXFuzzySearchList"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A searchable list widget with fuzzy matching capabilities.

This widget combines a search bar with a list view that uses fuzzy matching to filter and sort items by relevance. Items are colored based on their match quality (green for good matches, red for poor matches).

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
placeholder
str

Placeholder text for the search input.

'Search...'
ratio
float

Initial similarity ratio threshold (0.0 to 1.0).

0.5
show_ratio_slider
bool

Whether to show the ratio adjustment slider.

False
color_match
bool

Whether to color items based on match quality.

True
Signals

item_selected: Emitted when an item is clicked. Passes the item text. item_double_clicked: Emitted when an item is double-clicked. Passes the item text. item_activated: Emitted when Enter is pressed on an item. Passes the item text. selection_changed: Emitted when the selection changes. Passes a list of selected item texts.

Examples:

Basic usage with a list of strings:

>>> fuzzy_list = FXFuzzySearchList(placeholder="Search fruits...")
>>> fuzzy_list.set_items(["apple", "apricot", "banana", "cherry"])
>>> fuzzy_list.item_selected.connect(lambda text: print(f"Selected: {text}"))

With ratio slider for user adjustment:

>>> fuzzy_list = FXFuzzySearchList(show_ratio_slider=True, ratio=0.6)
>>> fuzzy_list.set_items(["character_hero", "character_villain", "prop_chair"])

Methods:

Name Description
add_item

Add a single item to the list.

clear

Clear all items from the list.

clear_search

Clear the search input.

remove_item

Remove an item from the list by its text.

select_item

Select an item by its text.

setFocus

Set focus to the search input.

set_color_match

Enable or disable color-coded match quality.

set_items

Set the list items from a list of strings.

set_placeholder

Set the search bar placeholder text.

set_selection_mode

Set the list view selection mode.

show_ratio_slider

Show or hide the ratio adjustment slider.

Attributes:

Name Type Description
current_item Optional[str]

Return the current item text.

items List[str]

Return all items in the source model.

list_view QListView

Return the list view for advanced customization.

proxy_model FXSortFilterProxyModel

Return the proxy model for advanced customization.

ratio float

Return the current similarity ratio threshold.

search_text str

Return the current search text.

selected_items List[str]

Return currently selected items.

source_model QStandardItemModel

Return the source model for advanced customization.

visible_items List[str]

Return currently visible (filtered) items.

Attributes
current_item property
current_item: Optional[str]

Return the current item text.

Returns:

Type Description
Optional[str]

The current item text, or None if no item is current.

items property
items: List[str]

Return all items in the source model.

Returns:

Type Description
List[str]

List of all item texts.

list_view property
list_view: QListView

Return the list view for advanced customization.

Returns:

Type Description
QListView

The underlying QListView.

proxy_model property

Return the proxy model for advanced customization.

Returns:

Type Description
FXSortFilterProxyModel

The underlying FXSortFilterProxyModel.

ratio property writable
ratio: float

Return the current similarity ratio threshold.

Returns:

Type Description
float

The ratio threshold (0.0 to 1.0).

search_text property writable
search_text: str

Return the current search text.

Returns:

Type Description
str

The current search text.

selected_items property
selected_items: List[str]

Return currently selected items.

Returns:

Type Description
List[str]

List of selected item texts.

source_model property
source_model: QStandardItemModel

Return the source model for advanced customization.

Returns:

Type Description
QStandardItemModel

The underlying QStandardItemModel.

visible_items property
visible_items: List[str]

Return currently visible (filtered) items.

Returns:

Type Description
List[str]

List of visible item texts.

Functions
add_item
add_item(text: str) -> None

Add a single item to the list.

Parameters:

Name Type Description Default
text str

The item text to add.

required
clear
clear() -> None

Clear all items from the list.

clear_search() -> None

Clear the search input.

remove_item
remove_item(text: str) -> bool

Remove an item from the list by its text.

Parameters:

Name Type Description Default
text str

The item text to remove.

required

Returns:

Type Description
bool

True if the item was found and removed, False otherwise.

select_item
select_item(text: str) -> bool

Select an item by its text.

Parameters:

Name Type Description Default
text str

The item text to select.

required

Returns:

Type Description
bool

True if the item was found and selected, False otherwise.

setFocus
setFocus() -> None

Set focus to the search input.

set_color_match
set_color_match(enabled: bool) -> None

Enable or disable color-coded match quality.

Parameters:

Name Type Description Default
enabled bool

Whether to enable color matching.

required
set_items
set_items(items: List[str]) -> None

Set the list items from a list of strings.

Parameters:

Name Type Description Default
items List[str]

List of strings to display.

required
set_placeholder
set_placeholder(text: str) -> None

Set the search bar placeholder text.

Parameters:

Name Type Description Default
text str

The placeholder text.

required
set_selection_mode
set_selection_mode(mode: SelectionMode) -> None

Set the list view selection mode.

Parameters:

Name Type Description Default
mode SelectionMode

The selection mode (e.g., SingleSelection, ExtendedSelection).

required
show_ratio_slider
show_ratio_slider(visible: bool = True) -> None

Show or hide the ratio adjustment slider.

Parameters:

Name Type Description Default
visible bool

Whether to show the slider.

True

FXFuzzySearchTree

FXFuzzySearchTree(
    parent: Optional[QWidget] = None,
    placeholder: str = "Search...",
    ratio: float = 0.5,
    show_ratio_slider: bool = False,
    color_match: bool = True,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXFuzzySearchTree[FXFuzzySearchTree]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXFuzzySearchTree
                


              click fxgui.fxwidgets.FXFuzzySearchTree href "" "fxgui.fxwidgets.FXFuzzySearchTree"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A searchable tree widget with fuzzy matching capabilities.

This widget combines a search bar with a tree view that uses fuzzy matching to filter and sort items by relevance. Items are colored based on their match quality (green for good matches, red for poor matches).

The tree supports hierarchical data with parent-child relationships. When filtering, parent items remain visible if any of their children match.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
placeholder
str

Placeholder text for the search input.

'Search...'
ratio
float

Initial similarity ratio threshold (0.0 to 1.0).

0.5
show_ratio_slider
bool

Whether to show the ratio adjustment slider.

False
color_match
bool

Whether to color items based on match quality.

True
Signals

item_selected: Emitted when an item is clicked. Passes the item text. item_double_clicked: Emitted when an item is double-clicked. Passes the item text. item_activated: Emitted when Enter is pressed on an item. Passes the item text. selection_changed: Emitted when the selection changes. Passes a list of selected item texts. item_expanded: Emitted when an item is expanded. Passes the item text. item_collapsed: Emitted when an item is collapsed. Passes the item text.

Examples:

Basic usage with hierarchical data:

>>> fuzzy_tree = FXFuzzySearchTree(placeholder="Search assets...")
>>> fuzzy_tree.add_item("Characters")
>>> fuzzy_tree.add_item("Hero", parent="Characters")
>>> fuzzy_tree.add_item("Villain", parent="Characters")
>>> fuzzy_tree.item_selected.connect(lambda text: print(f"Selected: {text}"))

With ratio slider for user adjustment:

>>> fuzzy_tree = FXFuzzySearchTree(show_ratio_slider=True, ratio=0.6)
>>> fuzzy_tree.set_items({
...     "Props": ["sword", "shield", "chair"],
...     "Vehicles": ["car", "truck", "motorcycle"],
... })

Methods:

Name Description
add_item

Add a single item to the tree.

clear

Clear all items from the tree.

clear_search

Clear the search input.

collapse_all

Collapse all items in the tree.

collapse_item

Collapse an item by its text.

expand_all

Expand all items in the tree.

expand_item

Expand an item by its text.

get_item

Get an item by its text.

remove_item

Remove an item from the tree by its text.

select_item

Select an item by its text.

setFocus

Set focus to the search input.

set_color_match

Enable or disable color-coded match quality.

set_items

Set the tree items from a list or dictionary.

set_placeholder

Set the search bar placeholder text.

set_selection_mode

Set the tree view selection mode.

show_ratio_slider

Show or hide the ratio adjustment slider.

Attributes:

Name Type Description
current_item Optional[str]

Return the current item text.

items List[str]

Return all item texts in the source model.

proxy_model FXSortFilterProxyModel

Return the proxy model for advanced customization.

ratio float

Return the current similarity ratio threshold.

search_text str

Return the current search text.

selected_items List[str]

Return currently selected items.

source_model QStandardItemModel

Return the source model for advanced customization.

top_level_items List[str]

Return top-level item texts.

tree_view QTreeView

Return the tree view for advanced customization.

Attributes
current_item property
current_item: Optional[str]

Return the current item text.

Returns:

Type Description
Optional[str]

The current item text, or None if no item is current.

items property
items: List[str]

Return all item texts in the source model.

Returns:

Type Description
List[str]

List of all item texts (including nested items).

proxy_model property

Return the proxy model for advanced customization.

Returns:

Type Description
FXSortFilterProxyModel

The underlying proxy model.

ratio property writable
ratio: float

Return the current similarity ratio threshold.

Returns:

Type Description
float

The ratio threshold (0.0 to 1.0).

search_text property writable
search_text: str

Return the current search text.

Returns:

Type Description
str

The current search text.

selected_items property
selected_items: List[str]

Return currently selected items.

Returns:

Type Description
List[str]

List of selected item texts.

source_model property
source_model: QStandardItemModel

Return the source model for advanced customization.

Returns:

Type Description
QStandardItemModel

The underlying QStandardItemModel.

top_level_items property
top_level_items: List[str]

Return top-level item texts.

Returns:

Type Description
List[str]

List of top-level item texts only.

tree_view property
tree_view: QTreeView

Return the tree view for advanced customization.

Returns:

Type Description
QTreeView

The underlying QTreeView.

Functions
add_item
add_item(
    text: str, parent: Optional[str] = None, data: Optional[dict] = None
) -> QStandardItem

Add a single item to the tree.

Parameters:

Name Type Description Default
text str

The item text to add.

required
parent Optional[str]

The parent item text. If None, adds as top-level item.

None
data Optional[dict]

Optional dictionary of user data to store on the item.

None

Returns:

Type Description
QStandardItem

The created QStandardItem.

clear
clear() -> None

Clear all items from the tree.

clear_search() -> None

Clear the search input.

collapse_all
collapse_all() -> None

Collapse all items in the tree.

collapse_item
collapse_item(text: str) -> bool

Collapse an item by its text.

Parameters:

Name Type Description Default
text str

The item text to collapse.

required

Returns:

Type Description
bool

True if the item was found and collapsed, False otherwise.

expand_all
expand_all() -> None

Expand all items in the tree.

expand_item
expand_item(text: str) -> bool

Expand an item by its text.

Parameters:

Name Type Description Default
text str

The item text to expand.

required

Returns:

Type Description
bool

True if the item was found and expanded, False otherwise.

get_item
get_item(text: str) -> Optional[QStandardItem]

Get an item by its text.

Parameters:

Name Type Description Default
text str

The item text to find.

required

Returns:

Type Description
Optional[QStandardItem]

The QStandardItem if found, None otherwise.

remove_item
remove_item(text: str) -> bool

Remove an item from the tree by its text.

Parameters:

Name Type Description Default
text str

The item text to remove.

required

Returns:

Type Description
bool

True if the item was found and removed, False otherwise.

select_item
select_item(text: str) -> bool

Select an item by its text.

Parameters:

Name Type Description Default
text str

The item text to select.

required

Returns:

Type Description
bool

True if the item was found and selected, False otherwise.

setFocus
setFocus() -> None

Set focus to the search input.

set_color_match
set_color_match(enabled: bool) -> None

Enable or disable color-coded match quality.

Parameters:

Name Type Description Default
enabled bool

Whether to enable color matching.

required
set_items
set_items(items: Union[List[str], Dict[str, List[str]]]) -> None

Set the tree items from a list or dictionary.

Parameters:

Name Type Description Default
items Union[List[str], Dict[str, List[str]]]

Either a flat list of strings (creates top-level items), or a dictionary where keys are parent items and values are lists of child items.

required
set_placeholder
set_placeholder(text: str) -> None

Set the search bar placeholder text.

Parameters:

Name Type Description Default
text str

The placeholder text.

required
set_selection_mode
set_selection_mode(mode: SelectionMode) -> None

Set the tree view selection mode.

Parameters:

Name Type Description Default
mode SelectionMode

The selection mode (e.g., SingleSelection, ExtendedSelection).

required
show_ratio_slider
show_ratio_slider(visible: bool = True) -> None

Show or hide the ratio adjustment slider.

Parameters:

Name Type Description Default
visible bool

Whether to show the slider.

True

FXIconLineEdit

FXIconLineEdit(
    icon_name: Optional[str] = None,
    icon_position: str = "left",
    parent: Optional[QWidget] = None,
)

Bases: FXThemeAware, QLineEdit


              flowchart TD
              fxgui.fxwidgets.FXIconLineEdit[FXIconLineEdit]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXIconLineEdit
                


              click fxgui.fxwidgets.FXIconLineEdit href "" "fxgui.fxwidgets.FXIconLineEdit"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A line edit that displays an icon on the left or right side.

The icon is theme-aware and will refresh automatically when the application theme changes.

Parameters:

Name Type Description Default
icon_name
Optional[str]

The name of the icon to display.

None
icon_position
str

The position of the icon ('left' or 'right').

'left'
parent
Optional[QWidget]

The parent widget.

None

Methods:

Name Description
resizeEvent

Reposition the icon when the line edit is resized.

Functions
resizeEvent
resizeEvent(event)

Reposition the icon when the line edit is resized.

FXItemDelegate

Bases: QStyledItemDelegate


              flowchart TD
              fxgui.fxwidgets.FXItemDelegate[FXItemDelegate]

              

              click fxgui.fxwidgets.FXItemDelegate href "" "fxgui.fxwidgets.FXItemDelegate"
            

Minimal delegate that enables QIcon mode switching on hover/selection.

Qt's default item view painting only uses QIcon.Selected for selected items. This delegate adds QIcon.Active support for hover states, making icons change color when items are hovered.

This is a drop-in replacement for QStyledItemDelegate with no layout changes. Apply it to any QListView, QTreeView, or QTableView for icon color switching.

Examples:

>>> from fxgui import fxwidgets
>>> list_widget = QListWidget()
>>> list_widget.setItemDelegate(fxwidgets.FXItemDelegate())

FXLettersUnderscoreValidator

FXLettersUnderscoreValidator(
    allow_numbers: bool = False, parent: Optional[QWidget] = None
)

Bases: QRegularExpressionValidator


              flowchart TD
              fxgui.fxwidgets.FXLettersUnderscoreValidator[FXLettersUnderscoreValidator]

              

              click fxgui.fxwidgets.FXLettersUnderscoreValidator href "" "fxgui.fxwidgets.FXLettersUnderscoreValidator"
            

Validator for letters and underscores, with optional numbers support.

Parameters:

Name Type Description Default
allow_numbers
bool

If True, allows numbers in addition to letters and underscores.

False
parent
Optional[QWidget]

Parent widget.

None

Examples:

>>> from qtpy.QtWidgets import QLineEdit
>>> line_edit = QLineEdit()
>>> line_edit.setValidator(FXLettersUnderscoreValidator(allow_numbers=True))

FXLoadingOverlay

FXLoadingOverlay(
    parent: Optional[QWidget] = None, message: Optional[str] = None
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXLoadingOverlay[FXLoadingOverlay]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXLoadingOverlay
                


              click fxgui.fxwidgets.FXLoadingOverlay href "" "fxgui.fxwidgets.FXLoadingOverlay"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A loading overlay that blocks the parent widget.

This widget creates a semi-transparent overlay with a loading spinner, useful for indicating that a long operation is in progress.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget to overlay.

None
message
Optional[str]

Optional message to display below the spinner.

None

Examples:

>>> overlay = FXLoadingOverlay(my_widget, "Loading assets...")
>>> overlay.show()
>>> # ... do some work ...
>>> overlay.hide()

Methods:

Name Description
hide

Hide the overlay and stop the spinner.

paintEvent

Paint the semi-transparent background.

resizeEvent

Handle parent resize.

show

Show the overlay and start the spinner.

Functions
hide
hide() -> None

Hide the overlay and stop the spinner.

paintEvent
paintEvent(event) -> None

Paint the semi-transparent background.

resizeEvent
resizeEvent(event) -> None

Handle parent resize.

show
show() -> None

Show the overlay and start the spinner.

FXLoadingSpinner

FXLoadingSpinner(
    parent: Optional[QWidget] = None,
    size: int = 32,
    line_width: int = 3,
    color: Optional[str] = None,
    style: str = "spinner",
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXLoadingSpinner[FXLoadingSpinner]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXLoadingSpinner
                


              click fxgui.fxwidgets.FXLoadingSpinner href "" "fxgui.fxwidgets.FXLoadingSpinner"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A themeable animated loading indicator.

This widget provides a modern spinning/pulsing loading indicator with customizable colors and animation styles.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
size
int

Size of the spinner in pixels.

32
line_width
int

Width of the spinner lines.

3
color
Optional[str]

Spinner color. If None, uses theme accent.

None
style
str

Animation style ('spinner', 'dots', 'pulse').

'spinner'

Examples:

>>> spinner = FXLoadingSpinner(size=32)
>>> spinner.start()
>>> # ... do some work ...
>>> spinner.stop()

Methods:

Name Description
angle

Set the rotation angle.

is_spinning

Return whether the spinner is currently animating.

paintEvent

Paint the loading spinner.

set_color

Set the spinner color.

set_style

Set the animation style.

start

Start the loading animation.

stop

Stop the loading animation.

Functions
angle
angle(value: int) -> None

Set the rotation angle.

is_spinning
is_spinning() -> bool

Return whether the spinner is currently animating.

paintEvent
paintEvent(event) -> None

Paint the loading spinner.

set_color
set_color(color: str) -> None

Set the spinner color.

Parameters:

Name Type Description Default
color str

Color string (hex, rgb, etc.).

required
set_style
set_style(style: str) -> None

Set the animation style.

Parameters:

Name Type Description Default
style str

Animation style ('spinner', 'dots', 'pulse').

required
start
start() -> None

Start the loading animation.

stop
stop() -> None

Stop the loading animation.

FXLowerCaseValidator

FXLowerCaseValidator(
    allow_numbers: bool = False,
    allow_underscores: bool = False,
    parent: Optional[QWidget] = None,
)

Bases: QRegularExpressionValidator


              flowchart TD
              fxgui.fxwidgets.FXLowerCaseValidator[FXLowerCaseValidator]

              

              click fxgui.fxwidgets.FXLowerCaseValidator href "" "fxgui.fxwidgets.FXLowerCaseValidator"
            

Validator for lowercase letters only, with optional numbers and underscores support.

Parameters:

Name Type Description Default
allow_numbers
bool

If True, allows numbers in addition to lowercase letters.

False
allow_underscores
bool

If True, allows underscores in addition to lowercase letters.

False
parent
Optional[QWidget]

Parent widget.

None

Examples:

>>> from qtpy.QtWidgets import QLineEdit
>>> line_edit = QLineEdit()
>>> line_edit.setValidator(FXLowerCaseValidator(allow_numbers=True))

FXMainWindow

FXMainWindow(
    parent: Optional[QWidget] = None,
    icon: Optional[str] = None,
    title: Optional[str] = None,
    size: Optional[Tuple[int, int]] = None,
    documentation: Optional[str] = None,
    project: Optional[str] = None,
    version: Optional[str] = None,
    company: Optional[str] = None,
    ui_file: Optional[str] = None,
    set_stylesheet: bool = True,
)

Bases: FXThemeAware, QMainWindow


              flowchart TD
              fxgui.fxwidgets.FXMainWindow[FXMainWindow]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXMainWindow
                


              click fxgui.fxwidgets.FXMainWindow href "" "fxgui.fxwidgets.FXMainWindow"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

Customized QMainWindow class.

Parameters:

Name Type Description Default
parent
QWidget

Parent widget. Defaults to hou.qt.mainWindow().

None
icon
str

Path to the window icon image. Defaults to None.

None
title
str

Title of the window. Defaults to None.

None
size
Tuple[int, int]

Window size as width and height. Defaults to None.

None
documentation
str

URL to the tool's documentation. Defaults to None.

None
version
str

Version label for the window. Defaults to None.

None
company
str

Company name for the window. Defaults to Company.

None
ui_file
str

Path to the UI file for loading. Defaults to None.

None
set_stylesheet
bool

Whether to set the default stylesheet. Defaults to True.

True

Methods:

Name Description
center_on_screen

Center the window on the primary screen.

closeEvent

Handle the window close event.

get_available_themes

Get a list of all available theme names.

hide_banner

Hides the banner.

hide_status_line

Hides the status line.

setCentralWidget

Override the QMainWindow's setCentralWidget method.

setWindowTitle

Override the setWindowTitle method.

set_banner_icon

Sets the icon of the banner.

set_banner_text

Sets the text of the banner.

set_company_label

Sets the company label in the status bar.

set_project_label

Sets the project label in the status bar.

set_status_line_colors

Set the colors of the status line.

set_theme

Set the theme of the window.

set_ui_file

Sets the UI file and loads the UI.

set_version_label

Sets the version label in the status bar.

show_banner

Shows the banner.

show_status_line

Shows the status line.

statusBar

Returns the FXStatusBar instance associated with this window.

toggle_theme

Toggle the theme of the window to the next available theme.

Functions
center_on_screen
center_on_screen() -> None

Center the window on the primary screen.

This method centers the window on the available screen geometry, accounting for taskbars and other system UI elements.

Examples:

>>> window = FXMainWindow()
>>> window.resize(800, 600)
>>> window.center_on_screen()
>>> window.show()
closeEvent
closeEvent(event: QCloseEvent) -> None

Handle the window close event.

Parameters:

Name Type Description Default
event QCloseEvent

The close event.

required
get_available_themes
get_available_themes() -> List[str]

Get a list of all available theme names.

Returns:

Type Description
List[str]

List[str]: List of theme names (e.g., ["dark", "light"]).

Examples:

>>> window = FXMainWindow()
>>> themes = window.get_available_themes()
>>> print(themes)  # ['dark', 'light']
hide_banner
hide_banner() -> None

Hides the banner.

hide_status_line
hide_status_line() -> None

Hides the status line.

setCentralWidget
setCentralWidget(widget: QWidget) -> None

Override the QMainWindow's setCentralWidget method.

Ensures that the status line is always at the bottom of the window and the banner is always at the top.

Parameters:

Name Type Description Default
widget QWidget

The widget to set as the central widget.

required
Note

Overrides the base class method.

setWindowTitle
setWindowTitle(title: str) -> None

Override the setWindowTitle method.

Parameters:

Name Type Description Default
title str

The new window title.

required
set_banner_icon
set_banner_icon(icon: Optional[Union[QIcon, str]], size: int = 20) -> None

Sets the icon of the banner.

Parameters:

Name Type Description Default
icon Optional[Union[QIcon, str]]

The icon to set in the banner. Can be a QIcon or an icon name string for theme-aware icons.

required
size int

The size of the icon. Defaults to 20.

20
Note

Using an icon name string (e.g., "widgets") is recommended for theme-aware icons that automatically update when the theme changes.

set_banner_text
set_banner_text(text: str) -> None

Sets the text of the banner.

Parameters:

Name Type Description Default
text str

The text to set in the banner.

required
set_company_label
set_company_label(company: str) -> None

Sets the company label in the status bar.

Parameters:

Name Type Description Default
company str

The company name.

required
set_project_label
set_project_label(project: str) -> None

Sets the project label in the status bar.

Parameters:

Name Type Description Default
project str

The project name.

required
set_status_line_colors
set_status_line_colors(color_a: str, color_b: str) -> None

Set the colors of the status line.

Parameters:

Name Type Description Default
color_a str

The first color of the gradient.

required
color_b str

The second color of the gradient.

required
set_theme
set_theme(theme: str) -> str

Set the theme of the window.

This method can be called from external code to apply a specific theme, including when running inside a DCC like Houdini, Maya, or Nuke where you don't have direct access to QApplication.

Parameters:

Name Type Description Default
theme str

The theme name to apply (e.g., "dark", "light", or custom).

required

Returns:

Name Type Description
str str

The theme that was applied.

Examples:

>>> window = FXMainWindow()
>>> window.show()
>>> window.set_theme("light")
>>> window.set_theme("dark")
set_ui_file
set_ui_file(ui_file: str) -> None

Sets the UI file and loads the UI.

Parameters:

Name Type Description Default
ui_file str

Path to the UI file to load.

required
set_version_label
set_version_label(version: str) -> None

Sets the version label in the status bar.

Parameters:

Name Type Description Default
version str

The version string.

required
show_banner
show_banner() -> None

Shows the banner.

show_status_line
show_status_line() -> None

Shows the status line.

statusBar
statusBar() -> FXStatusBar

Returns the FXStatusBar instance associated with this window.

Returns:

Name Type Description
FXStatusBar FXStatusBar

The FXStatusBar instance associated with this window.

Note

Overrides the base class method.

toggle_theme
toggle_theme() -> str

Toggle the theme of the window to the next available theme.

This method can be called from external code to cycle through themes, including when running inside a DCC like Houdini, Maya, or Nuke where you don't have direct access to QApplication.

Returns:

Name Type Description
str str

The new theme that was applied.

Examples:

>>> window = FXMainWindow()
>>> window.show()
>>> new_theme = window.toggle_theme()
>>> print(f"Switched to {new_theme} theme")

FXNotificationBanner

FXNotificationBanner(
    parent: Optional[QWidget] = None,
    message: str = "",
    severity_type: Optional[int] = None,
    timeout: int = 5000,
    action_text: Optional[str] = None,
    closable: bool = True,
    width: int = 320,
    logger: Optional[Logger] = None,
    title: Optional[str] = None,
    icon: Optional[str] = None,
    margin: int = 16,
    spacing: int = 8,
)

Bases: FXThemeAware, QFrame


              flowchart TD
              fxgui.fxwidgets.FXNotificationBanner[FXNotificationBanner]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXNotificationBanner
                


              click fxgui.fxwidgets.FXNotificationBanner href "" "fxgui.fxwidgets.FXNotificationBanner"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

Animated pop-up notification cards that slide in from the right.

This widget provides toast-style notifications with severity levels, auto-dismiss, and optional action buttons. Notifications automatically stack when multiple are shown and reposition when one is dismissed.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget (required for positioning).

None
message
str

The notification message.

''
severity_type
Optional[int]

Severity level (CRITICAL, ERROR, WARNING, SUCCESS, INFO, DEBUG). If None, a custom notification is shown using title and icon.

None
timeout
int

Auto-dismiss timeout in milliseconds (0 = no auto-dismiss).

5000
action_text
Optional[str]

Text for the optional action button.

None
closable
bool

Whether to show a close button.

True
width
int

Fixed width of the notification card (default 320).

320
logger
Optional[Logger]

A logger object to log the message when shown. The severity level is mapped to the appropriate logging level.

None
title
Optional[str]

Custom title for the notification. Overrides severity-based title.

None
icon
Optional[str]

Custom icon name for the notification. Overrides severity-based icon.

None
margin
int

Margin from the edges of the parent widget (default 16).

16
spacing
int

Spacing between stacked notifications (default 8).

8
Signals

closed: Emitted when the banner is closed. action_clicked: Emitted when the action button is clicked.

Examples:

>>> # Simple notification - auto-positions and stacks
>>> banner = FXNotificationBanner(
...     parent=window,
...     message="File saved successfully!",
...     severity_type=SUCCESS,
... )
>>> banner.show()
>>>
>>> # Custom notification
>>> banner = FXNotificationBanner(
...     parent=window,
...     message="New version available!",
...     title="Update",
...     icon="system_update",
... )
>>> banner.show()

Methods:

Name Description
dismiss

Dismiss the notification with slide-out animation to the right.

eventFilter

Handle parent resize events to reposition notifications.

set_message

Set the notification message.

set_timeout

Set the auto-dismiss timeout.

show

Show the notification with slide-in animation from the right.

Functions
dismiss
dismiss() -> None

Dismiss the notification with slide-out animation to the right.

eventFilter
eventFilter(obj, event) -> bool

Handle parent resize events to reposition notifications.

set_message
set_message(message: str) -> None

Set the notification message.

Parameters:

Name Type Description Default
message str

The new message text.

required
set_timeout
set_timeout(timeout: int) -> None

Set the auto-dismiss timeout.

Parameters:

Name Type Description Default
timeout int

Timeout in milliseconds (0 = no auto-dismiss).

required
show
show() -> None

Show the notification with slide-in animation from the right.

Automatically calculates position based on other active notifications for the same parent widget, stacking them vertically with spacing.

FXOutputLogHandler

FXOutputLogHandler(log_widget: FXOutputLogWidget)

Bases: Handler


              flowchart TD
              fxgui.fxwidgets.FXOutputLogHandler[FXOutputLogHandler]

              

              click fxgui.fxwidgets.FXOutputLogHandler href "" "fxgui.fxwidgets.FXOutputLogHandler"
            

Custom logging handler that sends log messages to an output log widget.

This handler is used internally by FXOutputLogWidget to capture log messages and display them in the widget.

Parameters:

Name Type Description Default
log_widget
FXOutputLogWidget

The FXOutputLogWidget to send messages to.

required

Methods:

Name Description
emit

Emit a log record to the output log widget.

Functions
emit
emit(record: LogRecord) -> None

Emit a log record to the output log widget.

FXOutputLogWidget

FXOutputLogWidget(
    parent: Optional[QWidget] = None, capture_output: bool = False
)

Bases: QWidget


              flowchart TD
              fxgui.fxwidgets.FXOutputLogWidget[FXOutputLogWidget]

              

              click fxgui.fxwidgets.FXOutputLogWidget href "" "fxgui.fxwidgets.FXOutputLogWidget"
            

A reusable read-only output log widget for displaying application logs.

This widget provides a text display area that captures and shows logging output from the application. It supports ANSI color codes, search functionality, and log throttling for performance.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
capture_output
bool

If True, adds a logging handler to capture log output from Python's logging module.

False
Signals

log_message: Emitted when a log message is received (for thread-safe delivery).

Examples:

>>> from fxgui import fxwidgets
>>> log_widget = fxwidgets.FXOutputLogWidget(capture_output=True)
>>> log_widget.show()

Initialize the output log widget.

Methods:

Name Description
append_log

Append text to the log output with ANSI color conversion.

clear_log

Clear the log output.

closeEvent

Handle widget close event to restore output streams.

keyPressEvent

Handle keyboard shortcuts.

restore_output_streams

Remove logging handler from all loggers where it was added.

Functions
append_log
append_log(text: str) -> None

Append text to the log output with ANSI color conversion.

Parameters:

Name Type Description Default
text str

Text to append (may contain ANSI color codes).

required
clear_log
clear_log() -> None

Clear the log output.

closeEvent
closeEvent(event: QCloseEvent) -> None

Handle widget close event to restore output streams.

keyPressEvent
keyPressEvent(event: QKeyEvent) -> None

Handle keyboard shortcuts.

restore_output_streams
restore_output_streams() -> None

Remove logging handler from all loggers where it was added.

FXPasswordLineEdit

FXPasswordLineEdit(
    parent: Optional[QWidget] = None, icon_position: str = "right"
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXPasswordLineEdit[FXPasswordLineEdit]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXPasswordLineEdit
                


              click fxgui.fxwidgets.FXPasswordLineEdit href "" "fxgui.fxwidgets.FXPasswordLineEdit"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A custom widget that includes a password line edit with a show/hide button.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

The parent widget.

None
icon_position
str

The position of the icon ('left' or 'right').

'right'

Methods:

Name Description
toggle_reveal

Toggles the echo mode between password and normal, and changes the

Functions
toggle_reveal
toggle_reveal()

Toggles the echo mode between password and normal, and changes the icon of the reveal button accordingly.

FXProgressCard

FXProgressCard(
    parent: Optional[QWidget] = None,
    title: str = "Task",
    description: Optional[str] = None,
    progress: int = 0,
    status: Optional[int] = None,
    show_percentage: bool = True,
    icon: Optional[str] = None,
)

Bases: FXThemeAware, QFrame


              flowchart TD
              fxgui.fxwidgets.FXProgressCard[FXProgressCard]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXProgressCard
                


              click fxgui.fxwidgets.FXProgressCard href "" "fxgui.fxwidgets.FXProgressCard"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A card widget showing task/step progress.

This widget provides a styled card with: - Title and description - Progress bar or circular progress - Status icon - Perfect for pipeline tools and task tracking

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
title
str

Card title.

'Task'
description
Optional[str]

Optional description text.

None
progress
int

Initial progress value (0-100).

0
status
Optional[int]

Status icon type (SUCCESS, ERROR, WARNING, INFO, etc.).

None
show_percentage
bool

Whether to show percentage text.

True
icon
Optional[str]

Optional icon name to display next to the title.

None
Signals

progress_changed: Emitted when progress changes. completed: Emitted when progress reaches 100%.

Examples:

>>> card = FXProgressCard(
...     title="Rendering",
...     description="Frame 50/100",
...     progress=50
... )
>>> card.set_progress(75)

Methods:

Name Description
increment

Increment the progress by a given amount.

reset

Reset progress to 0.

set_description

Set the card description.

set_progress

Set the progress value.

set_status

Set the status icon.

set_title

Set the card title.

Attributes:

Name Type Description
progress int

Return the current progress value.

Attributes
progress property writable
progress: int

Return the current progress value.

Functions
increment
increment(amount: int = 1) -> None

Increment the progress by a given amount.

Parameters:

Name Type Description Default
amount int

Amount to increment (default 1).

1
reset
reset() -> None

Reset progress to 0.

set_description
set_description(description: str) -> None

Set the card description.

Parameters:

Name Type Description Default
description str

The new description.

required
set_progress
set_progress(value: int) -> None

Set the progress value.

Parameters:

Name Type Description Default
value int

Progress value (0-100).

required
set_status
set_status(status: Optional[int]) -> None

Set the status icon.

Parameters:

Name Type Description Default
status Optional[int]

Status constant (SUCCESS, ERROR, WARNING, etc.) or None.

required
set_title
set_title(title: str) -> None

Set the card title.

Parameters:

Name Type Description Default
title str

The new title.

required

FXRangeSlider

FXRangeSlider(
    parent: Optional[QWidget] = None,
    minimum: int = 0,
    maximum: int = 100,
    low: Optional[int] = None,
    high: Optional[int] = None,
    show_values: bool = True,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXRangeSlider[FXRangeSlider]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXRangeSlider
                


              click fxgui.fxwidgets.FXRangeSlider href "" "fxgui.fxwidgets.FXRangeSlider"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A slider with two handles for selecting a min/max range.

This widget provides a dual-handle slider perfect for filtering values within a range (e.g., frame ranges, price ranges).

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
minimum
int

Minimum value of the range.

0
maximum
int

Maximum value of the range.

100
low
Optional[int]

Initial low value.

None
high
Optional[int]

Initial high value.

None
show_values
bool

Whether to show value labels.

True
Signals

range_changed: Emitted when either handle changes (low, high). low_changed: Emitted when the low value changes. high_changed: Emitted when the high value changes.

Examples:

>>> slider = FXRangeSlider(minimum=0, maximum=100)
>>> slider.range_changed.connect(lambda l, h: print(f"Range: {l}-{h}"))
>>> slider.set_range(25, 75)

Methods:

Name Description
leaveEvent

Handle mouse leave.

minimumSizeHint

Return the minimum size.

mouseMoveEvent

Handle mouse move.

mousePressEvent

Handle mouse press.

mouseReleaseEvent

Handle mouse release.

paintEvent

Paint the range slider.

set_maximum

Set the maximum value.

set_minimum

Set the minimum value.

set_range

Set both low and high values.

sizeHint

Return the preferred size.

Attributes:

Name Type Description
high int

Return the high value.

low int

Return the low value.

Attributes
high property writable
high: int

Return the high value.

low property writable
low: int

Return the low value.

Functions
leaveEvent
leaveEvent(event) -> None

Handle mouse leave.

minimumSizeHint
minimumSizeHint()

Return the minimum size.

mouseMoveEvent
mouseMoveEvent(event: QMouseEvent) -> None

Handle mouse move.

mousePressEvent
mousePressEvent(event: QMouseEvent) -> None

Handle mouse press.

mouseReleaseEvent
mouseReleaseEvent(event: QMouseEvent) -> None

Handle mouse release.

paintEvent
paintEvent(event) -> None

Paint the range slider.

set_maximum
set_maximum(maximum: int) -> None

Set the maximum value.

set_minimum
set_minimum(minimum: int) -> None

Set the minimum value.

set_range
set_range(low: int, high: int) -> None

Set both low and high values.

Parameters:

Name Type Description Default
low int

The low value.

required
high int

The high value.

required
sizeHint
sizeHint()

Return the preferred size.

FXRatingWidget

FXRatingWidget(
    parent: Optional[QWidget] = None,
    max_rating: int = 5,
    initial_rating: float = 0,
    allow_half: bool = False,
    icon_size: int = 20,
    filled_icon: str = "star",
    empty_icon: str = "star_border",
    half_icon: str = "star_half",
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXRatingWidget[FXRatingWidget]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXRatingWidget
                


              click fxgui.fxwidgets.FXRatingWidget href "" "fxgui.fxwidgets.FXRatingWidget"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A clickable star rating widget.

This widget provides a configurable star rating with: - Configurable max stars - Half-star support (optional) - Hover preview - Theme-aware icons

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
max_rating
int

Maximum number of stars.

5
initial_rating
float

Initial rating value.

0
allow_half
bool

Whether to allow half-star ratings.

False
icon_size
int

Size of star icons in pixels.

20
filled_icon
str

Icon name for filled stars.

'star'
empty_icon
str

Icon name for empty stars.

'star_border'
half_icon
str

Icon name for half-filled stars.

'star_half'
Signals

rating_changed: Emitted when the rating changes.

Examples:

>>> rating = FXRatingWidget(max_rating=5, initial_rating=3)
>>> rating.rating_changed.connect(lambda r: print(f"Rating: {r}"))

Methods:

Name Description
clear_rating

Clear the rating (set to 0).

enterEvent

Handle mouse enter.

get_rating

Return the current rating.

leaveEvent

Handle mouse leave to clear hover.

mouseMoveEvent

Handle mouse move for hover preview.

mousePressEvent

Handle mouse click to set rating.

set_rating

Set the rating value.

Attributes:

Name Type Description
rating float

Return the current rating.

Attributes
rating property writable
rating: float

Return the current rating.

Functions
clear_rating
clear_rating() -> None

Clear the rating (set to 0).

enterEvent
enterEvent(event) -> None

Handle mouse enter.

get_rating
get_rating() -> float

Return the current rating.

leaveEvent
leaveEvent(event) -> None

Handle mouse leave to clear hover.

mouseMoveEvent
mouseMoveEvent(event: QMouseEvent) -> None

Handle mouse move for hover preview.

mousePressEvent
mousePressEvent(event: QMouseEvent) -> None

Handle mouse click to set rating.

set_rating
set_rating(rating: float, emit: bool = True) -> None

Set the rating value.

Parameters:

Name Type Description Default
rating float

The rating value (0 to max_rating).

required
emit bool

Whether to emit the rating_changed signal.

True

FXResizedScrollArea

Bases: QScrollArea


              flowchart TD
              fxgui.fxwidgets.FXResizedScrollArea[FXResizedScrollArea]

              

              click fxgui.fxwidgets.FXResizedScrollArea href "" "fxgui.fxwidgets.FXResizedScrollArea"
            

A custom scroll area that emits a signal when resized.

This widget extends QScrollArea to emit a resized signal whenever the widget is resized, which is useful for responsive layouts.

Signals

resized: Emitted when the scroll area is resized.

Examples:

>>> scroll_area = FXResizedScrollArea()
>>> scroll_area.resized.connect(lambda: print("Resized!"))

Methods:

Name Description
resizeEvent

Emit the resized signal when the widget is resized.

Functions
resizeEvent
resizeEvent(event)

Emit the resized signal when the widget is resized.

FXSearchBar

FXSearchBar(
    parent: Optional[QWidget] = None,
    placeholder: str = "Search...",
    debounce_ms: int = 300,
    show_filter: bool = False,
    filters: Optional[list] = None,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXSearchBar[FXSearchBar]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXSearchBar
                


              click fxgui.fxwidgets.FXSearchBar href "" "fxgui.fxwidgets.FXSearchBar"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

An enhanced search input widget with built-in features.

This widget provides a search input with: - Search icon - Clear button - Optional filter dropdown - Debounced search signal for live filtering

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
placeholder
str

Placeholder text.

'Search...'
debounce_ms
int

Debounce delay in milliseconds for search_changed signal.

300
show_filter
bool

Whether to show the filter dropdown.

False
filters
Optional[list]

List of filter options for the dropdown.

None
Signals

search_changed: Emitted when the search text changes (debounced). search_submitted: Emitted when Enter is pressed. filter_changed: Emitted when the filter selection changes.

Examples:

>>> search = FXSearchBar(placeholder="Search assets...")
>>> search.search_changed.connect(lambda text: print(f"Searching: {text}"))
>>> search.set_filters(["All", "Models", "Textures", "Materials"])

Methods:

Name Description
clear

Clear the search input.

setFocus

Set focus to the search input.

set_filters

Set the filter dropdown options.

set_placeholder

Set the placeholder text.

show_filter

Show or hide the filter dropdown.

Attributes:

Name Type Description
filter str

Return the current filter selection.

text str

Return the current search text.

Attributes
filter property
filter: str

Return the current filter selection.

text property writable
text: str

Return the current search text.

Functions
clear
clear() -> None

Clear the search input.

setFocus
setFocus() -> None

Set focus to the search input.

set_filters
set_filters(filters: list) -> None

Set the filter dropdown options.

Parameters:

Name Type Description Default
filters list

List of filter option strings.

required
set_placeholder
set_placeholder(text: str) -> None

Set the placeholder text.

Parameters:

Name Type Description Default
text str

The placeholder text.

required
show_filter
show_filter(visible: bool = True) -> None

Show or hide the filter dropdown.

Parameters:

Name Type Description Default
visible bool

Whether to show the filter dropdown.

True

FXSingleton

FXSingleton(*args, **kwargs)

Bases: type(QObject)


              flowchart TD
              fxgui.fxwidgets.FXSingleton[FXSingleton]

              

              click fxgui.fxwidgets.FXSingleton href "" "fxgui.fxwidgets.FXSingleton"
            

Metaclass for Qt classes that are singletons.

This metaclass ensures that only one instance of each class can exist. If an instance already exists, it returns the existing instance instead of creating a new one. Each subclass gets its own singleton instance.

Examples:

>>> from fxgui import fxwidgets
>>>
>>> class MySingletonWindow(fxwidgets.FXMainWindow, metaclass=fxwidgets.FXSingleton):
...     pass
>>>
>>> window1 = MySingletonWindow()
>>> window2 = MySingletonWindow()
>>> assert window1 is window2  # Same instance

Methods:

Name Description
reset_instance

Reset the singleton instance. Useful for testing or cleanup.

Functions
reset_instance
reset_instance()

Reset the singleton instance. Useful for testing or cleanup.

FXSortedTreeWidgetItem

Bases: QTreeWidgetItem


              flowchart TD
              fxgui.fxwidgets.FXSortedTreeWidgetItem[FXSortedTreeWidgetItem]

              

              click fxgui.fxwidgets.FXSortedTreeWidgetItem href "" "fxgui.fxwidgets.FXSortedTreeWidgetItem"
            

Custom QTreeWidgetItem that provides natural sorting for strings containing numbers. This is useful for sorting items like version numbers or other strings where numeric parts should be ordered numerically.

For example, this class will sort the following strings in the correct human-friendly order:

  • "something1"
  • "something9"
  • "something17"
  • "something25"

Instead of the default sorting order:

  • "something1"
  • "something17"
  • "something25"
  • "something9"

Methods:

Name Description
__lt__

Override the less-than operator to provide a custom sorting logic.

Functions
__lt__

Override the less-than operator to provide a custom sorting logic.

Parameters:

Name Type Description Default
other FXSortedTreeWidgetItem

Another instance of FXSortedTreeWidgetItem to compare with.

required

Returns:

Type Description
bool

True if the current item is less than the other item according to

bool

the natural sort order, False otherwise.

FXSplashScreen

FXSplashScreen(
    image_path: Optional[str] = None,
    icon: Optional[str] = None,
    title: Optional[str] = None,
    information: Optional[str] = None,
    show_progress_bar: bool = False,
    project: Optional[str] = None,
    version: Optional[str] = None,
    company: Optional[str] = None,
    fade_in: bool = False,
    set_stylesheet: bool = True,
    overlay_opacity: float = 1.0,
    corner_radius: int = 0,
    border_width: int = 0,
    border_color: str = "#4a4949",
)

Bases: FXThemeAware, QSplashScreen


              flowchart TD
              fxgui.fxwidgets.FXSplashScreen[FXSplashScreen]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXSplashScreen
                


              click fxgui.fxwidgets.FXSplashScreen href "" "fxgui.fxwidgets.FXSplashScreen"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

Customized QSplashScreen class.

Methods:

Name Description
paintEvent

Override to draw the pixmap with rounded corners.

set_border

Set the border around the splash screen.

set_company_label

Set the company name for the splash screen.

set_corner_radius

Set the corner radius for rounded corners.

set_icon

Set the icon for the splash screen.

set_information_text

Set the information text for the splash screen.

set_overlay_opacity

Set the opacity of the grey overlay background.

set_pixmap

Set the pixmap for the splash screen.

set_progress

Set the progress value for the splash screen.

set_project_label

Set the project name for the splash screen.

set_title

Set the title for the splash screen.

set_version_label

Set the version information for the splash screen.

toggle_fade_in

Toggle the fade-in effect for the splash screen.

toggle_progress_bar_visibility

Toggle the visibility of the progress bar.

Functions
paintEvent
paintEvent(event) -> None

Override to draw the pixmap with rounded corners.

set_border
set_border(width: int, color: str = '#555555') -> None

Set the border around the splash screen.

Parameters:

Name Type Description Default
width int

The border width in pixels. Use 0 for no border.

required
color str

The border color as a hex string.

'#555555'
set_company_label
set_company_label(company: str) -> None

Set the company name for the splash screen.

Parameters:

Name Type Description Default
company str

The company name.

required
set_corner_radius
set_corner_radius(radius: int) -> None

Set the corner radius for rounded corners.

Parameters:

Name Type Description Default
radius int

The corner radius in pixels. Use 0 for sharp corners.

required
set_icon
set_icon(icon_path: str) -> None

Set the icon for the splash screen.

Parameters:

Name Type Description Default
icon_path str

The path to the icon file.

required
set_information_text
set_information_text(information: str) -> None

Set the information text for the splash screen.

Parameters:

Name Type Description Default
information str

The information text.

required
set_overlay_opacity
set_overlay_opacity(opacity: float) -> None

Set the opacity of the grey overlay background.

Parameters:

Name Type Description Default
opacity float

The opacity value between 0.0 (transparent) and 1.0 (opaque).

required
set_pixmap
set_pixmap(image_path: str) -> None

Set the pixmap for the splash screen.

Parameters:

Name Type Description Default
image_path str

The path to the image file.

required
set_progress
set_progress(value: int, max_range: int = 100)

Set the progress value for the splash screen.

Parameters:

Name Type Description Default
value int

The progress value.

required
max_range int

The maximum progress value. Defaults to 100.

100
set_project_label
set_project_label(project: str) -> None

Set the project name for the splash screen.

Parameters:

Name Type Description Default
project str

The project name.

required
set_title
set_title(title: str) -> None

Set the title for the splash screen.

Parameters:

Name Type Description Default
title str

The title string.

required
set_version_label
set_version_label(version: str) -> None

Set the version information for the splash screen.

Parameters:

Name Type Description Default
version str

The version string.

required
toggle_fade_in
toggle_fade_in(fade_in: bool) -> None

Toggle the fade-in effect for the splash screen.

Parameters:

Name Type Description Default
fade_in bool

Whether to fade in the splash screen.

required
toggle_progress_bar_visibility
toggle_progress_bar_visibility(show: bool) -> None

Toggle the visibility of the progress bar.

Parameters:

Name Type Description Default
show bool

Whether to show the progress bar.

required

FXStatusBar

FXStatusBar(
    parent: Optional[QWidget] = None,
    project: Optional[str] = None,
    version: Optional[str] = None,
    company: Optional[str] = None,
)

Bases: FXThemeAware, QStatusBar


              flowchart TD
              fxgui.fxwidgets.FXStatusBar[FXStatusBar]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXStatusBar
                


              click fxgui.fxwidgets.FXStatusBar href "" "fxgui.fxwidgets.FXStatusBar"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

Customized QStatusBar class.

Parameters:

Name Type Description Default
parent
QWidget

Parent widget. Defaults to None.

None
project
str

Project name. Defaults to None.

None
version
str

Version information. Defaults to None.

None
company
str

Company name. Defaults to None.

None

Attributes:

Name Type Description
project str

The project name.

version str

The version string.

company str

The company name.

icon_label QLabel

The icon label.

message_label QLabel

The message label.

project_label QLabel

The project label.

version_label QLabel

The version label.

company_label QLabel

The company label.

Methods:

Name Description
clearMessage

Clears the message from the status bar.

hide_status_line

Hide the status line and border line.

resizeEvent

Handle resize to position the status line and border correctly.

set_status_line_colors

Set the status line gradient colors.

showMessage

Display a message in the status bar with a specified severity.

show_status_line

Show the status line and border line.

Functions
clearMessage
clearMessage()

Clears the message from the status bar.

Note

Overrides the base class method.

hide_status_line
hide_status_line() -> None

Hide the status line and border line.

resizeEvent
resizeEvent(event) -> None

Handle resize to position the status line and border correctly.

set_status_line_colors
set_status_line_colors(color_a: str, color_b: str) -> None

Set the status line gradient colors.

Parameters:

Name Type Description Default
color_a str

The first color of the gradient.

required
color_b str

The second color of the gradient.

required
showMessage
showMessage(
    message: str,
    severity_type: int = 4,
    duration: float = 2.5,
    time: bool = True,
    logger: Optional[Logger] = None,
    set_color: bool = True,
    pixmap: Optional[QPixmap] = None,
    background_color: Optional[str] = None,
)

Display a message in the status bar with a specified severity.

Parameters:

Name Type Description Default
message str

The message to be displayed.

required
severity_type int

The severity level of the message. Should be one of CRITICAL, ERROR, WARNING, SUCCESS, INFO, or DEBUG. Defaults to INFO.

4
duration float

The duration in seconds for which the message should be displayed. Defaults to2.5.

2.5
time bool

Whether to display the current time before the message. Defaults to True.

True
logger Logger

A logger object to log the message. Defaults to None.

None
set_color bool

Whether to set the status bar color depending on the log verbosity. Defaults to True.

True
pixmap QPixmap

A custom pixmap to be displayed in the status bar. Defaults to None.

None
background_color str

A custom background color for the status bar. Defaults to None.

None

Examples:

To display a critical error message with a red background

>>> self.showMessage(
...     "Critical error occurred!",
...     severity_type=self.CRITICAL,
...     duration=5,
...     logger=my_logger,
... )
Note

You can either use the FXMainWindow instance to retrieve the verbosity constants, or the fxwidgets module. Overrides the base class method.

show_status_line
show_status_line() -> None

Show the status line and border line.

FXSystemTray

FXSystemTray(parent=None, icon=None)

Bases: QObject


              flowchart TD
              fxgui.fxwidgets.FXSystemTray[FXSystemTray]

              

              click fxgui.fxwidgets.FXSystemTray href "" "fxgui.fxwidgets.FXSystemTray"
            

A system tray icon with a context menu.

Parameters:

Name Type Description Default
parent
QWidget

The parent widget. Defaults to None.

None
icon
str

The icon path. Defaults to None.

None

Attributes:

Name Type Description
tray_icon QSystemTrayIcon

The system tray icon.

quit_action QAction

The action to quit the application.

tray_menu QMenu

The tray menu.

Methods:

Name Description
show

Shows the system tray icon.

on_tray_icon_activated

Shows the tray menu above the taskbar.

closeEvent

Closes the application.

Examples:

>>> app = FXApplication()
>>> system_tray = FXSystemTray()
>>> hello_action = QAction(
...     fxicons.get_icon("visibility"), "Set Project", system_tray
... )
>>> system_tray.tray_menu.insertAction(
...     system_tray.quit_action, hello_action
... )
>>> system_tray.tray_menu.insertSeparator(system_tray.quit_action)
>>> system_tray.show()
>>> app.exec_()
Note

Inherits from QObject, not QSystemTrayIcon.

Functions
add_action
add_action(action: QAction) -> None

Adds an action to the tray menu.

Parameters:

Name Type Description Default
action QAction

The action to add to the tray menu.

required
set_icon
set_icon(icon_path: str) -> None

Sets a new icon for the system tray.

Parameters:

Name Type Description Default
icon_path str

The path to the new icon.

required
show
show()

Shows the system tray icon.

FXTagChip

FXTagChip(text: str, parent: Optional[QWidget] = None, removable: bool = True)

Bases: FXThemeAware, QFrame


              flowchart TD
              fxgui.fxwidgets.FXTagChip[FXTagChip]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXTagChip
                


              click fxgui.fxwidgets.FXTagChip href "" "fxgui.fxwidgets.FXTagChip"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A single removable tag chip.

Parameters:

Name Type Description Default
text
str

The tag text.

required
parent
Optional[QWidget]

Parent widget.

None
removable
bool

Whether the chip can be removed.

True
Signals

removed: Emitted when the remove button is clicked.

Attributes:

Name Type Description
text str

Return the tag text.

Attributes
text property
text: str

Return the tag text.

FXTagInput

FXTagInput(
    parent: Optional[QWidget] = None,
    placeholder: str = "Add tag and press Enter...",
    max_tags: int = 0,
    allow_duplicates: bool = False,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXTagInput[FXTagInput]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXTagInput
                


              click fxgui.fxwidgets.FXTagInput href "" "fxgui.fxwidgets.FXTagInput"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A styled input widget that displays tags as removable chips.

This widget provides an input field where users can type and press Enter to add tags. Tags are displayed as styled chips that can be removed by clicking the × button.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
placeholder
str

Placeholder text for the input field.

'Add tag and press Enter...'
max_tags
int

Maximum number of tags allowed (0 = unlimited).

0
allow_duplicates
bool

Whether duplicate tags are allowed.

False
Signals

tags_changed: Emitted when tags are added or removed. tag_added: Emitted when a single tag is added. tag_removed: Emitted when a single tag is removed.

Examples:

>>> tag_input = FXTagInput(placeholder="Add tags...")
>>> tag_input.tags_changed.connect(lambda tags: print(f"Tags: {tags}"))
>>> tag_input.add_tag("python")
>>> tag_input.add_tag("qt")

Methods:

Name Description
add_tag

Add a tag to the input.

clear_tags

Remove all tags.

remove_tag

Remove a tag from the input.

set_tags

Set the tags, replacing any existing tags.

Attributes:

Name Type Description
tags List[str]

Return the list of current tags.

Attributes
tags property
tags: List[str]

Return the list of current tags.

Functions
add_tag
add_tag(tag: str) -> bool

Add a tag to the input.

Parameters:

Name Type Description Default
tag str

The tag text to add.

required

Returns:

Type Description
bool

True if the tag was added, False otherwise.

clear_tags
clear_tags() -> None

Remove all tags.

remove_tag
remove_tag(tag: str) -> bool

Remove a tag from the input.

Parameters:

Name Type Description Default
tag str

The tag text to remove.

required

Returns:

Type Description
bool

True if the tag was removed, False otherwise.

set_tags
set_tags(tags: List[str]) -> None

Set the tags, replacing any existing tags.

Parameters:

Name Type Description Default
tags List[str]

List of tag strings to set.

required

FXThemeAware

FXThemeAware(*args, **kwargs)

Mixin that makes widgets automatically respond to theme changes.

This mixin provides automatic theme updates for custom widgets. When the theme changes, connected widgets are notified and can update their appearance.

Usage
  1. Inherit from FXThemeAware FIRST: class MyWidget(FXThemeAware, QWidget)
  2. Override _on_theme_changed() to apply custom colors (optional)
  3. Use self.theme property to access current theme colors
  4. Optionally declare a theme_style class attribute for automatic QSS

Examples:

New API (recommended):

>>> from fxgui import fxstyle
>>> class FXMyWidget(FXThemeAware, QWidget):
...     # Option 1: Declarative QSS with color tokens
...     theme_style = '''
...         FXMyWidget {
...             background: @surface;
...             border: 1px solid @border;
...         }
...     '''
...
...     # Option 2: Programmatic colors in paintEvent
...     def paintEvent(self, event):
...         painter = QPainter(self)
...         painter.fillRect(self.rect(), QColor(self.theme.surface))

Legacy API (deprecated, still works):

>>> class FXMyWidget(FXThemeAware, QWidget):
...     def _apply_theme_styles(self):
...         colors = fxstyle.get_theme_colors()
...         self.setStyleSheet(f"background: {colors['surface']};")

Attributes:

Name Type Description
theme FXThemeColors

Property returning current theme colors as a FXThemeColors object.

theme_style str

Optional class attribute with QSS containing @color tokens.

Attributes
theme property

Get current theme colors as a namespace object.

Returns:

Type Description
FXThemeColors

FXThemeColors object with color attributes (e.g., theme.surface,

FXThemeColors

theme.accent_primary, theme.text).

Examples:

>>> def paintEvent(self, event):
...     painter = QPainter(self)
...     painter.fillRect(self.rect(), QColor(self.theme.surface))
...     painter.setPen(QColor(self.theme.text))
Functions
__apply_theme_style_attribute
__apply_theme_style_attribute() -> None

Process the theme_style class attribute and apply it.

__handle_theme_change
__handle_theme_change(_theme_name: str = None) -> None

Internal handler for theme changes.

FXThemeColors

FXThemeColors(colors_dict: dict)

Namespace for accessing theme colors with dot notation.

This class provides a convenient way to access theme colors using attribute access instead of dictionary lookup.

Examples:

>>> colors = FXThemeColors(fxstyle.get_theme_colors())
>>> colors.surface  # "#302f2f"
>>> colors.accent_primary  # "#2196F3"

Initialize with a colors dictionary.

Parameters:

Name Type Description Default
colors_dict
dict

Dictionary of color name to hex value mappings.

required
Functions

FXThemeManager

FXThemeManager()

Bases: QObject


              flowchart TD
              fxgui.fxwidgets.FXThemeManager[FXThemeManager]

              

              click fxgui.fxwidgets.FXThemeManager href "" "fxgui.fxwidgets.FXThemeManager"
            

Singleton that emits theme_changed(str) when the theme changes.

Methods:

Name Description
notify_theme_changed

Called by apply_theme() when theme changes.

Attributes:

Name Type Description
current_theme str

Return the current theme name.

Attributes
current_theme property
current_theme: str

Return the current theme name.

Functions
notify_theme_changed
notify_theme_changed(theme_name: str) -> None

Called by apply_theme() when theme changes.

FXThumbnailDelegate

FXThumbnailDelegate(parent: Optional[QWidget] = None)

Bases: FXThemeAware, QStyledItemDelegate


              flowchart TD
              fxgui.fxwidgets.FXThumbnailDelegate[FXThumbnailDelegate]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXThumbnailDelegate
                


              click fxgui.fxwidgets.FXThumbnailDelegate href "" "fxgui.fxwidgets.FXThumbnailDelegate"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

Custom item delegate for showing thumbnails in tree/list views.

This delegate displays items with thumbnails, titles, descriptions, and status indicators. It supports Markdown formatting in descriptions and tooltips. Additionally, it supports custom background colors via Qt.BackgroundRole with rounded corners and borders for visual hierarchy.

Note

Store data in items using the following roles: - Qt.BackgroundRole (QColor/QBrush): Custom background color with rounded corners and border. - Qt.DecorationRole (QIcon): Icon for items without thumbnails. - Qt.UserRole + 1 (bool): Whether to show the thumbnail. - Qt.UserRole + 2 (str): Path to the thumbnail image. - Qt.UserRole + 3 (str): Description text (supports Markdown). - Qt.UserRole + 4 (QColor): Status dot indicator color. - Qt.UserRole + 5 (QColor): Status label background color. - Qt.UserRole + 6 (str): Status label text. - Qt.UserRole + 7 (bool): Whether to show the status dot. - Qt.UserRole + 8 (bool): Whether to show the status label. - Qt.UserRole + 9 (QIcon): Status label icon (displayed before text).

Properties

show_thumbnail: Whether to show thumbnails globally. show_status_dot: Whether to show the status dot indicator globally. show_status_label: Whether to show the status label globally.

Note

Global properties and per-item roles work together: - An element is shown only if BOTH global property is True AND per-item role is True (or None/unset). - Setting per-item role to False hides that element for that item.

Note

When using custom backgrounds (Qt.BackgroundRole), call FXThumbnailDelegate.apply_transparent_selection(view) to disable the native Qt selection/hover highlighting, allowing the delegate's custom highlighting to be visible.

Examples:

>>> from fxgui import fxwidgets
>>> from qtpy.QtWidgets import QTreeWidget, QTreeWidgetItem
>>> from qtpy.QtCore import Qt
>>> from qtpy.QtGui import QColor
>>>
>>> tree = QTreeWidget()
>>> delegate = fxwidgets.FXThumbnailDelegate()
>>> delegate.show_thumbnail = True
>>> delegate.show_status_dot = True
>>> delegate.show_status_label = True
>>> tree.setItemDelegate(delegate)
>>>
>>> item = QTreeWidgetItem(tree, ["My Item"])
>>> item.setData(0, fxwidgets.FXThumbnailDelegate.THUMBNAIL_VISIBLE_ROLE, True)
>>> item.setData(0, fxwidgets.FXThumbnailDelegate.THUMBNAIL_PATH_ROLE, "/path/to/image.png")
>>> item.setData(0, fxwidgets.FXThumbnailDelegate.DESCRIPTION_ROLE, "**Bold** description")
>>> item.setData(0, fxwidgets.FXThumbnailDelegate.STATUS_DOT_COLOR_ROLE, QColor("green"))
>>> # Hide status dot for this specific item
>>> item.setData(0, fxwidgets.FXThumbnailDelegate.STATUS_DOT_VISIBLE_ROLE, False)
>>> # Custom background color with rounded corners and border
>>> item.setBackground(0, QColor("#252424"))

Initialize the thumbnail delegate.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

The parent widget.

None

Methods:

Name Description
apply_transparent_selection

Apply transparent selection stylesheet to a tree view widget.

helpEvent

Provide Markdown-formatted tooltips.

markdown_to_html

Convert Markdown text to HTML.

markdown_to_plain_text

Convert Markdown text to plain text by removing formatting.

paint

Paint the item with custom background, border, and hover/selection.

sizeHint

Return the size hint for the item at the given index.

Attributes:

Name Type Description
show_status_dot bool

Whether the status dot is shown.

show_status_label bool

Whether the status label is shown.

show_thumbnail bool

Whether thumbnails are shown globally.

Attributes
show_status_dot property writable
show_status_dot: bool

Whether the status dot is shown.

show_status_label property writable
show_status_label: bool

Whether the status label is shown.

show_thumbnail property writable
show_thumbnail: bool

Whether thumbnails are shown globally.

Individual items can override via THUMBNAIL_VISIBLE_ROLE.

Functions
apply_transparent_selection staticmethod
apply_transparent_selection(view: QWidget) -> None

Apply transparent selection stylesheet to a tree view widget.

This method disables the default Qt selection/hover backgrounds by applying a comprehensive stylesheet directly to the widget. The delegate handles all selection and hover highlighting itself.

Call this on QTreeView/QTreeWidget instances that use custom backgrounds with FXThumbnailDelegate.

Parameters:

Name Type Description Default
view QWidget

The tree view widget to apply transparent selection to.

required
helpEvent
helpEvent(
    event: QHelpEvent,
    view: QAbstractItemView,
    option: QStyleOptionViewItem,
    index: QModelIndex,
) -> bool

Provide Markdown-formatted tooltips.

Parameters:

Name Type Description Default
event QHelpEvent

The help event.

required
view QAbstractItemView

The view widget.

required
option QStyleOptionViewItem

Style options.

required
index QModelIndex

The model index.

required

Returns:

Type Description
bool

True if the event was handled.

markdown_to_html staticmethod
markdown_to_html(text: str) -> str

Convert Markdown text to HTML.

Parameters:

Name Type Description Default
text str

Markdown-formatted text.

required

Returns:

Type Description
str

HTML-formatted text.

markdown_to_plain_text staticmethod
markdown_to_plain_text(text: str) -> str

Convert Markdown text to plain text by removing formatting.

Parameters:

Name Type Description Default
text str

Markdown-formatted text.

required

Returns:

Type Description
str

Plain text with Markdown formatting removed.

paint
paint(
    painter: QPainter, option: QStyleOptionViewItem, index: QModelIndex
) -> None

Paint the item with custom background, border, and hover/selection.

This method handles all painting consistently across all items and columns, ensuring hover and selection highlighting looks the same everywhere. It supports custom background colors via Qt.BackgroundRole with rounded corners and borders.

Parameters:

Name Type Description Default
painter QPainter

The painter to use for drawing.

required
option QStyleOptionViewItem

The style options for the item.

required
index QModelIndex

The model index of the item.

required
sizeHint
sizeHint(option: QStyleOptionViewItem, index: QModelIndex) -> QSize

Return the size hint for the item at the given index.

Parameters:

Name Type Description Default
option QStyleOptionViewItem

The style options for the item.

required
index QModelIndex

The model index of the item.

required

Returns:

Type Description
QSize

The size hint for the item.

FXTimelineSlider

FXTimelineSlider(
    parent: Optional[QWidget] = None,
    start_frame: int = 1,
    end_frame: int = 100,
    current_frame: Optional[int] = None,
    fps: int = 24,
    show_controls: bool = True,
    show_spinbox: bool = True,
)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXTimelineSlider[FXTimelineSlider]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXTimelineSlider
                


              click fxgui.fxwidgets.FXTimelineSlider href "" "fxgui.fxwidgets.FXTimelineSlider"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A timeline/scrubber widget perfect for DCC applications.

This widget provides a timeline slider with: - Frame range display - Keyframe markers - Current frame indicator - Optional playback controls

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
start_frame
int

Start frame of the timeline.

1
end_frame
int

End frame of the timeline.

100
current_frame
Optional[int]

Initial current frame.

None
fps
int

Frames per second for playback (default 24).

24
show_controls
bool

Whether to show playback controls.

True
show_spinbox
bool

Whether to show the frame spinbox.

True
Signals

frame_changed: Emitted when the current frame changes. playback_started: Emitted when playback starts. playback_stopped: Emitted when playback stops.

Examples:

>>> timeline = FXTimelineSlider(start_frame=1, end_frame=100)
>>> timeline.frame_changed.connect(lambda f: print(f"Frame: {f}"))
>>> timeline.add_keyframe(10)
>>> timeline.add_keyframe(50)

Methods:

Name Description
add_keyframe

Add a keyframe marker.

clear_keyframes

Remove all keyframe markers.

go_to_end

Go to the end frame.

go_to_start

Go to the start frame.

next_frame

Advance to the next frame.

play

Start playback.

previous_frame

Go to the previous frame.

remove_keyframe

Remove a keyframe marker.

set_fps

Set the frames per second.

set_frame

Set the current frame.

set_range

Set the frame range.

stop

Stop playback.

toggle_playback

Toggle playback state.

Attributes:

Name Type Description
current_frame int

Return the current frame.

fps int

Return the current FPS.

frame_range Tuple[int, int]

Return the frame range as (start, end).

Attributes
current_frame property writable
current_frame: int

Return the current frame.

fps property
fps: int

Return the current FPS.

frame_range property
frame_range: Tuple[int, int]

Return the frame range as (start, end).

Functions
add_keyframe
add_keyframe(frame: int) -> None

Add a keyframe marker.

Parameters:

Name Type Description Default
frame int

The frame number to mark.

required
clear_keyframes
clear_keyframes() -> None

Remove all keyframe markers.

go_to_end
go_to_end() -> None

Go to the end frame.

go_to_start
go_to_start() -> None

Go to the start frame.

next_frame
next_frame() -> None

Advance to the next frame.

play
play() -> None

Start playback.

previous_frame
previous_frame() -> None

Go to the previous frame.

remove_keyframe
remove_keyframe(frame: int) -> None

Remove a keyframe marker.

Parameters:

Name Type Description Default
frame int

The frame number to remove.

required
set_fps
set_fps(fps: int) -> None

Set the frames per second.

Parameters:

Name Type Description Default
fps int

Frames per second for playback.

required
set_frame
set_frame(frame: int, emit: bool = True) -> None

Set the current frame.

Parameters:

Name Type Description Default
frame int

The frame number.

required
emit bool

Whether to emit the frame_changed signal.

True
set_range
set_range(start: int, end: int) -> None

Set the frame range.

Parameters:

Name Type Description Default
start int

Start frame.

required
end int

End frame.

required
stop
stop() -> None

Stop playback.

toggle_playback
toggle_playback() -> None

Toggle playback state.

FXToggleSwitch

FXToggleSwitch(
    parent: Optional[QWidget] = None,
    on_color: Optional[str] = None,
    off_color: Optional[str] = None,
    thumb_color: Optional[str] = None,
)

Bases: FXThemeAware, QAbstractButton


              flowchart TD
              fxgui.fxwidgets.FXToggleSwitch[FXToggleSwitch]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXToggleSwitch
                


              click fxgui.fxwidgets.FXToggleSwitch href "" "fxgui.fxwidgets.FXToggleSwitch"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A modern iOS/Material-style animated toggle switch.

This widget provides a sleek alternative to QCheckBox with smooth sliding animation and theme-aware colors.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget.

None
on_color
Optional[str]

Color when switch is on. If None, uses theme accent.

None
off_color
Optional[str]

Color when switch is off. If None, uses theme surface.

None
thumb_color
Optional[str]

Color of the thumb/knob. If None, uses white.

None
Signals

toggled: Emitted when the switch state changes.

Examples:

>>> switch = FXToggleSwitch()
>>> switch.toggled.connect(lambda checked: print(f"Switch: {checked}"))
>>> switch.setChecked(True)

Methods:

Name Description
hitButton

Return True if pos is inside the clickable area.

minimumSizeHint

Return the minimum size of the switch.

paintEvent

Paint the toggle switch.

position

Set the animation position and trigger repaint.

sizeHint

Return the preferred size of the switch.

Functions
hitButton
hitButton(pos)

Return True if pos is inside the clickable area.

minimumSizeHint
minimumSizeHint()

Return the minimum size of the switch.

paintEvent
paintEvent(event) -> None

Paint the toggle switch.

position
position(value: float) -> None

Set the animation position and trigger repaint.

sizeHint
sizeHint()

Return the preferred size of the switch.

FXTooltip

FXTooltip(
    parent: Optional[QWidget] = None,
    title: Optional[str] = None,
    description: str = "",
    icon: Optional[str] = None,
    image: Optional[QPixmap] = None,
    shortcut: Optional[str] = None,
    action_text: Optional[str] = None,
    action_callback: Optional[Callable] = None,
    position: FXTooltipPosition = AUTO,
    show_delay: int = 500,
    hide_delay: int = 200,
    duration: int = 0,
    persistent: bool = False,
    show_arrow: bool = True,
    max_width: int = 300,
)

Bases: FXThemeAware, QFrame


              flowchart TD
              fxgui.fxwidgets.FXTooltip[FXTooltip]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXTooltip
                


              click fxgui.fxwidgets.FXTooltip href "" "fxgui.fxwidgets.FXTooltip"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A rich, theme-aware tooltip with advanced features.

This widget provides an enhanced tooltip experience with: - Rich content: title, description, icon, images, shortcuts - Smart positioning with arrow pointing to anchor - Theme-aware styling - Fade in/out animations - Hover or programmatic trigger - Configurable delays - Optional action buttons - Persistent mode (stays until clicked away)

Parameters:

Name Type Description Default
parent
Optional[QWidget]

Parent widget (anchor for positioning).

None
title
Optional[str]

Optional title text (bold).

None
description
str

Main tooltip content.

''
icon
Optional[str]

Optional icon name (from fxicons).

None
image
Optional[QPixmap]

Optional QPixmap image to display.

None
shortcut
Optional[str]

Optional keyboard shortcut to display.

None
action_text
Optional[str]

Optional action button text.

None
action_callback
Optional[Callable]

Callback for action button click.

None
position
FXTooltipPosition

Preferred position relative to anchor.

AUTO
show_delay
int

Delay in ms before showing (default 500).

500
hide_delay
int

Delay in ms before hiding after mouse leaves (default 200).

200
duration
int

Auto-hide duration in ms (0 = no auto-hide).

0
persistent
bool

If True, tooltip stays until explicitly closed.

False
show_arrow
bool

Whether to show the pointing arrow.

True
max_width
int

Maximum width of the tooltip.

300
Signals

shown: Emitted when the tooltip is shown. hidden: Emitted when the tooltip is hidden. action_clicked: Emitted when the action button is clicked.

Examples:

>>> # Simple tooltip attached to a button
>>> tooltip = FXTooltip(
...     parent=my_button,
...     title="Save",
...     description="Save the current file to disk",
...     shortcut="Ctrl+S",
... )
>>>
>>> # Rich tooltip with image and action
>>> tooltip = FXTooltip(
...     parent=my_widget,
...     title="New Feature!",
...     description="Click here to learn about the new export options.",
...     icon="lightbulb",
...     action_text="Learn More",
...     action_callback=lambda: show_help(),
...     persistent=True,
... )
>>>
>>> # Programmatic show/hide
>>> tooltip.show_tooltip()
>>> tooltip.hide_tooltip()

Methods:

Name Description
enterEvent

Handle mouse entering tooltip.

eventFilter

Handle hover events on anchor widget and click-outside detection.

hide_tooltip

Programmatically hide the tooltip.

leaveEvent

Handle mouse leaving tooltip.

mousePressEvent

Handle click to dismiss persistent tooltip.

paintEvent

Paint the tooltip with arrow.

set_anchor

Change the anchor widget.

set_content

Update tooltip content dynamically.

show_at_point

Show tooltip at a specific global position.

show_at_rect

Show tooltip positioned relative to a global rectangle.

show_for_rect

Convenience method to show a tooltip for a screen rectangle.

show_for_widget

Convenience method to show a tooltip for a widget.

show_tooltip

Programmatically show the tooltip.

Functions
enterEvent
enterEvent(event) -> None

Handle mouse entering tooltip.

eventFilter
eventFilter(watched, event) -> bool

Handle hover events on anchor widget and click-outside detection.

hide_tooltip
hide_tooltip() -> None

Programmatically hide the tooltip.

leaveEvent
leaveEvent(event) -> None

Handle mouse leaving tooltip.

mousePressEvent
mousePressEvent(event) -> None

Handle click to dismiss persistent tooltip.

paintEvent
paintEvent(event) -> None

Paint the tooltip with arrow.

set_anchor
set_anchor(widget: QWidget) -> None

Change the anchor widget.

Parameters:

Name Type Description Default
widget QWidget

New anchor widget.

required
set_content
set_content(
    title: Optional[str] = None,
    description: Optional[str] = None,
    icon: Optional[str] = None,
    shortcut: Optional[str] = None,
) -> None

Update tooltip content dynamically.

Parameters:

Name Type Description Default
title Optional[str]

New title text.

None
description Optional[str]

New description text.

None
icon Optional[str]

New icon name.

None
shortcut Optional[str]

New shortcut text.

None
show_at_point
show_at_point(global_pos: QPoint, position: FXTooltipPosition = BOTTOM) -> None

Show tooltip at a specific global position.

The tooltip will be positioned relative to the given point, treating it as a zero-size anchor.

Parameters:

Name Type Description Default
global_pos QPoint

Global (screen) coordinates where tooltip should appear.

required
position FXTooltipPosition

Which direction the tooltip should extend from the point.

BOTTOM

Examples:

>>> # Show tooltip at cursor position
>>> tooltip.show_at_point(QCursor.pos())
>>>
>>> # Show tooltip below a specific point
>>> tooltip.show_at_point(some_global_point, FXTooltipPosition.BOTTOM)
show_at_rect
show_at_rect(rect: QRect, position: Optional[FXTooltipPosition] = None) -> None

Show tooltip positioned relative to a global rectangle.

This is useful for showing tooltips relative to tree items, table cells, or other sub-widget regions that aren't QWidget instances.

Parameters:

Name Type Description Default
rect QRect

Rectangle in global (screen) coordinates to position relative to.

required
position Optional[FXTooltipPosition]

Optional position override. Uses instance position if None.

None

Examples:

>>> # Show tooltip for a tree item
>>> item_rect = tree.visualItemRect(item)
>>> global_rect = QRect(
...     tree.viewport().mapToGlobal(item_rect.topLeft()),
...     item_rect.size()
... )
>>> tooltip.show_at_rect(global_rect)
show_for_rect staticmethod
show_for_rect(
    rect: QRect,
    title: Optional[str] = None,
    description: str = "",
    icon: Optional[str] = None,
    shortcut: Optional[str] = None,
    duration: int = 3000,
    position: FXTooltipPosition = AUTO,
    max_width: int = 300,
) -> FXTooltip

Convenience method to show a tooltip for a screen rectangle.

Creates and shows a tooltip immediately, auto-hiding after duration. Useful for tree items, table cells, or other non-widget regions.

Parameters:

Name Type Description Default
rect QRect

Rectangle in global (screen) coordinates.

required
title Optional[str]

Optional title.

None
description str

Tooltip description.

''
icon Optional[str]

Optional icon name.

None
shortcut Optional[str]

Optional shortcut text.

None
duration int

Auto-hide duration in ms.

3000
position FXTooltipPosition

Tooltip position.

AUTO
max_width int

Maximum width of the tooltip.

300

Returns:

Type Description
FXTooltip

The created FXTooltip instance.

Examples:

>>> # Show tooltip for a tree item
>>> item_rect = tree.visualItemRect(item)
>>> global_rect = QRect(
...     tree.viewport().mapToGlobal(item_rect.topLeft()),
...     item_rect.size()
... )
>>> FXTooltip.show_for_rect(
...     global_rect,
...     title="Item Info",
...     description="Details about this item",
...     duration=2000
... )
show_for_widget staticmethod
show_for_widget(
    widget: QWidget,
    title: Optional[str] = None,
    description: str = "",
    icon: Optional[str] = None,
    shortcut: Optional[str] = None,
    duration: int = 3000,
    position: FXTooltipPosition = AUTO,
) -> FXTooltip

Convenience method to show a tooltip for a widget.

Creates and shows a tooltip immediately, auto-hiding after duration.

Parameters:

Name Type Description Default
widget QWidget

Widget to show tooltip for.

required
title Optional[str]

Optional title.

None
description str

Tooltip description.

''
icon Optional[str]

Optional icon name.

None
shortcut Optional[str]

Optional shortcut text.

None
duration int

Auto-hide duration in ms.

3000
position FXTooltipPosition

Tooltip position.

AUTO

Returns:

Type Description
FXTooltip

The created FXTooltip instance.

Examples:

>>> FXTooltip.show_for_widget(
...     button,
...     title="Tip",
...     description="Click to save",
...     duration=2000
... )
show_tooltip
show_tooltip() -> None

Programmatically show the tooltip.

FXTooltipManager

FXTooltipManager(
    parent: Optional[QObject] = None,
    show_delay: int = 500,
    hide_delay: int = 200,
    max_width: int = 300,
)

Bases: QObject


              flowchart TD
              fxgui.fxwidgets.FXTooltipManager[FXTooltipManager]

              

              click fxgui.fxwidgets.FXTooltipManager href "" "fxgui.fxwidgets.FXTooltipManager"
            

Global manager that intercepts standard Qt tooltips and shows FXTooltip instead.

This allows you to use the standard widget.setToolTip("text") API and have FXTooltip displayed automatically.

The manager installs an application-wide event filter that intercepts QEvent.ToolTip events and shows an FXTooltip with the widget's tooltip text.

Parameters:

Name Type Description Default
parent
Optional[QObject]

Parent QObject (typically QApplication.instance()).

None
show_delay
int

Delay in ms before showing tooltip (default 500).

500
hide_delay
int

Delay in ms before hiding tooltip after mouse leaves (default 200).

200
max_width
int

Maximum width of tooltips (default 300).

300

Examples:

>>> # Install globally for the entire application
>>> app = QApplication(sys.argv)
>>> FXTooltipManager.install()
>>>
>>> # Now all setToolTip() calls will use FXTooltip
>>> button = QPushButton("Click me")
>>> button.setToolTip("This will show as an FXTooltip!")
>>>
>>> # Uninstall to restore default Qt tooltips
>>> FXTooltipManager.uninstall()

Methods:

Name Description
eventFilter

Intercept tooltip events and show FXTooltip instead.

install

Install the global tooltip manager.

instance

Get the current tooltip manager instance.

is_installed

Check if the tooltip manager is currently installed.

uninstall

Uninstall the global tooltip manager.

Functions
eventFilter
eventFilter(watched: QObject, event: QEvent) -> bool

Intercept tooltip events and show FXTooltip instead.

install classmethod
install(
    show_delay: int = 500, hide_delay: int = 200, max_width: int = 300
) -> FXTooltipManager

Install the global tooltip manager.

After calling this, all widgets using setToolTip() will display FXTooltip instead of the standard Qt tooltip.

Parameters:

Name Type Description Default
show_delay int

Delay in ms before showing tooltip.

500
hide_delay int

Delay in ms before hiding tooltip.

200
max_width int

Maximum width of tooltips.

300

Returns:

Type Description
FXTooltipManager

The installed FXTooltipManager instance.

Examples:

>>> FXTooltipManager.install()
>>> button.setToolTip("Now uses FXTooltip!")
instance classmethod
instance() -> Optional[FXTooltipManager]

Get the current tooltip manager instance.

Returns:

Type Description
Optional[FXTooltipManager]

The FXTooltipManager instance, or None if not installed.

is_installed classmethod
is_installed() -> bool

Check if the tooltip manager is currently installed.

Returns:

Type Description
bool

True if installed, False otherwise.

uninstall classmethod
uninstall() -> None

Uninstall the global tooltip manager.

Restores standard Qt tooltip behavior.

Examples:

>>> FXTooltipManager.uninstall()

FXTooltipPosition

Bases: IntEnum


              flowchart TD
              fxgui.fxwidgets.FXTooltipPosition[FXTooltipPosition]

              

              click fxgui.fxwidgets.FXTooltipPosition href "" "fxgui.fxwidgets.FXTooltipPosition"
            

Tooltip position relative to anchor widget.

FXValidatedLineEdit

FXValidatedLineEdit(
    parent: Optional[QWidget] = None,
    shake_amplitude: int = 4,
    shake_duration: int = 300,
    flash_duration: int = 400,
)

Bases: FXThemeAware, QLineEdit


              flowchart TD
              fxgui.fxwidgets.FXValidatedLineEdit[FXValidatedLineEdit]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXValidatedLineEdit
                


              click fxgui.fxwidgets.FXValidatedLineEdit href "" "fxgui.fxwidgets.FXValidatedLineEdit"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

A line edit that provides visual feedback when input is rejected.

When a validator rejects input (e.g., typing an invalid character), this widget shows a brief shake animation with a red border flash to indicate to the user that their input was not accepted.

The error color is theme-aware and uses the feedback "error" color from the current theme.

Parameters:

Name Type Description Default
parent
Optional[QWidget]

The parent widget.

None
shake_amplitude
int

Maximum horizontal displacement in pixels.

4
shake_duration
int

Total duration of shake animation in milliseconds.

300
flash_duration
int

Duration of red border flash in milliseconds.

400

Examples:

>>> from qtpy.QtWidgets import QLineEdit
>>> from fxgui.fxwidgets import FXValidatedLineEdit, FXCamelCaseValidator
>>> line_edit = FXValidatedLineEdit()
>>> line_edit.setValidator(FXCamelCaseValidator())
>>> line_edit.setPlaceholderText("camelCase only")

Methods:

Name Description
keyPressEvent

Intercept key presses to detect rejected input.

Functions
keyPressEvent
keyPressEvent(event: QKeyEvent) -> None

Intercept key presses to detect rejected input.

Parameters:

Name Type Description Default
event QKeyEvent

The key event.

required

FXWidget

FXWidget(parent=None, ui_file: Optional[str] = None)

Bases: FXThemeAware, QWidget


              flowchart TD
              fxgui.fxwidgets.FXWidget[FXWidget]
              fxgui.fxstyle.FXThemeAware[FXThemeAware]

                              fxgui.fxstyle.FXThemeAware --> fxgui.fxwidgets.FXWidget
                


              click fxgui.fxwidgets.FXWidget href "" "fxgui.fxwidgets.FXWidget"
              click fxgui.fxstyle.FXThemeAware href "" "fxgui.fxstyle.FXThemeAware"
            

Functions

set_tooltip

set_tooltip(
    target: Union[QWidget, QTreeWidgetItem, QListWidgetItem, QTableWidgetItem],
    description: str = "",
    title: Optional[str] = None,
    icon: Optional[str] = None,
    shortcut: Optional[str] = None,
    position: FXTooltipPosition = AUTO,
    show_delay: int = 500,
    hide_delay: int = 200,
) -> FXTooltip

Attach an FXTooltip to a widget or item with a simple API.

This is a convenience function similar to fxicons.set_icon() that creates and attaches an FXTooltip to the given target. The tooltip is automatically shown on hover and hidden when the mouse leaves.

Supports both QWidget subclasses and item-based widgets: - QWidget (buttons, labels, etc.) - QTreeWidgetItem - QListWidgetItem - QTableWidgetItem

Parameters:

Name Type Description Default
target
Union[QWidget, QTreeWidgetItem, QListWidgetItem, QTableWidgetItem]

The widget or item to attach the tooltip to.

required
description
str

Main tooltip content text.

''
title
Optional[str]

Optional bold title text.

None
icon
Optional[str]

Optional icon name (from fxicons).

None
shortcut
Optional[str]

Optional keyboard shortcut to display.

None
position
FXTooltipPosition

Preferred position relative to target.

AUTO
show_delay
int

Delay in ms before showing (default 500).

500
hide_delay
int

Delay in ms before hiding after mouse leaves (default 200).

200

Returns:

Type Description
FXTooltip

The created FXTooltip instance (kept internally to prevent GC).

Examples:

>>> # Simple tooltip on a button
>>> set_tooltip(button, "Click to save the file")
>>>
>>> # Rich tooltip with all options
>>> set_tooltip(
...     button,
...     description="Save the current document to disk.",
...     title="Save",
...     icon="save",
...     shortcut="Ctrl+S",
... )
>>>
>>> # Tooltip on a tree item
>>> item = QTreeWidgetItem(tree, ["Item 1"])
>>> set_tooltip(
...     item,
...     description="This is a tree item tooltip",
...     title="Item Info",
...     icon="info",
... )