General graphic effect class for shapes displayed in the Workspace canvas.
#include <Workspace/Presentation/workspacegraphicseffect.h>
◆ Type
Enumerator |
---|
None | |
Outline | |
Shade | |
ShadeBackground | |
Desaturate | |
◆ WorkspaceGraphicsEffect()
◆ ~WorkspaceGraphicsEffect()
◆ boundingRectFor()
QRectF boundingRectFor |
( |
const QRectF & |
sourceRect | ) |
const |
|
override |
This graphics effect will draw stuff beyond the source pixmap's bounding rectangle. We need need to expand the graphics effect's rectangle to ensure it is always rendered correctly.
◆ draw()
void draw |
( |
QPainter * |
painter | ) |
|
|
overrideprotected |
◆ getDefaultHighlightColor()
const QColor & getDefaultHighlightColor |
( |
| ) |
|
|
static |
- Returns
- The default color for highlighted items.
◆ getDefaultHighlightWidthHover()
double getDefaultHighlightWidthHover |
( |
| ) |
|
|
static |
- Returns
- The default outline width for highlighted items.
◆ getDefaultHighlightWidthHoverSelected()
double getDefaultHighlightWidthHoverSelected |
( |
| ) |
|
|
static |
- Returns
- The default outline width for highlighted items that are also selected.
◆ getOutlineColor()
QColor getOutlineColor |
( |
| ) |
const |
◆ getOutlineWidth()
qreal getOutlineWidth |
( |
| ) |
const |
◆ getShadeColor()
QColor getShadeColor |
( |
| ) |
const |
◆ getShapeEffect()
WorkspaceGraphicsEffect::EffectType getShapeEffect |
( |
| ) |
const |
◆ popEffectState()
- Returns
- true if the pop() was effectual. False if there we are already at the top of the state stack.
Pops the current effect state off the top of the effect stack, restoring the previous state.
◆ pushEffectState()
Clones the current effect state and pushes another onto the top of the state stack. This allows local changes to be made to the state while allowing it to be easily restored.
- Note
- Ideally, rather than using this we would be able to have multiple graphics effects attached to a single graphics item, but this is not the way the Qt API works. For example, rather than pushing the graphics state, changing it, rendering, popping, then rendering again to restore, we would attach an additional graphics effect with different properties, then remove it. Instead, we have to internalise all our possible effect configurations within this class (or a derived class).
◆ restoreInitialState()
void restoreInitialState |
( |
| ) |
|
Restores the initial state of the graphics effect, removing any items from the top of the stack.
◆ setEffectType()
void setEffectType |
( |
EffectType |
effects | ) |
|
◆ setOutlineColor()
void setOutlineColor |
( |
QColor |
color | ) |
|
◆ setOutlineWidth()
void setOutlineWidth |
( |
qreal |
width | ) |
|
◆ setPath()
void setPath |
( |
const QPainterPath & |
path | ) |
|
◆ setShadeColor()
void setShadeColor |
( |
QColor |
color | ) |
|
◆ state() [1/2]
- Returns
- The current state of the graphics effect.
◆ state() [2/2]
- Returns
- The current state of the graphics effect.
◆ toggleEffect()
void toggleEffect |
( |
EffectType |
effect, |
|
|
bool |
toggle |
|
) |
| |