KD Reports API Documentation  2.2
KDReportsElementData_p.h
Go to the documentation of this file.
1 /****************************************************************************
2 **
3 ** This file is part of the KD Reports library.
4 **
5 ** SPDX-FileCopyrightText: 2007 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
6 **
7 ** SPDX-License-Identifier: MIT
8 **
9 ****************************************************************************/
10 
11 #ifndef KDREPORTSELEMENTDATA_P_H
12 #define KDREPORTSELEMENTDATA_P_H
13 
14 //
15 // W A R N I N G
16 // -------------
17 //
18 // This file is not part of the KD Reports API. It exists purely as an
19 // implementation detail. This header file may change from version to
20 // version without notice, or even be removed.
21 //
22 // We mean it.
23 //
24 //
25 
26 #include "KDReportsElement.h"
27 #include "KDReportsVariableType.h"
28 
29 namespace KDReports {
30 
36 {
37  enum Type
38  {
43  };
44  // inline
46  : m_element(elem)
47  , m_type(Inline)
48  {
49  } // m_align not used
50  // block
51  ElementData(Element *elem, Qt::AlignmentFlag a)
52  : m_element(elem)
53  , m_type(Block)
54  , m_align(a)
55  {
56  }
57  // inline variable
59  : m_element(nullptr)
60  , m_type(Variable)
61  , m_variableType(variable)
62  {
63  }
64  // vertical spacing
65  ElementData(Type type, qreal value)
66  : m_element(nullptr)
67  , m_type(type)
68  , m_value(value)
69  {
70  }
71 
72  // copy ctor
73  ElementData(const ElementData &other)
74  {
75  operator=(other);
76  }
78  {
79  m_element = other.m_element ? other.m_element->clone() : nullptr;
80  m_type = other.m_type;
81  switch (m_type) {
82  case Block:
83  m_align = other.m_align;
84  break;
85  case Inline:
86  break;
87  case Variable:
89  break;
90  case VerticalSpacing:
91  m_value = other.m_value;
92  break;
93  }
94  return *this;
95  }
97  {
98  delete m_element;
99  }
100 
103  union {
105  Qt::AlignmentFlag m_align;
106  qreal m_value;
107  };
108 };
109 }
110 
111 #endif
virtual Element * clone() const =0
ElementData(KDReports::VariableType variable)
ElementData(const ElementData &other)
ElementData & operator=(const ElementData &other)
ElementData(Element *elem, Qt::AlignmentFlag a)
KDReports::VariableType m_variableType
ElementData(Type type, qreal value)

© Klarälvdalens Datakonsult AB (KDAB)
"The Qt, C++ and OpenGL Experts"
https://www.kdab.com/
https://www.kdab.com/development-resources/qt-tools/kd-reports/
Generated by doxygen 1.9.1