• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

MerginMaps / input / 6690232974

30 Oct 2023 08:34AM UTC coverage: 62.205% (-0.04%) from 62.243%
6690232974

Pull #2882

github

wonder-sk
code style
Pull Request #2882: Download data in parallel during sync

7686 of 12356 relevant lines covered (62.2%)

105.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

95.79
/app/attributes/attributedata.cpp
1
/***************************************************************************
2
 attributedata.cpp
3
  --------------------------------------
4
  Date                 : 22.4.2021
5
  Copyright            : (C) 2021 by Peter Petrik
6
  Email                : zilolv@gmail.com
7
 ***************************************************************************
8
 *                                                                         *
9
 *   This program is free software; you can redistribute it and/or modify  *
10
 *   it under the terms of the GNU General Public License as published by  *
11
 *   the Free Software Foundation; either version 2 of the License, or     *
12
 *   (at your option) any later version.                                   *
13
 *                                                                         *
14
 ***************************************************************************/
15

16

17
#include "attributedata.h"
18

19
FormItem::FormItem(
89✔
20
  const QUuid &id,
21
  const QgsField &field,
22
  const QString &groupName,
23
  const int parentTabId,
24
  FormItem::FormItemType type,
25
  const QString &name,
26
  bool isEditable,
27
  const QgsEditorWidgetSetup &editorWidgetSetup,
28
  int fieldIndex,
29
  const QgsExpression &visibilityExpression,
30
  const QgsRelation &relation
31
)
89✔
32
  : mId( id )
89✔
33
  , mField( field )
89✔
34
  , mGroupName( groupName )
89✔
35
  , mParentTabId( parentTabId )
89✔
36
  , mType( type )
89✔
37
  , mName( name )
89✔
38
  , mIsEditable( isEditable )
89✔
39
  , mEditorWidgetSetup( editorWidgetSetup )
89✔
40
  , mFieldIndex( fieldIndex )
89✔
41
  , mVisibilityExpression( visibilityExpression )
89✔
42
  , mRelation( relation ) // no relation for type field
89✔
43
{
44
}
89✔
45

46
FormItem *FormItem::createFieldItem(
85✔
47
  const QUuid &id,
48
  const QgsField &field,
49
  const QString &groupName,
50
  int parentTabId,
51
  FormItemType type,
52
  const QString &name,
53
  bool isEditable,
54
  const QgsEditorWidgetSetup
55
  &editorWidgetSetup,
56
  int fieldIndex,
57
  const QgsExpression &visibilityExpression
58
)
59
{
60
  return new FormItem(
61
           id,
62
           field,
63
           groupName,
64
           parentTabId,
65
           type,
66
           name,
67
           isEditable,
68
           editorWidgetSetup,
69
           fieldIndex,
70
           visibilityExpression
71
         );
85✔
72
}
73

74
FormItem *FormItem::createRelationItem(
4✔
75
  const QUuid &id,
76
  const QString &groupName,
77
  int parentTabId,
78
  FormItemType type,
79
  const QString &name,
80
  const QgsRelation &relation
81
)
82
{
83
  FormItem *item = new FormItem(
84
    id,
85
    QgsField(),
8✔
86
    groupName,
87
    parentTabId,
88
    type,
89
    name,
90
    true,
91
    QgsEditorWidgetSetup(),
8✔
92
    -1,
93
    QgsExpression(),
8✔
94
    relation
95
  );
4✔
96
  return item;
4✔
97
}
98

99
FormItem::FormItemType FormItem::type() const
1,895✔
100
{
101
  return mType;
1,895✔
102
}
103

104
QString FormItem::name() const
836✔
105
{
106
  return mName;
836✔
107
}
108

109
bool FormItem::isEditable() const
×
110
{
111
  return mIsEditable;
×
112
}
113

114
QString FormItem::editorWidgetType() const
2,227✔
115
{
116
  if ( mType == FormItem::Relation )
2,227✔
117
    return QStringLiteral( "relation" );
4✔
118

119
  return mEditorWidgetSetup.type();
2,223✔
120
}
121

122
QVariantMap FormItem::editorWidgetConfig() const
494✔
123
{
124
  return mEditorWidgetSetup.config();
494✔
125
}
126

127
int FormItem::fieldIndex() const
1,791✔
128
{
129
  return mFieldIndex;
1,791✔
130
}
131

132
QString FormItem::validationMessage() const
883✔
133
{
134
  return mValidationMessage;
883✔
135
}
136

137
void FormItem::setValidationMessage( QString message )
50✔
138
{
139
  mValidationMessage = message;
50✔
140
}
50✔
141

142
FieldValidator::ValidationStatus FormItem::validationStatus() const
80✔
143
{
144
  return mValidationStatus;
80✔
145
}
146

147
void FormItem::setValidationStatus( FieldValidator::ValidationStatus status )
50✔
148
{
149
  mValidationStatus = status;
50✔
150
}
50✔
151

152
bool FormItem::isVisible() const
365✔
153
{
154
  return mVisible;
365✔
155
}
156

157
void FormItem::setVisible( bool visible )
79✔
158
{
159
  mVisible = visible;
79✔
160
}
79✔
161

162
QUuid FormItem::id() const
678✔
163
{
164
  return mId;
678✔
165
}
166

167
int FormItem::parentTabId() const
×
168
{
169
  return mParentTabId;
×
170
}
171

172
QgsExpression FormItem::visibilityExpression() const
798✔
173
{
174
  return mVisibilityExpression;
798✔
175
}
176

177
bool FormItem::visible() const
806✔
178
{
179
  return mVisible;
806✔
180
}
181

182
QgsField FormItem::field() const
2,526✔
183
{
184
  return mField;
2,526✔
185
}
186

187
QString FormItem::groupName() const
6✔
188
{
189
  return mGroupName;
6✔
190
}
191

192
QVariant FormItem::originalValue() const
61✔
193
{
194
  return mOriginalValue;
61✔
195
}
196

197
void FormItem::setOriginalValue( const QVariant &originalValue )
126✔
198
{
199
  mOriginalValue = originalValue;
126✔
200
}
126✔
201

202
QgsRelation FormItem::relation() const
5✔
203
{
204
  return mRelation;
5✔
205
}
206

207
QVariant FormItem::rawValue() const
745✔
208
{
209
  return mRawValue;
745✔
210
}
211

212
void FormItem::setRawValue( const QVariant &rawValue )
235✔
213
{
214
  mRawValue = rawValue;
235✔
215
}
235✔
216

217

218
TabItem::TabItem( const int &id,
19✔
219
                  const QString &name,
220
                  const QVector<QUuid> &formItems,
221
                  const QgsExpression &visibilityExpression )
19✔
222
  : mTabIndex( id )
19✔
223
  , mName( name )
19✔
224
  , mFormItems( formItems )
19✔
225
  , mVisibilityExpression( visibilityExpression )
19✔
226
{
227
}
19✔
228

229
QString TabItem::name() const
7✔
230
{
231
  return mName;
7✔
232
}
233

234
bool TabItem::isVisible() const
149✔
235
{
236
  return mVisible;
149✔
237
}
238

239
void TabItem::setVisible( bool visible )
17✔
240
{
241
  mVisible = visible;
17✔
242
}
17✔
243

244
int TabItem::tabIndex() const
42✔
245
{
246
  return mTabIndex;
42✔
247
}
248

249
QgsExpression TabItem::visibilityExpression() const
116✔
250
{
251
  return mVisibilityExpression;
116✔
252
}
253

254
const QVector<QUuid> TabItem::formItems() const
39✔
255
{
256
  return mFormItems;
39✔
257
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc