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

#include <Card.h>

Inherits QFrame.


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


void selectedChanged (bool selected)
 Triggered when the selected state for the Card changes.
void expandStateChanged (bool expanded)
 Triggered when the Card is expanded/collapsed.
void secondaryContentExpandStateChanged (bool expanded)
 Triggered when the Card's secondary content is expanded/collapsed.
void contextMenuRequested (const QPoint &position)
 Triggered when the menu button on the card is clicked and the context menu is shown.

Public Member Functions

 Card (QWidget *parent=nullptr)
void setContentWidget (QWidget *contentWidget)
 Sets the Primary Content Widget for this Card.
QWidget * contentWidget () const
 Returns a pointer to the Primary Content Widget for this Card.
void setTitle (const QString &title)
QString title () const
 Returns the Card's Title.
CardHeaderheader () const
 Returns a pointer to thisCard's CardHeader.
CardNotificationaddNotification (const QString &message)
 Appends a notification to the Card with the message provided.
void clearNotifications ()
 Clears all notifications on this Card.
int getNotificationCount () const
 Returns the number of notifications currently attached to this Card.
void setExpanded (bool expand)
 Set the Card's expanded state.
bool isExpanded () const
 Returns the Card's expanded state.
void setSelected (bool selected)
bool isSelected () const
 Returns the Card's selected state.
void setDragging (bool dragging)
bool isDragging () const
 Returns true if the Card is marked as "being dragged".
void setDropTarget (bool dropTarget)
bool isDropTarget () const
 Returns true if the Card is marked as "drop target".
void setSecondaryContentExpanded (bool expand)
 Set the expanded state for the Secondary Widget.
bool isSecondaryContentExpanded () const
 Returns the expanded state for the Secondary Widget.
void setSecondaryTitle (const QString &secondaryTitle)
 Sets the Title for the secondary section of the Card.
QString secondaryTitle () const
 Gets the Title of the secondary section of the Card.
void setSecondaryContentWidget (QWidget *secondaryContentWidget)
 Sets the Title for the secondary section of the Card.
QWidget * secondaryContentWidget () const
 Returns a pointer to the secondary widget of this Card.
void hideFrame ()
 Sets the hideFrame property on the Card, removing the border around it.
void mockDisabledState (bool disable)

Static Public Member Functions

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

Protected Member Functions

 Card (CardHeader *customHeader, QWidget *parent=nullptr)


bool selected
 Card selected state. Selected cards get a blue border.
bool expanded
 Card expanded state. Collapsing a Card disables the widgets it contains.


class Style

Detailed Description

A container for other widgets that provides a title bar and can be expanded/collapsed or dragged around. To make use of a Card, set its title and a content widget. The content widget will be automatically shown and hidden as the Card is expanded and collapsed. Beyond that, a Card can also include a secondary expandable widget, for features such as Advanced Settings, and multiple "Notifications" which are labels appended to the bottom that can optionally include "feature" widgets, for example as a button to allow the user to respond to the Notification. Style information is stored in Card.qss, for Card, CardHeader and CardNotification objects. Config information is stored in CardConfig.ini

Member Function Documentation

◆ loadConfig()

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

Sets the Card style configuration.

settingsThe settings object to load the configuration from.
The new configuration of the Card.

◆ mockDisabledState()

void AzQtComponents::Card::mockDisabledState ( bool  disable)

Shows the Card as disabled. Expand/collapse, help and context menu buttons will remain functional.

◆ setDragging()

void AzQtComponents::Card::setDragging ( bool  dragging)

Marks the Card as "being dragged". Note: there is no behavior associated to this function, it's just a flag.

◆ setDropTarget()

void AzQtComponents::Card::setDropTarget ( bool  dropTarget)

Marks the Card as "drop target". Note: there is no behavior associated to this function, it's just a flag.

◆ setSelected()

void AzQtComponents::Card::setSelected ( bool  selected)

Sets the Card's selected state. Will trigger the selectedChanged() signal.

◆ setTitle()

void AzQtComponents::Card::setTitle ( const QString &  title)

Sets the Card's Title. Equivalent to calling setTitle on the CardHeader.

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