Open 3D Engine AzQtComponents API Reference  22.10.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
Classes | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
AzQtComponents::BreadCrumbs Class Reference

#include <BreadCrumbs.h>

Inherits QWidget.

Classes

struct  Config
 Style configuration for the Breadcrumbs class. More...
 

Public Slots

void pushPath (const QString &fullPath)
 Pushes a path to be shown in the Breadcrumbs widget.
 
bool back ()
 Restores the previous breadcrumb path from the navigation stack if it exists.
 
bool forward ()
 Restores the next breadcrumb path from the navigation stack if it exists.
 

Signals

void pathChanged (const QString &fullPath)
 
void linkClicked (const QString &linkPath, int linkIndex)
 
void backAvailabilityChanged (bool enabled)
 
void forwardAvailabilityChanged (bool enabled)
 

Public Member Functions

 BreadCrumbs (QWidget *parent=nullptr)
 
bool isBackAvailable () const
 Returns true if it is possible to move back in the navigation stack, false otherwise.
 
bool isForwardAvailable () const
 Returns true if it is possible to move forward in the navigation stack, false otherwise.
 
bool isUpAvailable () const
 Returns true if the current breadcrumb path has a parent that can be added to the navigation stack, false otherwise.
 
QString currentPath () const
 Returns a string with the current breadcrumb path.
 
void setCurrentPath (const QString &newPath)
 Sets the current breadcrumb path without updating the navigation stack.
 
void setDefaultIcon (const QString &iconPath)
 Sets a default icon for path elements.
 
void setIconAt (int index, const QString &iconPath)
 Sets an icon for the path element at index.
 
QIcon iconAt (int index)
 Gets the icon for the path element at index.
 
bool getPushPathOnLinkActivation () const
 Returns true if activating a link should automatically push a new path to the navigation stack.
 
void setPushPathOnLinkActivation (bool pushPath)
 Sets whether activating a link should automatically push a new path to the navigation stack.
 
QToolButton * createButton (NavigationButton type)
 
QWidget * createBackForwardToolBar ()
 
QWidget * createSeparator ()
 

Static Public Member Functions

static Config loadConfig (QSettings &settings)
 
static Config defaultConfig ()
 Gets the default Breadcrumbs style configuration.
 

Protected Member Functions

void resizeEvent (QResizeEvent *event) override
 

Friends

class Style
 

Detailed Description

Specialized widget to create html-style clickable links for each part of a path. Provides state management and signals for handling common path navigation functionality (back, forward and up). Can be styled by modifying BreadCrumbs.qss and BreadCrumbsConfig.ini. Note that Qt doesn't handle HTML embedded in QLabel widgets gracefully - stylesheets are not shared between those and Qt objects. As a result, the color of the HTML styled links in the BreadCrumbs is specified in BreadCrumbsConfig.ini.

Member Function Documentation

◆ backAvailabilityChanged

void AzQtComponents::BreadCrumbs::backAvailabilityChanged ( bool  enabled)
signal

Triggered after a change to the navigation stack, if back is available. Used to update back buttons.

Parameters
enabledThe new back availability state after the change.

◆ createBackForwardToolBar()

QWidget* AzQtComponents::BreadCrumbs::createBackForwardToolBar ( )

Creates a widget containing the back and forward buttons.

Returns
The pointer to the newly created QWidget. Note: the widget will need to be added to a layout manually.

◆ createButton()

QToolButton* AzQtComponents::BreadCrumbs::createButton ( NavigationButton  type)

Creates a button of the type specified.

Parameters
typeThe type of button to create.
Returns
The pointer to the newly created QToolButton. Note: the button will need to be added to a layout manually.

◆ createSeparator()

QWidget* AzQtComponents::BreadCrumbs::createSeparator ( )

Creates a separator styled to match the Breadcrumbs widget.

Returns
The pointer to the newly created separator. Note: the separator will need to be added to a layout manually.

◆ forwardAvailabilityChanged

void AzQtComponents::BreadCrumbs::forwardAvailabilityChanged ( bool  enabled)
signal

Triggered after a change to the navigation stack, if forward is available. Used to update forward buttons.

Parameters
enabledThe new forward availability state after the change.

◆ linkClicked

void AzQtComponents::BreadCrumbs::linkClicked ( const QString &  linkPath,
int  linkIndex 
)
signal

Triggered when a link is clicked.

Parameters
linkPathThe path of the clicked link.
linkIndexThe index of the link.

◆ loadConfig()

static Config AzQtComponents::BreadCrumbs::loadConfig ( QSettings &  settings)
static

Sets the Breadcrumbs style configuration.

Parameters
settingsThe settings object to load the configuration from.
Returns
The new configuration of the Breadcrumbs.

◆ pathChanged

void AzQtComponents::BreadCrumbs::pathChanged ( const QString &  fullPath)
signal

Triggered when the currently displayed path changes via any of the slots.

Returns
fullPath The new path after the change.

The documentation for this class was generated from the following file: