A set of utility functions used by SALOME style to draw widgets.
#include <Style_Tools.h>
Public Types | |
| enum | RoundType { None = 0x00000000, All = 0x00000001, Right = 0x00000002, Left = 0x00000004, TopLeft = 0x00000008, TopRight = 0x00000010, BottomLeft = 0x00000020, BottomRight = 0x00000040 } |
| Rounding operation type. More... | |
| enum | ShadowType { WholePath, BottomPath, TopPath } |
| Shadow type. More... | |
| enum | SliderType { SlUp, SlDown, SlLeft, SlRight, SlNone } |
| Slider type. More... | |
Static Public Member Functions | |
| static QPainterPath | painterPath (const QRect &) |
| Create painter path for specified rectangle. More... | |
| static QPainterPath | substractPath (const QPainterPath &, const QPainterPath &) |
| Create painter path by subtracting painter path path from another painter path fromPath. More... | |
| static QPainterPath | roundRect (const QRect &, const double, int=0, int=0) |
| Create painter path basing on specified rectangle r with rounded corners specified by radius r, operation type and shadow type shType. More... | |
| static void | roundRect (QPainter *, const QRect &, const double, const int, const QColor &, const QColor &, bool=true, bool=true) |
| Draw rectangle with rounded corners. More... | |
| static void | shadowRect (QPainter *, const QRect &, const double, const double, const int, int, const QColor &, const QColor &, const QColor &, const QColor &, const bool, const bool, const bool=false, const bool=true) |
| Draw rectangle with rounded corners and shadow. More... | |
| static void | shadowCheck (QPainter *, const QRect &, const double, const int, const QColor &, const QColor &, const QColor &, const QColor &) |
| Draw shadow of the check-mark. More... | |
| static void | arrowRect (QPainter *, const QRect &, const QColor &, const QColor &, const QColor &) |
| Draw rectnagle arrow. More... | |
| static void | fillRect (QPainter *, const QRect &, const QColor &, const QColor &, const int=255) |
| Fill rectangle with gradiented background. More... | |
| static void | drawArrow (QStyle::PrimitiveElement, QPainter *, const QRect &, const QColor &, const QColor &) |
| Draw arrow (for example, for combo-box drop-down menu button) More... | |
| static void | drawSign (QStyle::PrimitiveElement, QPainter *, const QRect &, const QColor &, const QColor &) |
| Draw indicator (for example, for spin box's increment/decrement buttons) More... | |
| static QPainterPath | tabRect (QPainter *, const QRect &, const int, const double, const double, const QColor &, const QColor &, const QColor &, const QColor &, const bool, const bool, const bool, const bool=false, const bool=true) |
| Create painter path for tab bar and optionally draw it. More... | |
| static void | drawFocus (QPainter *, const QRect &, const double, const int, const QColor &) |
| Draw widget's focus. More... | |
| static void | drawFocus (QPainter *, const QPainterPath &, const QColor &, const bool=true) |
| Draw widget's focus. More... | |
| static void | drawSlider (QPainter *, const QRect &, const double, SliderType, const QColor &, const QColor &, const QColor &, const QColor &) |
| Draw slider. More... | |
| static void | highlightRect (QPainter *, const QRect &, const double, const int, const double, const QColor &, const QColor &, const QColor &) |
| Draw highlighted rectangle. More... | |
| static int | getMinDelta (const QRect &, const QSize &, const int) |
| Get minimal delta value (the minimum between rect and size dimensions) More... | |
| static int | getMaxRect (const QRect &, const int) |
| Get halved size of the quadrangle covering specified rectangle. More... | |
|
static |
| p | painter |
| re | drawing rectangle |
| frame | frame color |
| gr1 | background's first gradient color |
| gr2 | background's second gradient color |
|
static |
| type | primitive type |
| p | painter |
| r | drawing rectangle |
| pen | foreground painter pen |
| brush | background painter brush |
|
static |
| p | painter |
| aRect | drawing rectangle |
| rad | rounding radius |
| type | rounding operation type |
| border | focus rectangle color |
References roundRect().
|
static |
| p | painter |
| path | drawing painter path |
| border | focus rectangle color |
| line | if true, focus is drawn as dotted line |
|
static |
| type | primitive type |
| p | painter |
| r | drawing rectangle |
| pen | foreground painter pen |
| brush | background painter brush |
|
static |
| p | painter |
| r | drawing rectangle |
| rad | rounding radius |
| slider | slider type |
| light | background's first gradient color |
| dark | background's second gradient color |
| border_top | top-left border's color |
| border_bot | bottom-right border's color |
References All, getMaxRect(), roundRect(), SlDown, SlLeft, SlNone, SlRight, and SlUp.
|
static |
| p | painter |
| re | drawing rectangle |
| c1 | background's first gradient color |
| c2 | background's second gradient color |
| rect | rectangle |
| defRect | default quadranle size value |
| rect | rectangle |
| size | size |
| defDelta | default minimum delta |
|
static |
| p | painter |
| rect | drawing rectangle |
| rad | rounding radius |
| type | rounding operation type marg margin size |
| center | background's center gradient color |
| out_center | background's second color |
| border | border color |
References roundRect().
|
static |
| r | rectangle on which painter path is build |
|
static |
| r | initial rectangle |
| rad | rounding radius |
| type | rounding type operation (Style_Tools::RoundType) |
| shType | shadow type (Style_Tools::ShadowType) |
References All, BottomLeft, BottomPath, BottomRight, getMaxRect(), Left, None, painterPath(), Right, TopLeft, TopPath, TopRight, and WholePath.
|
static |
| p | painter |
| r | drawing rectangle |
| rad | corner rounding radius |
| type | rounding type operation (Style_Tools::RoundType) |
| c1 | first gradient color |
| c2 | second gradient color |
| fill | if true rectangle is filled with gradiented background according to c1 and c2 |
| antial | if true, rectangle corners are anti-aliased |
References roundRect().
|
static |
| p | painter |
| r | drawing rectangle |
| rad | corner rounding radius |
| type | rounding type operation (Style_Tools::RoundType) |
| light | background's first gradient color |
| dark | background's second gradient color |
| border_top | top-left border's color |
| border_bot | bottom-right border's color |
References BottomPath, roundRect(), and TopPath.
|
static |
| p | painter |
| r | drawing rectangle |
| rad | corner rounding radius |
| marg | drawing margin |
| shad | shadow size |
| type | rounding type operation (Style_Tools::RoundType) |
| light | background's first gradient color |
| dark | background's second gradient color |
| border_top | top-left border's color |
| border_bot | bottom-right border's color |
| antialize | if true, rectangle corners are anti-aliased |
| isButton | true if button is drawn |
| btnOn | true if button is drawn and it is pressed |
| fill | if true rectangle is filled with gradiented background according to light and dark |
References BottomPath, roundRect(), and TopPath.
|
static |
| fromPath | initial painter path |
| path | painter path being subtracted from fromPath |
|
static |
| p | painter |
| r | drawing rectangle |
| position | tab position |
| rad | rounding radius |
| delta | gap between tabs |
| light | background's first gradient color |
| dark | background's second gradient color |
| border_top | top-left border's color |
| border_bot | bottom-right border's color |
| selected | true if tab is selected |
| isLast | true if tab is last in the tabs list |
| isHover | true if tab is hovered |
| focusRect | focus rectangle |
| draw | if true, tab bar is drawn |
References drawFocus(), and getMaxRect().