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 <KPropertySet> | 22 | #include <KPropertySet> | ||
22 | 23 | | |||
23 | #include <QDomNode> | 24 | #include <QDomNode> | ||
24 | 25 | | |||
25 | #include "kreportplugin_debug.h" | 26 | #include "kreportplugin_debug.h" | ||
26 | 27 | | |||
27 | #include "barcodes.h" | 28 | #include "barcodes.h" | ||
28 | 29 | | |||
29 | KReportItemBarcode::KReportItemBarcode() | 30 | KReportItemBarcode::KReportItemBarcode() | ||
30 | : m_minWidthData(0), m_minWidthTotal(0), m_minHeight(0) | 31 | : m_minWidthData(0), m_minWidthTotal(0), m_minHeight(0) | ||
31 | { | 32 | { | ||
32 | createProperties(); | 33 | createProperties(); | ||
33 | } | 34 | } | ||
34 | 35 | | |||
35 | KReportItemBarcode::KReportItemBarcode(const QDomNode & element) | 36 | KReportItemBarcode::KReportItemBarcode(const QDomNode & element) | ||
36 | : KReportItemBarcode() | 37 | : KReportItemBarcode() | ||
37 | { | 38 | { | ||
38 | nameProperty()->setValue(element.toElement().attribute(QLatin1String("report:name"))); | 39 | nameProperty()->setValue(KReportUtils::readNameAttribute(element.toElement())); | ||
39 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | 40 | m_controlSource->setValue(element.toElement().attribute(QLatin1String("report:item-data-source"))); | ||
40 | m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value"))); | 41 | m_itemValue->setValue(element.toElement().attribute(QLatin1String("report:value"))); | ||
41 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | 42 | setZ(element.toElement().attribute(QLatin1String("report:z-index")).toDouble()); | ||
42 | m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align"))); | 43 | m_horizontalAlignment->setValue(element.toElement().attribute(QLatin1String("report:horizontal-align"))); | ||
43 | m_maxLength->setValue(element.toElement().attribute(QLatin1String("report:barcode-max-length")).toInt()); | 44 | m_maxLength->setValue(element.toElement().attribute(QLatin1String("report:barcode-max-length")).toInt()); | ||
44 | m_format->setValue(element.toElement().attribute(QLatin1String("report:barcode-format"))); | 45 | m_format->setValue(element.toElement().attribute(QLatin1String("report:barcode-format"))); | ||
45 | parseReportRect(element.toElement()); | 46 | parseReportRect(element.toElement()); | ||
46 | | ||||
47 | } | 47 | } | ||
48 | 48 | | |||
49 | void KReportItemBarcode::setMaxLength(int i) | 49 | void KReportItemBarcode::setMaxLength(int i) | ||
50 | { | 50 | { | ||
51 | if (i > 0) { | 51 | if (i > 0) { | ||
52 | if (m_maxLength->value().toInt() != i) { | 52 | if (m_maxLength->value().toInt() != i) { | ||
53 | m_maxLength->setValue(i); | 53 | m_maxLength->setValue(i); | ||
54 | } | 54 | } | ||
▲ Show 20 Lines • Show All 195 Lines • Show Last 20 Lines |