Changeset View
Changeset View
Standalone View
Standalone View
src/plugins/barcode/KReportItemBarcode.cpp
Show All 10 Lines | |||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
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 "KReportItemBarcode.h" | 18 | #include "KReportItemBarcode.h" | ||
19 | #include "KReportUtils.h" | ||||
19 | 20 | | |||
20 | #include <KProperty> | 21 | #include <KProperty> | ||
21 | #include <KPropertyListData> | 22 | #include <KPropertyListData> | ||
22 | #include <KPropertySet> | 23 | #include <KPropertySet> | ||
23 | 24 | | |||
24 | #include <QDomNode> | 25 | #include <QDomNode> | ||
25 | 26 | | |||
26 | #include "kreportplugin_debug.h" | 27 | #include "kreportplugin_debug.h" | ||
27 | 28 | | |||
28 | #include "barcodes.h" | 29 | #include "barcodes.h" | ||
29 | 30 | | |||
30 | KReportItemBarcode::KReportItemBarcode() | 31 | KReportItemBarcode::KReportItemBarcode() | ||
31 | : m_minWidthData(0), m_minWidthTotal(0), m_minHeight(0) | 32 | : m_minWidthData(0), m_minWidthTotal(0), m_minHeight(0) | ||
32 | { | 33 | { | ||
33 | createProperties(); | 34 | createProperties(); | ||
34 | } | 35 | } | ||
35 | 36 | | |||
36 | KReportItemBarcode::KReportItemBarcode(const QDomNode & element) | 37 | KReportItemBarcode::KReportItemBarcode(const QDomNode & element) | ||
37 | : KReportItemBarcode() | 38 | : KReportItemBarcode() | ||
38 | { | 39 | { | ||
39 | nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); | 40 | nameProperty()->setValue(KReportUtils::readNameAttribute(element.toElement())); | ||
40 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | 41 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | ||
41 | m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value"))); | 42 | m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value"))); | ||
42 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | 43 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | ||
43 | m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align"))); | 44 | m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align"))); | ||
44 | m_maxLength->setValue(element.toElement().attribute(QLatin1String("report:barcode-max-length")).toInt()); | 45 | m_maxLength->setValue(element.toElement().attribute(QLatin1String("report:barcode-max-length")).toInt()); | ||
45 | m_format->setValue(element.toElement().attribute(QLatin1String("report:barcode-format"))); | 46 | m_format->setValue(element.toElement().attribute(QLatin1String("report:barcode-format"))); | ||
46 | parseReportRect(element.toElement()); | 47 | parseReportRect(element.toElement()); | ||
47 | | ||||
48 | } | 48 | } | ||
49 | 49 | | |||
50 | void KReportItemBarcode::setMaxLength(int i) | 50 | void KReportItemBarcode::setMaxLength(int i) | ||
51 | { | 51 | { | ||
52 | if (i > 0) { | 52 | if (i > 0) { | ||
53 | if (m_maxLength->value().toInt() != i) { | 53 | if (m_maxLength->value().toInt() != i) { | ||
54 | m_maxLength->setValue(i); | 54 | m_maxLength->setValue(i); | ||
55 | } | 55 | } | ||
▲ Show 20 Lines • Show All 196 Lines • Show Last 20 Lines |