Changeset View
Changeset View
Standalone View
Standalone View
src/items/field/KReportItemField.cpp
Show All 11 Lines | |||||
12 | * Lesser General Public License for more details. | 12 | * Lesser General Public License for more details. | ||
13 | * | 13 | * | ||
14 | * You should have received a copy of the GNU Lesser General Public | 14 | * You should have received a copy of the GNU Lesser General Public | ||
15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 15 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
16 | */ | 16 | */ | ||
17 | 17 | | |||
18 | #include "KReportItemField.h" | 18 | #include "KReportItemField.h" | ||
19 | #include "KReportRenderObjects.h" | 19 | #include "KReportRenderObjects.h" | ||
20 | #include "KReportUtils.h" | ||||
20 | #include "kreportplugin_debug.h" | 21 | #include "kreportplugin_debug.h" | ||
21 | #ifdef KREPORT_SCRIPTING | 22 | #ifdef KREPORT_SCRIPTING | ||
22 | #include "renderer/scripting/KReportScriptHandler.h" | 23 | #include "renderer/scripting/KReportScriptHandler.h" | ||
23 | #endif | 24 | #endif | ||
24 | 25 | | |||
25 | #include <KPropertySet> | 26 | #include <KPropertySet> | ||
26 | 27 | | |||
27 | #include <QPalette> | 28 | #include <QPalette> | ||
28 | #include <QDomNodeList> | 29 | #include <QDomNodeList> | ||
29 | #include <QFontMetrics> | 30 | #include <QFontMetrics> | ||
30 | #include <QApplication> | 31 | #include <QApplication> | ||
31 | 32 | | |||
32 | KReportItemField::KReportItemField() | 33 | KReportItemField::KReportItemField() | ||
33 | { | 34 | { | ||
34 | createProperties(); | 35 | createProperties(); | ||
35 | } | 36 | } | ||
36 | 37 | | |||
37 | KReportItemField::KReportItemField(const QDomNode & element) | 38 | KReportItemField::KReportItemField(const QDomNode & element) | ||
38 | : KReportItemField() | 39 | : KReportItemField() | ||
39 | { | 40 | { | ||
40 | nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); | 41 | nameProperty()->setValue(KReportUtils::readNameAttribute(element.toElement())); | ||
41 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | 42 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | ||
42 | m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value"))); | 43 | m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value"))); | ||
43 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | 44 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | ||
44 | m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align"))); | 45 | m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align"))); | ||
45 | m_verticalAlignment->setValue(element.toElement().attribute(QLatin1String("report:vertical-align"))); | 46 | m_verticalAlignment->setValue(element.toElement().attribute(QLatin1String("report:vertical-align"))); | ||
46 | 47 | | |||
47 | m_canGrow->setValue(element.toElement().attribute(QLatin1String("report:can-grow"))); | 48 | m_canGrow->setValue(element.toElement().attribute(QLatin1String("report:can-grow"))); | ||
48 | m_wordWrap->setValue(element.toElement().attribute(QLatin1String("report:word-wrap"))); | 49 | m_wordWrap->setValue(element.toElement().attribute(QLatin1String("report:word-wrap"))); | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 87 | { | |||
104 | m_font = new KProperty("font", QApplication::font(), tr("Font")); | 105 | m_font = new KProperty("font", QApplication::font(), tr("Font")); | ||
105 | 106 | | |||
106 | m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color")); | 107 | m_backgroundColor = new KProperty("background-color", QColor(Qt::white), tr("Background Color")); | ||
107 | m_foregroundColor = new KProperty("foreground-color", QColor(Qt::black), tr("Foreground Color")); | 108 | m_foregroundColor = new KProperty("foreground-color", QColor(Qt::black), tr("Foreground Color")); | ||
108 | 109 | | |||
109 | m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity")); | 110 | m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity")); | ||
110 | m_backgroundOpacity->setOption("max", 100); | 111 | m_backgroundOpacity->setOption("max", 100); | ||
111 | m_backgroundOpacity->setOption("min", 0); | 112 | m_backgroundOpacity->setOption("min", 0); | ||
112 | m_backgroundOpacity->setOption("unit", QLatin1String("%")); | 113 | m_backgroundOpacity->setOption("suffix", QLatin1String("%")); | ||
113 | 114 | | |||
114 | m_lineWeight = new KProperty("line-weight", 1.0, tr("Line Weight")); | 115 | m_lineWeight = new KProperty("line-weight", 1.0, tr("Line Weight")); | ||
115 | m_lineWeight->setOption("step", 1.0); | 116 | m_lineWeight->setOption("step", 1.0); | ||
116 | m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color")); | 117 | m_lineColor = new KProperty("line-color", QColor(Qt::black), tr("Line Color")); | ||
117 | m_lineStyle = new KProperty("line-style", static_cast<int>(Qt::NoPen), tr("Line Style"), QString(), KProperty::LineStyle); | 118 | m_lineStyle = new KProperty("line-style", static_cast<int>(Qt::NoPen), tr("Line Style"), QString(), KProperty::LineStyle); | ||
118 | 119 | | |||
119 | m_wordWrap = new KProperty("word-wrap", QVariant(false), tr("Word Wrap")); | 120 | m_wordWrap = new KProperty("word-wrap", QVariant(false), tr("Word Wrap")); | ||
120 | m_canGrow = new KProperty("can-grow", QVariant(false), tr("Can Grow")); | 121 | m_canGrow = new KProperty("can-grow", QVariant(false), tr("Can Grow")); | ||
▲ Show 20 Lines • Show All 167 Lines • Show Last 20 Lines |