Changeset View
Changeset View
Standalone View
Standalone View
src/items/check/KReportItemCheck.cpp
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 36 | { | |||
---|---|---|---|---|---|
50 | 50 | | |||
51 | for (int i = 0; i < nl.count(); i++) { | 51 | for (int i = 0; i < nl.count(); i++) { | ||
52 | node = nl.item(i); | 52 | node = nl.item(i); | ||
53 | n = node.nodeName(); | 53 | n = node.nodeName(); | ||
54 | 54 | | |||
55 | if (n == QLatin1String("report:line-style")) { | 55 | if (n == QLatin1String("report:line-style")) { | ||
56 | KReportLineStyle ls; | 56 | KReportLineStyle ls; | ||
57 | if (parseReportLineStyleData(node.toElement(), &ls)) { | 57 | if (parseReportLineStyleData(node.toElement(), &ls)) { | ||
58 | m_lineWeight->setValue(ls.width()); | 58 | m_lineWeight->setValue(ls.width()); | ||
staniek: Same note | |||||
59 | m_lineColor->setValue(ls.color()); | 59 | m_lineColor->setValue(ls.color()); | ||
60 | m_lineStyle->setValue(QPen(ls.penStyle())); | 60 | m_lineStyle->setValue(static_cast<int>(ls.penStyle())); | ||
61 | } | 61 | } | ||
62 | } else { | 62 | } else { | ||
63 | kreportpluginWarning() << "while parsing check element encountered unknown element: " << n; | 63 | kreportpluginWarning() << "while parsing check element encountered unknown element: " << n; | ||
64 | } | 64 | } | ||
65 | } | 65 | } | ||
66 | 66 | | |||
67 | } | 67 | } | ||
68 | 68 | | |||
Show All 12 Lines | 75 | { | |||
81 | strings << tr("Cross") << tr("Tick") << tr("Dot"); | 81 | strings << tr("Cross") << tr("Tick") << tr("Dot"); | ||
82 | m_checkStyle = new KProperty("check-style", keys, strings, QLatin1String("Cross"), tr("Style")); | 82 | m_checkStyle = new KProperty("check-style", keys, strings, QLatin1String("Cross"), tr("Style")); | ||
83 | 83 | | |||
84 | m_controlSource = new KProperty("item-data-source", QStringList(), QStringList(), QString(), tr("Data Source")); | 84 | m_controlSource = new KProperty("item-data-source", QStringList(), QStringList(), QString(), tr("Data Source")); | ||
85 | m_controlSource->setOption("extraValueAllowed", QLatin1String("true")); | 85 | m_controlSource->setOption("extraValueAllowed", QLatin1String("true")); | ||
86 | 86 | | |||
87 | m_foregroundColor = new KProperty("foreground-color", QColor(Qt::black), tr("Foreground Color")); | 87 | m_foregroundColor = new KProperty("foreground-color", QColor(Qt::black), tr("Foreground Color")); | ||
88 | 88 | | |||
89 | m_lineWeight = new KProperty("line-weight", 1, tr("Line Weight")); | 89 | m_lineWeight = new KProperty("line-weight", 1.0, tr("Line Weight")); | ||
90 | m_lineWeight->setOption("step", 1.0); | ||||
90 | m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color")); | 91 | m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color")); | ||
91 | m_lineStyle = new KProperty("line-style", QPen(Qt::SolidLine), tr("Line Style"), tr("Line Style"), KProperty::LineStyle); | 92 | m_lineStyle = new KProperty("line-style", static_cast<int>(Qt::SolidLine), tr("Line Style"), tr("Line Style"), KProperty::LineStyle); | ||
92 | m_staticValue = new KProperty("value", QVariant(false), tr("Value"), tr("Value used if not bound to a field")); | 93 | m_staticValue = new KProperty("value", QVariant(false), tr("Value"), tr("Value used if not bound to a field")); | ||
93 | 94 | | |||
94 | addDefaultProperties(); | 95 | addDefaultProperties(); | ||
95 | m_set->addProperty(m_controlSource); | 96 | m_set->addProperty(m_controlSource); | ||
96 | m_set->addProperty(m_staticValue); | 97 | m_set->addProperty(m_staticValue); | ||
97 | m_set->addProperty(m_checkStyle); | 98 | m_set->addProperty(m_checkStyle); | ||
98 | m_set->addProperty(m_foregroundColor); | 99 | m_set->addProperty(m_foregroundColor); | ||
99 | m_set->addProperty(m_lineWeight); | 100 | m_set->addProperty(m_lineWeight); | ||
100 | m_set->addProperty(m_lineColor); | 101 | m_set->addProperty(m_lineColor); | ||
101 | m_set->addProperty(m_lineStyle); | 102 | m_set->addProperty(m_lineStyle); | ||
102 | } | 103 | } | ||
103 | 104 | | |||
104 | KReportLineStyle KReportItemCheckBox::lineStyle() | 105 | KReportLineStyle KReportItemCheckBox::lineStyle() | ||
105 | { | 106 | { | ||
106 | KReportLineStyle ls; | 107 | KReportLineStyle ls; | ||
107 | ls.setWidth(m_lineWeight->value().toInt()); | 108 | ls.setWidth(m_lineWeight->value().toReal()); | ||
108 | ls.setColor(m_lineColor->value().value<QColor>()); | 109 | ls.setColor(m_lineColor->value().value<QColor>()); | ||
109 | ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt()); | 110 | ls.setPenStyle((Qt::PenStyle)m_lineStyle->value().toInt()); | ||
110 | return ls; | 111 | return ls; | ||
111 | } | 112 | } | ||
112 | 113 | | |||
113 | QString KReportItemCheckBox::itemDataSource() const | 114 | QString KReportItemCheckBox::itemDataSource() const | ||
114 | { | 115 | { | ||
115 | return m_controlSource->value().toString(); | 116 | return m_controlSource->value().toString(); | ||
▲ Show 20 Lines • Show All 75 Lines • Show Last 20 Lines |
Same note