QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
LastUsedStyle Class Reference

The LastUsedStyle class Session-scoped "last used" style for new shapes and free text created on the diagram canvas: whatever pen/brush/font was last applied through the properties editors becomes the starting point for the next new item of that type, the way most drawing tools behave. More...

#include <lastusedstyle.h>

Collaboration diagram for LastUsedStyle:
Collaboration graph

Static Public Member Functions

static bool hasShapePen ()
static QPen shapePen ()
static void setShapePen (const QPen &pen)
 LastUsedStyle::setShapePen Record pen as the last-used shape pen for this session.
static bool hasShapeBrush ()
static QBrush shapeBrush ()
static void setShapeBrush (const QBrush &brush)
 LastUsedStyle::setShapeBrush Record brush as the last-used shape brush for this session.
static bool hasTextFont ()
static QFont textFont ()
static void setTextFont (const QFont &font)
 LastUsedStyle::setTextFont Record font as the last-used free text font for this session.

Private Member Functions

 LastUsedStyle ()=delete

Static Private Attributes

static QPen m_shape_pen
static bool m_has_shape_pen = false
static QBrush m_shape_brush
static bool m_has_shape_brush = false
static QFont m_text_font
static bool m_has_text_font = false

Detailed Description

The LastUsedStyle class Session-scoped "last used" style for new shapes and free text created on the diagram canvas: whatever pen/brush/font was last applied through the properties editors becomes the starting point for the next new item of that type, the way most drawing tools behave.

Deliberately in-memory only, not QSettings-backed: this is a live "what did I just use" value for the current editing session, not an app-wide default (that's already covered by the Preferences dialog's font setting, read as the fallback when nothing has been set yet).

Constructor & Destructor Documentation

◆ LastUsedStyle()

LastUsedStyle::LastUsedStyle ( )
privatedelete

Member Function Documentation

◆ hasShapeBrush()

bool LastUsedStyle::hasShapeBrush ( )
static
Returns
true if a shape brush was set this session
Here is the caller graph for this function:

◆ hasShapePen()

bool LastUsedStyle::hasShapePen ( )
static
Returns
true if a shape pen was set this session
Here is the caller graph for this function:

◆ hasTextFont()

bool LastUsedStyle::hasTextFont ( )
static
Returns
true if a text font was set this session
Here is the caller graph for this function:

◆ setShapeBrush()

void LastUsedStyle::setShapeBrush ( const QBrush & brush)
static

LastUsedStyle::setShapeBrush Record brush as the last-used shape brush for this session.

Parameters
brush
Here is the caller graph for this function:

◆ setShapePen()

void LastUsedStyle::setShapePen ( const QPen & pen)
static

LastUsedStyle::setShapePen Record pen as the last-used shape pen for this session.

Parameters
pen
Here is the caller graph for this function:

◆ setTextFont()

void LastUsedStyle::setTextFont ( const QFont & font)
static

LastUsedStyle::setTextFont Record font as the last-used free text font for this session.

Parameters
font
Here is the caller graph for this function:

◆ shapeBrush()

QBrush LastUsedStyle::shapeBrush ( )
static
Returns
the last brush applied to a shape this session
Here is the caller graph for this function:

◆ shapePen()

QPen LastUsedStyle::shapePen ( )
static
Returns
the last pen applied to a shape this session
Here is the caller graph for this function:

◆ textFont()

QFont LastUsedStyle::textFont ( )
static
Returns
the last font applied to a free text item this session
Here is the caller graph for this function:

Member Data Documentation

◆ m_has_shape_brush

bool LastUsedStyle::m_has_shape_brush = false
staticprivate

◆ m_has_shape_pen

bool LastUsedStyle::m_has_shape_pen = false
staticprivate

◆ m_has_text_font

bool LastUsedStyle::m_has_text_font = false
staticprivate

◆ m_shape_brush

QBrush LastUsedStyle::m_shape_brush
staticprivate

◆ m_shape_pen

QPen LastUsedStyle::m_shape_pen
staticprivate

◆ m_text_font

QFont LastUsedStyle::m_text_font
staticprivate

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