Changeset View
Changeset View
Standalone View
Standalone View
src/items/label/KReportItemLabel.cpp
Show First 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 54 | if (parseReportTextStyleData(node.toElement(), &ts)) { | |||
---|---|---|---|---|---|
56 | m_foregroundColor->setValue(ts.foregroundColor); | 56 | m_foregroundColor->setValue(ts.foregroundColor); | ||
57 | m_backgroundOpacity->setValue(ts.backgroundOpacity); | 57 | m_backgroundOpacity->setValue(ts.backgroundOpacity); | ||
58 | m_font->setValue(ts.font); | 58 | m_font->setValue(ts.font); | ||
59 | 59 | | |||
60 | } | 60 | } | ||
61 | } else if (n == QLatin1String("report:line-style")) { | 61 | } else if (n == QLatin1String("report:line-style")) { | ||
62 | KReportLineStyle ls; | 62 | KReportLineStyle ls; | ||
63 | if (parseReportLineStyleData(node.toElement(), &ls)) { | 63 | if (parseReportLineStyleData(node.toElement(), &ls)) { | ||
64 | m_lineWeight->setValue(ls.width()); | 64 | m_lineWeight->setValue(ls.width()); | ||
staniek: Same note | |||||
65 | m_lineColor->setValue(ls.color()); | 65 | m_lineColor->setValue(ls.color()); | ||
66 | m_lineStyle->setValue(QPen(ls.penStyle())); | 66 | m_lineStyle->setValue(static_cast<int>(ls.penStyle())); | ||
67 | } | 67 | } | ||
68 | } else { | 68 | } else { | ||
69 | kreportpluginWarning() << "while parsing label element encountered unknown element: " << n; | 69 | kreportpluginWarning() << "while parsing label element encountered unknown element: " << n; | ||
70 | } | 70 | } | ||
71 | } | 71 | } | ||
72 | } | 72 | } | ||
73 | 73 | | |||
74 | KReportItemLabel::~KReportItemLabel() | 74 | KReportItemLabel::~KReportItemLabel() | ||
Show All 33 Lines | 90 | { | |||
108 | m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color")); | 108 | m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color")); | ||
109 | m_foregroundColor = new KProperty("foreground-color", QColor(Qt::black), tr("Foreground Color")); | 109 | m_foregroundColor = new KProperty("foreground-color", QColor(Qt::black), tr("Foreground Color")); | ||
110 | 110 | | |||
111 | m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity")); | 111 | m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity")); | ||
112 | m_backgroundOpacity->setOption("max", 100); | 112 | m_backgroundOpacity->setOption("max", 100); | ||
113 | m_backgroundOpacity->setOption("min", 0); | 113 | m_backgroundOpacity->setOption("min", 0); | ||
114 | m_backgroundOpacity->setOption("unit", QLatin1String("%")); | 114 | m_backgroundOpacity->setOption("unit", QLatin1String("%")); | ||
115 | 115 | | |||
116 | m_lineWeight = new KProperty("line-weight", 1, tr("Line Weight")); | 116 | m_lineWeight = new KProperty("line-weight", 1.0, tr("Line Weight")); | ||
117 | m_lineWeight->setOption("step", 1.0); | ||||
117 | m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color")); | 118 | m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color")); | ||
118 | m_lineStyle = new KProperty("line-style", QPen(Qt::NoPen), tr("Line Style"), tr("Line Style"), KProperty::LineStyle); | 119 | m_lineStyle = new KProperty("line-style", static_cast<int>(Qt::NoPen), tr("Line Style"), tr("Line Style"), KProperty::LineStyle); | ||
119 | 120 | | |||
120 | addDefaultProperties(); | 121 | addDefaultProperties(); | ||
121 | m_set->addProperty(m_text); | 122 | m_set->addProperty(m_text); | ||
122 | m_set->addProperty(m_horizontalAlignment); | 123 | m_set->addProperty(m_horizontalAlignment); | ||
123 | m_set->addProperty(m_verticalAlignment); | 124 | m_set->addProperty(m_verticalAlignment); | ||
124 | m_set->addProperty(m_font); | 125 | m_set->addProperty(m_font); | ||
125 | m_set->addProperty(m_backgroundColor); | 126 | m_set->addProperty(m_backgroundColor); | ||
126 | m_set->addProperty(m_foregroundColor); | 127 | m_set->addProperty(m_foregroundColor); | ||
Show All 34 Lines | 158 | { | |||
161 | d.font = m_font->value().value<QFont>(); | 162 | d.font = m_font->value().value<QFont>(); | ||
162 | d.backgroundOpacity = m_backgroundOpacity->value().toInt(); | 163 | d.backgroundOpacity = m_backgroundOpacity->value().toInt(); | ||
163 | return d; | 164 | return d; | ||
164 | } | 165 | } | ||
165 | 166 | | |||
166 | KReportLineStyle KReportItemLabel::lineStyle() const | 167 | KReportLineStyle KReportItemLabel::lineStyle() const | ||
167 | { | 168 | { | ||
168 | KReportLineStyle ls; | 169 | KReportLineStyle ls; | ||
169 | ls.setWidth(m_lineWeight->value().toInt()); | 170 | ls.setWidth(m_lineWeight->value().toReal()); | ||
170 | ls.setColor(m_lineColor->value().value<QColor>()); | 171 | ls.setColor(m_lineColor->value().value<QColor>()); | ||
171 | ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt()); | 172 | ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt()); | ||
172 | return ls; | 173 | return ls; | ||
173 | } | 174 | } | ||
174 | 175 | | |||
175 | // RTTI | 176 | // RTTI | ||
176 | QString KReportItemLabel::typeName() const | 177 | QString KReportItemLabel::typeName() const | ||
177 | { | 178 | { | ||
Show All 35 Lines |
Same note