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::Style Class Reference

#include <Style.h>

Inherits QProxyStyle.

Classes

class  DrawWidgetSentinel
 

Public Types

enum  BorderStyle { CORNER_RECTANGLE = -1 }
 

Signals

void settingsReloaded ()
 

Public Member Functions

 Style (QStyle *style=nullptr)
 
void repolishOnSettingsChange (QWidget *widget)
 
QSize sizeFromContents (QStyle::ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget) const override
 
void drawControl (QStyle::ControlElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override
 
void drawPrimitive (QStyle::PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override
 
void drawComplexControl (QStyle::ComplexControl element, const QStyleOptionComplex *option, QPainter *painter, const QWidget *widget) const override
 
void drawItemText (QPainter *painter, const QRect &rectangle, int alignment, const QPalette &palette, bool enabled, const QString &text, QPalette::ColorRole textRole) const override
 
void drawDragIndicator (const QStyleOption *option, QPainter *painter, const QWidget *widget) const
 
QPixmap generatedIconPixmap (QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *option) const override
 
QRect subControlRect (ComplexControl control, const QStyleOptionComplex *option, SubControl subControl, const QWidget *widget) const override
 
QRect subElementRect (SubElement element, const QStyleOption *option, const QWidget *widget) const override
 
int pixelMetric (QStyle::PixelMetric metric, const QStyleOption *option, const QWidget *widget) const override
 
void polish (QApplication *application) override
 
void polish (QWidget *widget) override
 
void polish (QPalette &palette) override
 
void unpolish (QWidget *widget) override
 
void unpolish (QApplication *widget) override
 
QPalette standardPalette () const override
 
QIcon standardIcon (StandardPixmap standardIcon, const QStyleOption *option, const QWidget *widget) const override
 
int styleHint (QStyle::StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returnData) const override
 
QPainterPath borderLineEditRect (const QRect &contentsRect, int borderWidth=-1, int borderRadius=Style::BorderStyle::CORNER_RECTANGLE) const
 
QPainterPath lineEditRect (const QRect &contentsRect, int borderWidth=-1, int borderRadius=Style::BorderStyle::CORNER_RECTANGLE) const
 
bool eventFilter (QObject *watched, QEvent *ev) override
 

Static Public Member Functions

static QIcon icon (const QString &name)
 
static QColor dropZoneColorOnHover ()
 
static bool hasClass (const QWidget *widget, const QString &className)
 
static void addClass (QWidget *widget, const QString &className)
 
static void removeClass (QWidget *widget, const QString &className)
 
static QPixmap cachedPixmap (const QString &fileName)
 
static void prepPainter (QPainter *painter)
 
static void fixProxyStyle (QProxyStyle *proxyStyle, QStyle *baseStyle)
 
static void drawFrame (QPainter *painter, const QPainterPath &frameRect, const QPen &border, const QBrush &background)
 
static void flagToIgnore (QWidget *widget)
 
static void removeFlagToIgnore (QWidget *widget)
 
static bool hasStyle (const QWidget *widget)
 

Detailed Description

The UI 2.0 Open 3D Engine Qt Style.

Should not need to be used directly; use the AzQtComponents::StyleManager instead.

Member Function Documentation

◆ addClass()

static void AzQtComponents::Style::addClass ( QWidget *  widget,
const QString &  className 
)
static

Adds the css className to the input widget

◆ cachedPixmap()

static QPixmap AzQtComponents::Style::cachedPixmap ( const QString &  fileName)
static

Finds or loads and then caches the pixmap referenced by fileName

◆ drawFrame()

static void AzQtComponents::Style::drawFrame ( QPainter *  painter,
const QPainterPath &  frameRect,
const QPen &  border,
const QBrush &  background 
)
static

Simple helper to draw an anti-aliased frame

◆ fixProxyStyle()

static void AzQtComponents::Style::fixProxyStyle ( QProxyStyle *  proxyStyle,
QStyle *  baseStyle 
)
static

Fixes up the parent of the current application style if need be. This is used for internal bookkeeping to prevent crashes from styles being parented badly.

◆ flagToIgnore()

static void AzQtComponents::Style::flagToIgnore ( QWidget *  widget)
static

Call this to explicitly mark your widget to not use the UI 2.0 styling

◆ hasClass()

static bool AzQtComponents::Style::hasClass ( const QWidget *  widget,
const QString &  className 
)
static

Returns true if the widget parameter has the css className applied

◆ hasStyle()

static bool AzQtComponents::Style::hasStyle ( const QWidget *  widget)
static

Call this to check whether the widget should use the UI 2.0 styling

◆ prepPainter()

static void AzQtComponents::Style::prepPainter ( QPainter *  painter)
static

QPainter is not guaranteed to have its QPaintEngine initialized in setRenderHint, so call this work around that. See: QTBUG-51247

◆ removeClass()

static void AzQtComponents::Style::removeClass ( QWidget *  widget,
const QString &  className 
)
static

Removes the css className from the input widget

◆ removeFlagToIgnore()

static void AzQtComponents::Style::removeFlagToIgnore ( QWidget *  widget)
static

Call this to remove the flags set from calling flagToIgnore()

◆ repolishOnSettingsChange()

void AzQtComponents::Style::repolishOnSettingsChange ( QWidget *  widget)

Tracks this widget so that when *Config.ini files change, this widget will get repolished. Call this if your widget changes based on the config in it's polish() method, so that it dynamically reloads when the file changes on disk.


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