Changeset View
Changeset View
Standalone View
Standalone View
src/items/field/KReportItemField.cpp
Show First 20 Lines • Show All 63 Lines • ▼ Show 20 Line(s) | 62 | if (parseReportTextStyleData(node.toElement(), &ts)) { | |||
---|---|---|---|---|---|
64 | m_foregroundColor->setValue(ts.foregroundColor); | 64 | m_foregroundColor->setValue(ts.foregroundColor); | ||
65 | m_backgroundOpacity->setValue(ts.backgroundOpacity); | 65 | m_backgroundOpacity->setValue(ts.backgroundOpacity); | ||
66 | m_font->setValue(ts.font); | 66 | m_font->setValue(ts.font); | ||
67 | 67 | | |||
68 | } | 68 | } | ||
69 | } else if (n == QLatin1String("report:line-style")) { | 69 | } else if (n == QLatin1String("report:line-style")) { | ||
70 | KReportLineStyle ls; | 70 | KReportLineStyle ls; | ||
71 | if (parseReportLineStyleData(node.toElement(), &ls)) { | 71 | if (parseReportLineStyleData(node.toElement(), &ls)) { | ||
72 | m_lineWeight->setValue(ls.width()); | 72 | m_lineWeight->setValue(ls.width()); | ||
staniek: Same note | |||||
73 | m_lineColor->setValue(ls.color()); | 73 | m_lineColor->setValue(ls.color()); | ||
74 | m_lineStyle->setValue(QPen(ls.penStyle())); | 74 | m_lineStyle->setValue(static_cast<int>(ls.penStyle())); | ||
75 | } | 75 | } | ||
76 | } else { | 76 | } else { | ||
77 | kreportpluginWarning() << "while parsing field element encountered unknown element: " << n; | 77 | kreportpluginWarning() << "while parsing field element encountered unknown element: " << n; | ||
78 | } | 78 | } | ||
79 | } | 79 | } | ||
80 | } | 80 | } | ||
81 | 81 | | |||
82 | KReportItemField::~KReportItemField() | 82 | KReportItemField::~KReportItemField() | ||
Show All 27 Lines | 88 | { | |||
110 | m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color")); | 110 | m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color")); | ||
111 | m_foregroundColor = new KProperty("foreground-color", QColor(Qt::black), tr("Foreground Color")); | 111 | m_foregroundColor = new KProperty("foreground-color", QColor(Qt::black), tr("Foreground Color")); | ||
112 | 112 | | |||
113 | m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity")); | 113 | m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity")); | ||
114 | m_backgroundOpacity->setOption("max", 100); | 114 | m_backgroundOpacity->setOption("max", 100); | ||
115 | m_backgroundOpacity->setOption("min", 0); | 115 | m_backgroundOpacity->setOption("min", 0); | ||
116 | m_backgroundOpacity->setOption("unit", QLatin1String("%")); | 116 | m_backgroundOpacity->setOption("unit", QLatin1String("%")); | ||
117 | 117 | | |||
118 | m_lineWeight = new KProperty("line-weight", 1, tr("Line Weight")); | 118 | m_lineWeight = new KProperty("line-weight", 1.0, tr("Line Weight")); | ||
119 | m_lineWeight->setOption("step", 1.0); | ||||
119 | m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color")); | 120 | m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color")); | ||
120 | m_lineStyle = new KProperty("line-style", QPen(Qt::NoPen), tr("Line Style"), tr("Line Style"), KProperty::LineStyle); | 121 | m_lineStyle = new KProperty("line-style", static_cast<int>(Qt::NoPen), tr("Line Style"), tr("Line Style"), KProperty::LineStyle); | ||
121 | 122 | | |||
122 | m_wordWrap = new KProperty("word-wrap", QVariant(false), tr("Word Wrap")); | 123 | m_wordWrap = new KProperty("word-wrap", QVariant(false), tr("Word Wrap")); | ||
123 | m_canGrow = new KProperty("can-grow", QVariant(false), tr("Can Grow")); | 124 | m_canGrow = new KProperty("can-grow", QVariant(false), tr("Can Grow")); | ||
124 | 125 | | |||
125 | //! @todo I do not think we need these | 126 | //! @todo I do not think we need these | ||
126 | #if 0 //Field Totals | 127 | #if 0 //Field Totals | ||
127 | m_trackTotal = new KProperty("trackTotal", QVariant(false), futureI18n("Track Total")); | 128 | m_trackTotal = new KProperty("trackTotal", QVariant(false), futureI18n("Track Total")); | ||
128 | m_trackBuiltinFormat = new KProperty("trackBuiltinFormat", QVariant(false), futureI18n("Track Builtin Format")); | 129 | m_trackBuiltinFormat = new KProperty("trackBuiltinFormat", QVariant(false), futureI18n("Track Builtin Format")); | ||
▲ Show 20 Lines • Show All 70 Lines • ▼ Show 20 Line(s) | 199 | if (m_controlSource->value() != t) { | |||
199 | m_controlSource->setValue(t); | 200 | m_controlSource->setValue(t); | ||
200 | } | 201 | } | ||
201 | //kreportpluginDebug() << "Field: " << entityName() << "is" << itemDataSource(); | 202 | //kreportpluginDebug() << "Field: " << entityName() << "is" << itemDataSource(); | ||
202 | } | 203 | } | ||
203 | 204 | | |||
204 | KReportLineStyle KReportItemField::lineStyle() const | 205 | KReportLineStyle KReportItemField::lineStyle() const | ||
205 | { | 206 | { | ||
206 | KReportLineStyle ls; | 207 | KReportLineStyle ls; | ||
207 | ls.setWidth(m_lineWeight->value().toInt()); | 208 | ls.setWidth(m_lineWeight->value().toReal()); | ||
208 | ls.setColor(m_lineColor->value().value<QColor>()); | 209 | ls.setColor(m_lineColor->value().value<QColor>()); | ||
209 | ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt()); | 210 | ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt()); | ||
210 | return ls; | 211 | return ls; | ||
211 | } | 212 | } | ||
212 | // RTTI | 213 | // RTTI | ||
213 | QString KReportItemField::typeName() const | 214 | QString KReportItemField::typeName() const | ||
214 | { | 215 | { | ||
215 | return QLatin1String("field"); | 216 | return QLatin1String("field"); | ||
▲ Show 20 Lines • Show All 76 Lines • Show Last 20 Lines |
Same note