Changeset View
Changeset View
Standalone View
Standalone View
src/items/text/KReportItemText.cpp
Show First 20 Lines • Show All 59 Lines • ▼ Show 20 Line(s) | 58 | if (parseReportTextStyleData(node.toElement(), &ts)) { | |||
---|---|---|---|---|---|
60 | m_foregroundColor->setValue(ts.foregroundColor); | 60 | m_foregroundColor->setValue(ts.foregroundColor); | ||
61 | m_backgroundOpacity->setValue(ts.backgroundOpacity); | 61 | m_backgroundOpacity->setValue(ts.backgroundOpacity); | ||
62 | m_font->setValue(ts.font); | 62 | m_font->setValue(ts.font); | ||
63 | 63 | | |||
64 | } | 64 | } | ||
65 | } else if (n == QLatin1String("report:line-style")) { | 65 | } else if (n == QLatin1String("report:line-style")) { | ||
66 | KReportLineStyle ls; | 66 | KReportLineStyle ls; | ||
67 | if (parseReportLineStyleData(node.toElement(), &ls)) { | 67 | if (parseReportLineStyleData(node.toElement(), &ls)) { | ||
68 | m_lineWeight->setValue(ls.width()); | 68 | m_lineWeight->setValue(ls.width()); | ||
staniek: Same note | |||||
69 | m_lineColor->setValue(ls.color()); | 69 | m_lineColor->setValue(ls.color()); | ||
70 | m_lineStyle->setValue(QPen(ls.penStyle())); | 70 | m_lineStyle->setValue(static_cast<int>(ls.penStyle())); | ||
71 | } | 71 | } | ||
72 | } else { | 72 | } else { | ||
73 | kreportpluginWarning() << "while parsing field element encountered unknown element: " << n; | 73 | kreportpluginWarning() << "while parsing field element encountered unknown element: " << n; | ||
74 | } | 74 | } | ||
75 | } | 75 | } | ||
76 | 76 | | |||
77 | } | 77 | } | ||
78 | 78 | | |||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | 108 | { | |||
127 | strings << tr("Top") << tr("Center") << tr("Bottom"); | 127 | strings << tr("Top") << tr("Center") << tr("Bottom"); | ||
128 | m_verticalAlignment = new KProperty("vertical-align", keys, strings, QLatin1String("center"), tr("Vertical Alignment")); | 128 | m_verticalAlignment = new KProperty("vertical-align", keys, strings, QLatin1String("center"), tr("Vertical Alignment")); | ||
129 | 129 | | |||
130 | m_font = new KProperty("font", QApplication::font(), tr("Font")); | 130 | m_font = new KProperty("font", QApplication::font(), tr("Font")); | ||
131 | 131 | | |||
132 | m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color")); | 132 | m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color")); | ||
133 | m_foregroundColor = new KProperty("foreground-color", QColor(Qt::black), tr("Foreground Color")); | 133 | m_foregroundColor = new KProperty("foreground-color", QColor(Qt::black), tr("Foreground Color")); | ||
134 | 134 | | |||
135 | m_lineWeight = new KProperty("line-weight", 1, tr("Line Weight")); | 135 | m_lineWeight = new KProperty("line-weight", 1.0, tr("Line Weight")); | ||
136 | m_lineWeight->setOption("step", 1.0); | ||||
136 | m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color")); | 137 | m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color")); | ||
137 | m_lineStyle = new KProperty("line-style", QPen(Qt::NoPen), tr("Line Style"), tr("Line Style"), KProperty::LineStyle); | 138 | m_lineStyle = new KProperty("line-style", static_cast<int>(Qt::NoPen), tr("Line Style"), tr("Line Style"), KProperty::LineStyle); | ||
138 | m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity")); | 139 | m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity")); | ||
139 | m_backgroundOpacity->setOption("max", 100); | 140 | m_backgroundOpacity->setOption("max", 100); | ||
140 | m_backgroundOpacity->setOption("min", 0); | 141 | m_backgroundOpacity->setOption("min", 0); | ||
141 | m_backgroundOpacity->setOption("unit", QLatin1String("%")); | 142 | m_backgroundOpacity->setOption("unit", QLatin1String("%")); | ||
142 | 143 | | |||
143 | addDefaultProperties(); | 144 | addDefaultProperties(); | ||
144 | m_set->addProperty(m_controlSource); | 145 | m_set->addProperty(m_controlSource); | ||
145 | m_set->addProperty(m_itemValue); | 146 | m_set->addProperty(m_itemValue); | ||
Show All 34 Lines | 177 | { | |||
180 | d.font = m_font->value().value<QFont>(); | 181 | d.font = m_font->value().value<QFont>(); | ||
181 | d.backgroundOpacity = m_backgroundOpacity->value().toInt(); | 182 | d.backgroundOpacity = m_backgroundOpacity->value().toInt(); | ||
182 | return d; | 183 | return d; | ||
183 | } | 184 | } | ||
184 | 185 | | |||
185 | KReportLineStyle KReportItemText::lineStyle() const | 186 | KReportLineStyle KReportItemText::lineStyle() const | ||
186 | { | 187 | { | ||
187 | KReportLineStyle ls; | 188 | KReportLineStyle ls; | ||
188 | ls.setWidth(m_lineWeight->value().toInt()); | 189 | ls.setWidth(m_lineWeight->value().toReal()); | ||
189 | ls.setColor(m_lineColor->value().value<QColor>()); | 190 | ls.setColor(m_lineColor->value().value<QColor>()); | ||
190 | ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt()); | 191 | ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt()); | ||
191 | return ls; | 192 | return ls; | ||
192 | } | 193 | } | ||
193 | 194 | | |||
194 | // RTTI | 195 | // RTTI | ||
195 | QString KReportItemText::typeName() const | 196 | QString KReportItemText::typeName() const | ||
196 | { | 197 | { | ||
▲ Show 20 Lines • Show All 123 Lines • Show Last 20 Lines |
Same note