Changeset View
Changeset View
Standalone View
Standalone View
widgets/toolbars/options/kpToolWidgetFillStyle.cpp
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | |||||
42 | #include <qpainter.h> | 42 | #include <qpainter.h> | ||
43 | #include <qpixmap.h> | 43 | #include <qpixmap.h> | ||
44 | 44 | | |||
45 | //--------------------------------------------------------------------- | 45 | //--------------------------------------------------------------------- | ||
46 | 46 | | |||
47 | kpToolWidgetFillStyle::kpToolWidgetFillStyle (QWidget *parent, const QString &name) | 47 | kpToolWidgetFillStyle::kpToolWidgetFillStyle (QWidget *parent, const QString &name) | ||
48 | : kpToolWidgetBase (parent, name) | 48 | : kpToolWidgetBase (parent, name) | ||
49 | { | 49 | { | ||
50 | for (int i = 0; i < (int) FillStyleNum; i++) | 50 | for (int i = 0; i < FillStyleNum; i++) | ||
51 | { | 51 | { | ||
52 | QPixmap pixmap; | 52 | QPixmap pixmap; | ||
53 | 53 | | |||
54 | pixmap = fillStylePixmap ((FillStyle) i, | 54 | pixmap = fillStylePixmap (static_cast<FillStyle> (i), | ||
55 | (width () - 2/*margin*/) * 3 / 4, | 55 | (width () - 2/*margin*/) * 3 / 4, | ||
56 | (height () - 2/*margin*/ - 2/*spacing*/) * 3 / (3 * 4)); | 56 | (height () - 2/*margin*/ - 2/*spacing*/) * 3 / (3 * 4)); | ||
57 | addOption (pixmap, fillStyleName ((FillStyle) i)/*tooltip*/); | 57 | addOption (pixmap, fillStyleName (static_cast<FillStyle> (i))/*tooltip*/); | ||
58 | 58 | | |||
59 | startNewOptionRow (); | 59 | startNewOptionRow (); | ||
60 | } | 60 | } | ||
61 | 61 | | |||
62 | finishConstruction (0, 0); | 62 | finishConstruction (0, 0); | ||
63 | } | 63 | } | ||
64 | 64 | | |||
65 | //--------------------------------------------------------------------- | 65 | //--------------------------------------------------------------------- | ||
▲ Show 20 Lines • Show All 73 Lines • ▼ Show 20 Line(s) | |||||
139 | // public | 139 | // public | ||
140 | kpToolWidgetFillStyle::FillStyle kpToolWidgetFillStyle::fillStyle () const | 140 | kpToolWidgetFillStyle::FillStyle kpToolWidgetFillStyle::fillStyle () const | ||
141 | { | 141 | { | ||
142 | #if DEBUG_KP_TOOL_WIDGET_FILL_STYLE | 142 | #if DEBUG_KP_TOOL_WIDGET_FILL_STYLE | ||
143 | qCDebug(kpLogWidgets) << "kpToolWidgetFillStyle::fillStyle() selected=" | 143 | qCDebug(kpLogWidgets) << "kpToolWidgetFillStyle::fillStyle() selected=" | ||
144 | << selectedRow () | 144 | << selectedRow () | ||
145 | << endl; | 145 | << endl; | ||
146 | #endif | 146 | #endif | ||
147 | return (FillStyle) selectedRow (); | 147 | return static_cast<FillStyle> (selectedRow ()); | ||
148 | } | 148 | } | ||
149 | 149 | | |||
150 | //--------------------------------------------------------------------- | 150 | //--------------------------------------------------------------------- | ||
151 | 151 | | |||
152 | kpColor kpToolWidgetFillStyle::drawingBackgroundColor ( | 152 | kpColor kpToolWidgetFillStyle::drawingBackgroundColor ( | ||
153 | const kpColor &foregroundColor, const kpColor &backgroundColor) const | 153 | const kpColor &foregroundColor, const kpColor &backgroundColor) const | ||
154 | { | 154 | { | ||
155 | switch (fillStyle ()) | 155 | switch (fillStyle ()) | ||
Show All 26 Lines |