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

The GraphCanvasLabel gives a QGraphicsWidget that is able to display text, and be placed into a layout. More...

#include <GraphCanvasLabel.h>

Inherits QGraphicsWidget.

Public Types

enum class  WrapMode { MaximumWidth , BoundingWidth , ResizeToContent }
 
enum class  RoundedCornersMode { AllCorners , LeftCorners , RightCorners }
 

Public Member Functions

 AZ_CLASS_ALLOCATOR (GraphCanvasLabel, AZ::SystemAllocator)
 
 GraphCanvasLabel (QGraphicsItem *parent=nullptr)
 
void SetFontColor (const QColor &color)
 
void ClearFontColor ()
 
void SetBorderColorOverride (const QBrush &borderOverride)
 
const QBrush & GetBorderColorOverride () const
 
void ClearBorderColorOverride ()
 
void SetLabel (const AZStd::string &value)
 
AZStd::string GetLabel () const
 
void SetSceneStyle (const AZ::EntityId &sceneId, const char *style)
 
void SetStyle (const AZ::EntityId &entityId, const char *styleElement)
 
void RefreshDisplay ()
 
void SetWrapMode (WrapMode wrapMode)
 
void SetRoundedCornersMode (RoundedCornersMode roundedCornerMode)
 Sets which corners to apply the radius to.
 
QRectF GetDisplayedSize () const
 
void SetElide (bool elide)
 
void SetWrap (bool wrap)
 
void SetAllowNewlines (bool allow)
 Sets whether or not the text label will allow newlines in the text.
 
void SetDefaultAlignment (Qt::Alignment defaultAlignment)
 
Styling::StyleHelperGetStyleHelper ()
 
const Styling::StyleHelperGetStyleHelper () const
 
void UpdateDisplayText ()
 

Protected Member Functions

void UpdateDesiredBounds ()
 
bool event (QEvent *qEvent) override
 
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr) override
 
QSizeF sizeHint (Qt::SizeHint which, const QSizeF &constraint=QSizeF()) const override
 

Detailed Description

The GraphCanvasLabel gives a QGraphicsWidget that is able to display text, and be placed into a layout.

Member Function Documentation

◆ SetElide()

void GraphCanvas::GraphCanvasLabel::SetElide ( bool  elide)

Sets whether the text should elide if it grows beyond max-width (Note: currently incompatible with word wrap)

◆ SetWrap()

void GraphCanvas::GraphCanvasLabel::SetWrap ( bool  wrap)

Sets whether the next should wrap if it grows beyond max-width (Note: currently incompatible with text elide)


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