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 <KPropertyListData> | 26 | #include <KPropertyListData> | ||
26 | #include <KPropertySet> | 27 | #include <KPropertySet> | ||
27 | 28 | | |||
28 | #include <QPalette> | 29 | #include <QPalette> | ||
29 | #include <QDomNodeList> | 30 | #include <QDomNodeList> | ||
30 | #include <QFontMetrics> | 31 | #include <QFontMetrics> | ||
31 | #include <QApplication> | 32 | #include <QApplication> | ||
32 | 33 | | |||
33 | KReportItemField::KReportItemField() | 34 | KReportItemField::KReportItemField() | ||
34 | { | 35 | { | ||
35 | createProperties(); | 36 | createProperties(); | ||
36 | } | 37 | } | ||
37 | 38 | | |||
38 | KReportItemField::KReportItemField(const QDomNode & element) | 39 | KReportItemField::KReportItemField(const QDomNode & element) | ||
39 | : KReportItemField() | 40 | : KReportItemField() | ||
40 | { | 41 | { | ||
41 | nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); | 42 | nameProperty()->setValue(KReportUtils::readNameAttribute(element.toElement())); | ||
42 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | 43 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | ||
43 | m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value"))); | 44 | m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value"))); | ||
44 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | 45 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | ||
45 | m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align"))); | 46 | m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align"))); | ||
46 | m_verticalAlignment->setValue(element.toElement().attribute(QLatin1String("report:vertical-align"))); | 47 | m_verticalAlignment->setValue(element.toElement().attribute(QLatin1String("report:vertical-align"))); | ||
47 | 48 | | |||
48 | m_canGrow->setValue(element.toElement().attribute(QLatin1String("report:can-grow"))); | 49 | m_canGrow->setValue(element.toElement().attribute(QLatin1String("report:can-grow"))); | ||
49 | m_wordWrap->setValue(element.toElement().attribute(QLatin1String("report:word-wrap"))); | 50 | m_wordWrap->setValue(element.toElement().attribute(QLatin1String("report:word-wrap"))); | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 88 | { | |||
105 | m_font = new KProperty("font", QApplication::font(), tr("Font")); | 106 | m_font = new KProperty("font", QApplication::font(), tr("Font")); | ||
106 | 107 | | |||
107 | 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")); | ||
108 | 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")); | ||
109 | 110 | | |||
110 | m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity")); | 111 | m_backgroundOpacity = new KProperty("background-opacity", QVariant(0), tr("Background Opacity")); | ||
111 | m_backgroundOpacity->setOption("max", 100); | 112 | m_backgroundOpacity->setOption("max", 100); | ||
112 | m_backgroundOpacity->setOption("min", 0); | 113 | m_backgroundOpacity->setOption("min", 0); | ||
113 | m_backgroundOpacity->setOption("unit", QLatin1String("%")); | 114 | m_backgroundOpacity->setOption("suffix", QLatin1String("%")); | ||
114 | 115 | | |||
115 | m_lineWeight = new KProperty("line-weight", 1.0, tr("Line Weight")); | 116 | m_lineWeight = new KProperty("line-weight", 1.0, tr("Line Weight")); | ||
116 | m_lineWeight->setOption("step", 1.0); | 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", static_cast<int>(Qt::NoPen), tr("Line Style"), QString(), KProperty::LineStyle); | 119 | m_lineStyle = new KProperty("line-style", static_cast<int>(Qt::NoPen), tr("Line Style"), QString(), KProperty::LineStyle); | ||
119 | 120 | | |||
120 | m_wordWrap = new KProperty("word-wrap", QVariant(false), tr("Word Wrap")); | 121 | m_wordWrap = new KProperty("word-wrap", QVariant(false), tr("Word Wrap")); | ||
121 | m_canGrow = new KProperty("can-grow", QVariant(false), tr("Can Grow")); | 122 | m_canGrow = new KProperty("can-grow", QVariant(false), tr("Can Grow")); | ||
▲ Show 20 Lines • Show All 167 Lines • Show Last 20 Lines |