Open 3D Engine AzQtComponents API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AzQtComponents::SegmentBar Class Reference

A control used to switch between different sections of associated information. More...

#include <SegmentBar.h>

Inherits QFrame.

Public Slots

void setCurrentIndex (int index)
 

Signals

void currentChanged (int index)
 Triggered when the current tab is changed.
 
void tabBarClicked (int index)
 Triggered when a tab is clicked by the user.
 

Public Member Functions

 SegmentBar (Qt::Orientation orientation, QWidget *parent=nullptr)
 
 SegmentBar (QWidget *parent=nullptr)
 
int addTab (const QString &text)
 Appends a new tab.
 
int addTab (const QIcon &icon, const QString &text)
 Appends a new tab with an icon.
 
int insertTab (int index, const QString &text)
 Inserts a new tab at the given index.
 
int insertTab (int index, const QIcon &icon, const QString &text)
 Inserts a new tab with an icon at the given index.
 
void removeTab (int index)
 Removes the tab at the given index.
 
void moveTab (int from, int to)
 
void setTabEnabled (int index, bool enabled)
 Sets enabled state for the tab at the given index.
 
bool isTabEnabled (int index) const
 Returns the enabled state for the tab at the given index.
 
void setTabText (int index, const QString &text)
 Sets the text to the tab at the given index.
 
QString tabText (int index) const
 Returns the text of the tab at the given index.
 
void setTabTextColor (int index, const QColor &color)
 Sets the text color to the tab at the given index.
 
QColor tabTextColor (int index) const
 Returns the text color of the tab at the given index.
 
void setTabIcon (int index, const QIcon &icon)
 Sets the icon to the tab at the given index.
 
QIcon tabIcon (int index) const
 Returns the icon of the tab at the given index.
 
void setTabToolTip (int index, const QString &tip)
 Sets the tooltip text for the tab at the given index.
 
QString tabToolTip (int index) const
 Returns the tooltip text of the tab at the given index.
 
void setTabWhatsThis (int index, const QString &text)
 Sets the "What's this?" text to the tab at the given index.
 
QString tabWhatsThis (int index) const
 Returns the "What's this?" text of the tab at the given index.
 
void setOrientation (Qt::Orientation orientation)
 Sets the segment bar orientation.
 
Qt::Orientation orientation () const
 Returns the segment bar orientation.
 
int currentIndex () const
 Returns the index of the currently selected tab.
 
int count () const
 Returns the number of tabs.
 
void setIconSize (const QSize &size)
 
QSize iconSize () const
 Returns the icon size.
 

Protected Member Functions

virtual QAbstractButton * createButton (const QIcon &icon, const QString &text)
 
QAbstractButton * button (int index) const
 
void updateTabs ()
 

Properties

Qt::Orientation orientation
 Orientation of the segment bar. Horizontal bars are ordered left to right, vertical ones go top to bottom.
 
int currentIndex
 Index of the currently selected segment.
 
int count
 The number of tabs in the SegmentBar.
 
QSize iconSize
 Size of the icons in the SegmentBar.
 

Detailed Description

A control used to switch between different sections of associated information.

Member Function Documentation

◆ moveTab()

void AzQtComponents::SegmentBar::moveTab ( int  from,
int  to 
)

Moves the tab from a position to another. The tabs between 'to' and 'from' will have their indices shifted to fill the void.

◆ setIconSize()

void AzQtComponents::SegmentBar::setIconSize ( const QSize &  size)

Sets the maximum icon size. Smaller icons will not be scaled up, but bigger icons will be shrunk. The icon will be stretched to fit.


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