Changeset View
Changeset View
Standalone View
Standalone View
src/items/check/KReportItemCheck.cpp
Show First 20 Lines • Show All 114 Lines • ▼ Show 20 Line(s) | |||||
115 | QString KReportItemCheckBox::typeName() const | 115 | QString KReportItemCheckBox::typeName() const | ||
116 | { | 116 | { | ||
117 | return QLatin1String("check"); | 117 | return QLatin1String("check"); | ||
118 | } | 118 | } | ||
119 | 119 | | |||
120 | int KReportItemCheckBox::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, | 120 | int KReportItemCheckBox::renderSimpleData(OROPage *page, OROSection *section, const QPointF &offset, | ||
121 | const QVariant &data, KReportScriptHandler *script) | 121 | const QVariant &data, KReportScriptHandler *script) | ||
122 | { | 122 | { | ||
123 | OROCheck *chk = new OROCheck(); | 123 | OROCheckBox *chk = new OROCheckBox(); | ||
124 | 124 | | |||
125 | chk->setPosition(scenePosition(position()) + offset); | 125 | chk->setPosition(scenePosition(position()) + offset); | ||
126 | chk->setSize(sceneSize(size())); | 126 | chk->setSize(sceneSize(size())); | ||
127 | 127 | | |||
128 | chk->setLineStyle(lineStyle()); | 128 | chk->setLineStyle(lineStyle()); | ||
129 | chk->setForegroundColor(m_foregroundColor->value().value<QColor>()); | 129 | chk->setForegroundColor(m_foregroundColor->value().value<QColor>()); | ||
130 | chk->setCheckType(m_checkStyle->value().toString()); | 130 | if (m_checkStyle->value().toString() == QLatin1String("Cross")) { | ||
131 | chk->setCheckType(OROCheckBox::Cross); | ||||
132 | } else if (m_checkStyle->value().toString() == QLatin1String("Dot")) { | ||||
133 | chk->setCheckType(OROCheckBox::Dot); | ||||
134 | } else { | ||||
135 | chk->setCheckType(OROCheckBox::Tick); | ||||
136 | } | ||||
131 | 137 | | |||
132 | QString str; | 138 | QString str; | ||
133 | bool v = false; | 139 | bool v = false; | ||
134 | QString cs = itemDataSource(); | 140 | QString cs = itemDataSource(); | ||
135 | 141 | | |||
136 | //kreportpluginDebug() << "ControlSource:" << cs; | 142 | //kreportpluginDebug() << "ControlSource:" << cs; | ||
137 | if (!cs.isEmpty()) { | 143 | if (!cs.isEmpty()) { | ||
138 | #ifdef KREPORT_SCRIPTING | 144 | #ifdef KREPORT_SCRIPTING | ||
Show All 15 Lines | 150 | #endif | |||
154 | 160 | | |||
155 | } else { | 161 | } else { | ||
156 | v = value(); | 162 | v = value(); | ||
157 | } | 163 | } | ||
158 | 164 | | |||
159 | chk->setValue(v); | 165 | chk->setValue(v); | ||
160 | 166 | | |||
161 | if (page) { | 167 | if (page) { | ||
162 | page->addPrimitive(chk); | 168 | page->insertPrimitive(chk); | ||
163 | } | 169 | } | ||
164 | 170 | | |||
165 | if (section) { | 171 | if (section) { | ||
166 | OROCheck *chk2 = dynamic_cast<OROCheck*>(chk->clone()); | 172 | OROCheckBox *chk2 = dynamic_cast<OROCheckBox*>(chk->clone()); | ||
167 | chk2->setPosition(scenePosition(position())); | 173 | chk2->setPosition(scenePosition(position())); | ||
168 | section->addPrimitive(chk2); | 174 | section->addPrimitive(chk2); | ||
169 | } | 175 | } | ||
170 | 176 | | |||
171 | if (!page) { | 177 | if (!page) { | ||
172 | delete chk; | 178 | delete chk; | ||
173 | } | 179 | } | ||
174 | 180 | | |||
Show All 12 Lines |