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

mcallegari / qlcplus / 27868188413

20 Jun 2026 10:19AM UTC coverage: 35.301% (+0.03%) from 35.268%
27868188413

push

github

mcallegari
qmlui: major update to palettes

- introduced 3D position palette
- added support for shutter palettes
- fix palette manager filters
- do not show fanning when editing a palette

58 of 233 new or added lines in 3 files covered. (24.89%)

6 existing lines in 2 files now uncovered.

18530 of 52491 relevant lines covered (35.3%)

41072.9 hits per line

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

40.44
/engine/src/monitorproperties.cpp
1
/*
2
  Q Light Controller Plus
3
  monitorproperties.cpp
4

5
  Copyright (c) Massimo Callegari
6

7
  Licensed under the Apache License, Version 2.0 (the "License");
8
  you may not use this file except in compliance with the License.
9
  You may obtain a copy of the License at
10

11
      http://www.apache.org/licenses/LICENSE-2.0.txt
12

13
  Unless required by applicable law or agreed to in writing, software
14
  distributed under the License is distributed on an "AS IS" BASIS,
15
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
  See the License for the specific language governing permissions and
17
  limitations under the License.
18
*/
19

20
#include <QXmlStreamReader>
21
#include <QXmlStreamWriter>
22
#include <QQuaternion>
23
#include <QDebug>
24
#include <QFont>
25

26
#include "monitorproperties.h"
27
#include "qlcfixturedef.h"
28
#include "qlcconfig.h"
29
#include "qlcfile.h"
30
#include "fixture.h"
31
#include "doc.h"
32

33
#define KXMLQLCMonitorDisplay       QStringLiteral("DisplayMode")
34
#define KXMLQLCMonitorChannels      QStringLiteral("ChannelStyle")
35
#define KXMLQLCMonitorValues        QStringLiteral("ValueStyle")
36
#define KXMLQLCMonitorFont          QStringLiteral("Font")
37
#define KXMLQLCMonitorGrid          QStringLiteral("Grid")
38
#define KXMLQLCMonitorGridWidth     QStringLiteral("Width")
39
#define KXMLQLCMonitorGridHeight    QStringLiteral("Height")
40
#define KXMLQLCMonitorGridDepth     QStringLiteral("Depth")
41
#define KXMLQLCMonitorGridUnits     QStringLiteral("Units")
42
#define KXMLQLCMonitorPointOfView   QStringLiteral("POV")
43
#define KXMLQLCMonitorItemID        QStringLiteral("ID")
44
#define KXMLQLCMonitorShowLabels    QStringLiteral("ShowLabels")
45

46
#define KXMLQLCMonitorCommonBackground  QStringLiteral("Background")
47
#define KXMLQLCMonitorCustomBgItem      QStringLiteral("BackgroundItem")
48

49
#define KXMLQLCMonitorFixtureItem   QStringLiteral("FxItem")
50
#define KXMLQLCMonitorLightItem     QStringLiteral("LightItem")
51
#define KXMLQLCMonitorStageItem     QStringLiteral("StageItem")
52
#define KXMLQLCMonitorMeshItem      QStringLiteral("MeshItem")
53
#define KXMLQLCMonitorItemName      QStringLiteral("Name")
54
#define KXMLQLCMonitorItemRes       QStringLiteral("Res")
55

56
#define KXMLQLCMonitorItemXPosition     QStringLiteral("XPos")
57
#define KXMLQLCMonitorItemYPosition     QStringLiteral("YPos")
58
#define KXMLQLCMonitorItemZPosition     QStringLiteral("ZPos")
59
#define KXMLQLCMonitorItemXRotation     QStringLiteral("XRot")
60
#define KXMLQLCMonitorItemYRotation     QStringLiteral("YRot")
61
#define KXMLQLCMonitorItemZRotation     QStringLiteral("ZRot")
62
#define KXMLQLCMonitorFixtureRotation   QStringLiteral("Rotation") // LEGACY
63
#define KXMLQLCMonitorItemXScale        QStringLiteral("XScale")
64
#define KXMLQLCMonitorItemYScale        QStringLiteral("YScale")
65
#define KXMLQLCMonitorItemZScale        QStringLiteral("ZScale")
66

67
#define KXMLQLCMonitorFixtureHeadIndex      QStringLiteral("Head")
68
#define KXMLQLCMonitorFixtureLinkedIndex    QStringLiteral("Linked")
69

70
#define KXMLQLCMonitorFixtureGelColor   QStringLiteral("GelColor")
71
#define KXMLQLCMonitorFixtureFixedZoom  QStringLiteral("FixedZoom")
72

73
#define KXMLQLCMonitorFixtureHiddenFlag     QStringLiteral("Hidden")
74
#define KXMLQLCMonitorFixtureInvPanFlag     QStringLiteral("InvertedPan")
75
#define KXMLQLCMonitorFixtureInvTiltFlag    QStringLiteral("InvertedTilt")
76

77
#define GRID_DEFAULT_WIDTH  5
78
#define GRID_DEFAULT_HEIGHT 3
79
#define GRID_DEFAULT_DEPTH  5
80

81
MonitorProperties::MonitorProperties()
9✔
82
    : m_font(QFont("Arial", 12))
9✔
83
    , m_displayMode(DMX)
9✔
84
    , m_channelStyle(DMXChannels)
9✔
85
    , m_valueStyle(DMXValues)
9✔
86
    , m_gridSize(QVector3D(GRID_DEFAULT_WIDTH, GRID_DEFAULT_HEIGHT, GRID_DEFAULT_DEPTH))
9✔
87
    , m_gridUnits(Meters)
9✔
88
    , m_pointOfView(Undefined)
9✔
89
    , m_stageType(StageSimple)
9✔
90
    , m_showLabels(false)
18✔
91
{
92
}
9✔
93

94
void MonitorProperties::reset()
16✔
95
{
96
    m_gridSize = QVector3D(GRID_DEFAULT_WIDTH, GRID_DEFAULT_HEIGHT, GRID_DEFAULT_DEPTH);
16✔
97
    m_gridUnits = Meters;
16✔
98
    m_pointOfView = Undefined;
16✔
99
    m_stageType = StageSimple;
16✔
100
    m_showLabels = false;
16✔
101
    m_fixtureItems.clear();
16✔
102
    m_lightItems.clear();
16✔
103
    m_genericItems.clear();
16✔
104
    m_commonBackgroundImage = QString();
16✔
105
}
16✔
106

107
/********************************************************************
108
 * Environment
109
 ********************************************************************/
110

111
void MonitorProperties::setPointOfView(MonitorProperties::PointOfView pov)
2✔
112
{
113
    if (pov == m_pointOfView)
2✔
114
        return;
1✔
115

116
    if (m_pointOfView == Undefined)
1✔
117
    {
118
        QVector3D gSize = gridSize();
1✔
119
        float units = gridUnits() == MonitorProperties::Meters ? 1000.0 : 304.8;
1✔
120

121
        if (gSize.z() == 0)
1✔
122
        {
123
            // convert the grid size first
124
            switch (pov)
×
125
            {
126
                case TopView:
×
127
                    setGridSize(QVector3D(gSize.x(), GRID_DEFAULT_HEIGHT, gSize.y()));
×
128
                break;
×
129
                case RightSideView:
×
130
                case LeftSideView:
131
                    setGridSize(QVector3D(GRID_DEFAULT_WIDTH, gSize.x(), gSize.x()));
×
132
                break;
×
133
                default:
×
134
                break;
×
135
            }
136
        }
137

138
        foreach (quint32 fid, fixtureItemsID())
2✔
139
        {
140
            foreach (quint32 subID, fixtureIDList(fid))
×
141
            {
142
                QVector3D pos = fixturePosition(fid, fixtureHeadIndex(subID), fixtureLinkedIndex(subID));
×
143
                QVector3D newPos;
×
144

145
                switch (pov)
×
146
                {
147
                    case TopView:
×
148
                    {
149
                        newPos = QVector3D(pos.x(), 1000, pos.y());
×
150
                    }
151
                    break;
×
152
                    case RightSideView:
×
153
                    {
154
                        newPos = QVector3D(0, pos.y(), (gridSize().z() * units) - pos.x());
×
155
                    }
156
                    break;
×
157
                    case LeftSideView:
×
158
                    {
159
                        newPos = QVector3D(0, pos.y(), pos.x());
×
160
                    }
161
                    break;
×
162
                    default:
×
163
                        newPos = QVector3D(pos.x(), (gridSize().y() * units) - pos.y(), 1000);
×
164
                    break;
×
165
                }
166
                setFixturePosition(fid, fixtureHeadIndex(subID), fixtureLinkedIndex(subID), newPos);
×
167
            }
×
168
        }
1✔
169
    }
170
    m_pointOfView = pov;
1✔
171
}
172

173
/********************************************************************
174
 * Fixture items
175
 ********************************************************************/
176

177
void MonitorProperties::removeFixture(quint32 fid)
2✔
178
{
179
    if (m_fixtureItems.contains(fid))
2✔
180
        m_fixtureItems.take(fid);
2✔
181
}
2✔
182

183
void MonitorProperties::removeFixture(quint32 fid, quint16 head, quint16 linked)
×
184
{
185
    if (m_fixtureItems.contains(fid) == false)
×
186
        return;
×
187

188
    // if no sub items are present,
189
    // the fixture can be removed completely
190
    if (m_fixtureItems[fid].m_subItems.count() == 0)
×
191
    {
192
        m_fixtureItems.take(fid);
×
193
        return;
×
194
    }
195

196
    quint32 subID = fixtureSubID(head, linked);
×
197
    m_fixtureItems[fid].m_subItems.remove(subID);
×
198
}
199

200
quint32 MonitorProperties::fixtureSubID(quint32 headIndex, quint32 linkedIndex) const
×
201
{
202
    return ((headIndex << 16) | linkedIndex);
×
203
}
204

205
quint16 MonitorProperties::fixtureHeadIndex(quint32 mapID) const
×
206
{
207
    return (quint16)(mapID >> 16);
×
208
}
209

210
quint16 MonitorProperties::fixtureLinkedIndex(quint32 mapID) const
×
211
{
212
    return (quint16)(mapID & 0x0000FFFF);
×
213
}
214

215
bool MonitorProperties::containsItem(quint32 fid, quint16 head, quint16 linked)
×
216
{
217
    if (m_fixtureItems.contains(fid) == false)
×
218
        return false;
×
219

220
    if (head == 0 && linked == 0)
×
221
        return true;
×
222

223
    quint32 subID = fixtureSubID(head, linked);
×
224
    return m_fixtureItems[fid].m_subItems.contains(subID);
×
225
}
226

227
void MonitorProperties::setFixturePosition(quint32 fid, quint16 head, quint16 linked, QVector3D pos)
5✔
228
{
229
    //qDebug() << Q_FUNC_INFO << "X:" << pos.x() << "Y:" << pos.y();
230
    if (head == 0 && linked == 0)
5✔
231
    {
232
        m_fixtureItems[fid].m_baseItem.m_position = pos;
5✔
233
    }
234
    else
235
    {
236
        quint32 subID = fixtureSubID(head, linked);
×
237
        m_fixtureItems[fid].m_subItems[subID].m_position = pos;
×
238
    }
239
}
5✔
240

241
QVector3D MonitorProperties::fixturePosition(quint32 fid, quint16 head, quint16 linked) const
1✔
242
{
243
    if (head == 0 && linked == 0)
1✔
244
    {
245
        return m_fixtureItems[fid].m_baseItem.m_position;
1✔
246
    }
247
    else
248
    {
249
        quint32 subID = fixtureSubID(head, linked);
×
250
        return m_fixtureItems[fid].m_subItems[subID].m_position;
×
251
    }
252
}
253

254
void MonitorProperties::setFixtureRotation(quint32 fid, quint16 head, quint16 linked, QVector3D degrees)
1✔
255
{
256
    if (head == 0 && linked == 0)
1✔
257
    {
258
        m_fixtureItems[fid].m_baseItem.m_rotation = degrees;
1✔
259
    }
260
    else
261
    {
262
        quint32 subID = fixtureSubID(head, linked);
×
263
        m_fixtureItems[fid].m_subItems[subID].m_rotation = degrees;
×
264
    }
265
}
1✔
266

267
QVector3D MonitorProperties::fixtureRotation(quint32 fid, quint16 head, quint16 linked) const
1✔
268
{
269
    if (head == 0 && linked == 0)
1✔
270
    {
271
        return m_fixtureItems[fid].m_baseItem.m_rotation;
1✔
272
    }
273
    else
274
    {
275
        quint32 subID = fixtureSubID(head, linked);
×
276
        return m_fixtureItems[fid].m_subItems[subID].m_rotation;
×
277
    }
278
}
279

280
void MonitorProperties::setFixtureGelColor(quint32 fid, quint16 head, quint16 linked, QColor col)
1✔
281
{
282
    //qDebug() << Q_FUNC_INFO << "Gel color:" << col;
283
    if (head == 0 && linked == 0)
1✔
284
    {
285
        m_fixtureItems[fid].m_baseItem.m_color = col;
1✔
286
    }
287
    else
288
    {
289
        quint32 subID = fixtureSubID(head, linked);
×
290
        m_fixtureItems[fid].m_subItems[subID].m_color = col;
×
291
    }
292
}
1✔
293

294
QColor MonitorProperties::fixtureGelColor(quint32 fid, quint16 head, quint16 linked) const
1✔
295
{
296
    if (head == 0 && linked == 0)
1✔
297
    {
298
        return m_fixtureItems[fid].m_baseItem.m_color;
1✔
299
    }
300
    else
301
    {
302
        quint32 subID = fixtureSubID(head, linked);
×
303
        return m_fixtureItems[fid].m_subItems[subID].m_color;
×
304
    }
305
}
306

307
void MonitorProperties::setFixtureFixedZoom(quint32 fid, quint16 head, quint16 linked, int degrees)
×
308
{
309
    if (head == 0 && linked == 0)
×
310
    {
311
        m_fixtureItems[fid].m_baseItem.m_zoom = degrees;
×
312
    }
313
    else
314
    {
315
        quint32 subID = fixtureSubID(head, linked);
×
316
        m_fixtureItems[fid].m_subItems[subID].m_zoom = degrees;
×
317
    }
318
}
×
319

320
int MonitorProperties::fixtureFixedZoom(quint32 fid, quint16 head, quint16 linked) const
×
321
{
322
    if (head == 0 && linked == 0)
×
323
    {
324
        return m_fixtureItems[fid].m_baseItem.m_zoom;
×
325
    }
326
    else
327
    {
328
        quint32 subID = fixtureSubID(head, linked);
×
329
        return m_fixtureItems[fid].m_subItems[subID].m_zoom;
×
330
    }
331
}
332

333
void MonitorProperties::setFixtureName(quint32 fid, quint16 head, quint16 linked, QString name)
1✔
334
{
335
    if (head == 0 && linked == 0)
1✔
336
    {
337
        m_fixtureItems[fid].m_baseItem.m_name = name;
1✔
338
    }
339
    else
340
    {
341
        quint32 subID = fixtureSubID(head, linked);
×
342
        m_fixtureItems[fid].m_subItems[subID].m_name = name;
×
343
    }
344
}
1✔
345

346
QString MonitorProperties::fixtureName(quint32 fid, quint16 head, quint16 linked) const
1✔
347
{
348
    if (head == 0 && linked == 0)
1✔
349
    {
350
        return m_fixtureItems[fid].m_baseItem.m_name;
1✔
351
    }
352
    else
353
    {
354
        quint32 subID = fixtureSubID(head, linked);
×
355
        return m_fixtureItems[fid].m_subItems[subID].m_name;
×
356
    }
357
}
358

359
void MonitorProperties::setFixtureFlags(quint32 fid, quint16 head, quint16 linked, quint32 flags)
1✔
360
{
361
    if (head == 0 && linked == 0)
1✔
362
    {
363
        m_fixtureItems[fid].m_baseItem.m_flags = flags;
1✔
364
    }
365
    else
366
    {
367
        quint32 subID = fixtureSubID(head, linked);
×
368
        m_fixtureItems[fid].m_subItems[subID].m_flags = flags;
×
369
    }
370
}
1✔
371

372
quint32 MonitorProperties::fixtureFlags(quint32 fid, quint16 head, quint16 linked) const
1✔
373
{
374
    if (head == 0 && linked == 0)
1✔
375
    {
376
        return m_fixtureItems[fid].m_baseItem.m_flags;
1✔
377
    }
378
    else
379
    {
380
        quint32 subID = fixtureSubID(head, linked);
×
381
        return m_fixtureItems[fid].m_subItems[subID].m_flags;
×
382
    }
383
}
384

385
PreviewItem MonitorProperties::fixtureItem(quint32 fid, quint16 head, quint16 linked) const
×
386
{
387
    if (head == 0 && linked == 0)
×
388
    {
389
        return m_fixtureItems[fid].m_baseItem;
×
390
    }
391
    else
392
    {
393
        quint32 subID = fixtureSubID(head, linked);
×
394
        return m_fixtureItems[fid].m_subItems[subID];
×
395
    }
396
}
397

398
void MonitorProperties::setFixtureItem(quint32 fid, quint16 head, quint16 linked, PreviewItem props)
×
399
{
400
    if (head == 0 && linked == 0)
×
401
    {
402
        m_fixtureItems[fid].m_baseItem = props;
×
403
    }
404
    else
405
    {
406
        quint32 subID = fixtureSubID(head, linked);
×
407
        m_fixtureItems[fid].m_subItems[subID] = props;
×
408
    }
409
}
×
410

411
QList<quint32> MonitorProperties::fixtureIDList(quint32 fid) const
×
412
{
413
    QList<quint32> list;
×
414

415
    // always add the basic fixture item ID
416
    list.append(0);
×
417

418
    if (m_fixtureItems.contains(fid) == false)
×
419
        return list;
×
420

421
    FixturePreviewItem fxItem = m_fixtureItems[fid];
×
422
    list.append(fxItem.m_subItems.keys());
×
423

424
    return list;
×
425
}
×
426

427
/********************************************************************
428
 * Fixture lights
429
 ********************************************************************/
430

431
void MonitorProperties::removeLight(QString resource)
1✔
432
{
433
    if (m_lightItems.contains(resource))
1✔
434
        m_lightItems.take(resource);
1✔
435
}
1✔
436

NEW
437
void MonitorProperties::removeLight(QString resource, quint16 head)
×
438
{
NEW
439
    if (m_lightItems.contains(resource) == false)
×
NEW
440
        return;
×
441

NEW
442
    m_lightItems[resource].remove(head);
×
NEW
443
    if (m_lightItems[resource].isEmpty())
×
444
    {
NEW
445
        m_lightItems.take(resource);
×
446
    }
447
}
448

449
bool MonitorProperties::containsLightItem(QString resource, quint16 head) const
3✔
450
{
451
    if (m_lightItems.contains(resource) == false)
3✔
452
        return false;
1✔
453

454
    return m_lightItems[resource].contains(head);
2✔
455
}
456

457
void MonitorProperties::setLightPosition(QString resource, quint16 head, QVector3D position)
2✔
458
{
459
    m_lightItems[resource][head].m_position = position;
2✔
460
}
2✔
461

462
QVector3D MonitorProperties::lightPosition(QString resource, quint16 head) const
2✔
463
{
464
    return m_lightItems[resource][head].m_position;
2✔
465
}
466

467
LightItem MonitorProperties::lightItem(QString resource, quint16 head) const
1✔
468
{
469
    return m_lightItems[resource][head];
1✔
470
}
471

472
void MonitorProperties::setLightItem(QString resource, quint16 head, LightItem props)
1✔
473
{
474
    m_lightItems[resource][head] = props;
1✔
475
}
1✔
476

477
QList<quint32> MonitorProperties::lightHeadList(QString resource) const
1✔
478
{
479
    return m_lightItems.value(resource).keys();
2✔
480
}
481

NEW
482
QMatrix4x4 MonitorProperties::fixtureRotationMatrix(QVector3D rot)
×
483
{
484
    // Matches Qt3DCore::QTransform::fromAxesAndAngles(X,-rx, Y,-ry, Z,-rz):
485
    // individual axis rotations composed as qZ * qY * qX (X applied first)
NEW
486
    QQuaternion qX = QQuaternion::fromAxisAndAngle(QVector3D(1, 0, 0), -rot.x());
×
NEW
487
    QQuaternion qY = QQuaternion::fromAxisAndAngle(QVector3D(0, 1, 0), -rot.y());
×
NEW
488
    QQuaternion qZ = QQuaternion::fromAxisAndAngle(QVector3D(0, 0, 1), -rot.z());
×
NEW
489
    QMatrix4x4 m;
×
NEW
490
    m.rotate(qZ * qY * qX);
×
NEW
491
    return m;
×
492
}
493

NEW
494
bool MonitorProperties::fixtureBeamPosition(const MonitorProperties *monProps,
×
495
                                            const Fixture *fixture, int headIndex,
496
                                            QVector3D &beamPos, QMatrix4x4 &rotMatrix)
497
{
NEW
498
    if (monProps == nullptr || fixture == nullptr)
×
NEW
499
        return false;
×
500

NEW
501
    QString resource;
×
NEW
502
    if (fixture->type() == QLCFixtureDef::MovingHead)
×
NEW
503
        resource = QStringLiteral("moving_head.dae");
×
504

NEW
505
    int lightHead = headIndex;
×
NEW
506
    if (!resource.isEmpty())
×
507
    {
NEW
508
        if (!monProps->containsLightItem(resource, lightHead))
×
509
        {
NEW
510
            if (lightHead != 0 && monProps->containsLightItem(resource, 0))
×
NEW
511
                lightHead = 0;
×
512
            else
NEW
513
                resource.clear();
×
514
        }
515
    }
516

NEW
517
    QVector3D fixturePos = monProps->fixturePosition(fixture->id(), headIndex, 0);
×
NEW
518
    QVector3D fixtureRot = monProps->fixtureRotation(fixture->id(), headIndex, 0);
×
519

NEW
520
    float unitScale = monProps->gridUnits() == MonitorProperties::Meters ? 1.0f : 0.3048f;
×
NEW
521
    QVector3D gridMeters = monProps->gridSize() * unitScale;
×
NEW
522
    QVector3D rootPos((fixturePos.x() / 1000.0f) - (gridMeters.x() / 2.0f),
×
NEW
523
                       fixturePos.y() / 1000.0f,
×
NEW
524
                      (fixturePos.z() / 1000.0f) - (gridMeters.z() / 2.0f));
×
525

NEW
526
    rotMatrix = fixtureRotationMatrix(fixtureRot);
×
527

NEW
528
    if (!resource.isEmpty())
×
529
    {
NEW
530
        QVector3D localOffset = monProps->lightPosition(resource, lightHead);
×
NEW
531
        QVector4D worldOffset = rotMatrix * QVector4D(localOffset, 0.0f);
×
NEW
532
        beamPos = rootPos + QVector3D(worldOffset.x(), worldOffset.y(), worldOffset.z());
×
NEW
533
        return true;
×
534
    }
535

NEW
536
    beamPos = rootPos;
×
NEW
537
    return false;
×
NEW
538
}
×
539

540
/********************************************************************
541
 * Generic items
542
 ********************************************************************/
543

544
QList<quint32> MonitorProperties::genericItemsID() const
2✔
545
{
546
    return m_genericItems.keys();
2✔
547
}
548

549
QString MonitorProperties::itemName(quint32 itemID) const
1✔
550
{
551
    if (m_genericItems[itemID].m_name.isEmpty())
1✔
552
    {
553
        QFileInfo rName(m_genericItems[itemID].m_resource);
×
554
        return rName.baseName();
×
555
    }
×
556

557
    return m_genericItems[itemID].m_name;
1✔
558
}
559

560
void MonitorProperties::setItemName(quint32 itemID, QString name)
2✔
561
{
562
    m_genericItems[itemID].m_name = name;
2✔
563
}
2✔
564

565
QString MonitorProperties::itemResource(quint32 itemID) const
1✔
566
{
567
    return m_genericItems[itemID].m_resource;
1✔
568
}
569

570
void MonitorProperties::setItemResource(quint32 itemID, QString resource)
1✔
571
{
572
    m_genericItems[itemID].m_resource = resource;
1✔
573
}
1✔
574

575
QVector3D MonitorProperties::itemPosition(quint32 itemID) const
1✔
576
{
577
    return m_genericItems[itemID].m_position;
1✔
578
}
579

580
void MonitorProperties::setItemPosition(quint32 itemID, QVector3D pos)
1✔
581
{
582
    m_genericItems[itemID].m_position = pos;
1✔
583
}
1✔
584

585
QVector3D MonitorProperties::itemRotation(quint32 itemID) const
1✔
586
{
587
    return m_genericItems[itemID].m_rotation;
1✔
588
}
589

590
void MonitorProperties::setItemRotation(quint32 itemID, QVector3D rot)
1✔
591
{
592
    m_genericItems[itemID].m_rotation = rot;
1✔
593
}
1✔
594

595
QVector3D MonitorProperties::itemScale(quint32 itemID) const
1✔
596
{
597
    if (m_genericItems[itemID].m_scale.isNull())
1✔
598
        return QVector3D(1.0, 1.0, 1.0);
×
599

600
    return m_genericItems[itemID].m_scale;
1✔
601
}
602

603
void MonitorProperties::setItemScale(quint32 itemID, QVector3D scale)
1✔
604
{
605
    m_genericItems[itemID].m_scale = scale;
1✔
606
}
1✔
607

608
quint32 MonitorProperties::itemFlags(quint32 itemID) const
1✔
609
{
610
    return m_genericItems[itemID].m_flags;
1✔
611
}
612

613
void MonitorProperties::setItemFlags(quint32 itemID, quint32 flags)
1✔
614
{
615
    m_genericItems[itemID].m_flags = flags;
1✔
616
}
1✔
617

618
/********************************************************************
619
 * 2D view background
620
 ********************************************************************/
621

622
QString MonitorProperties::customBackground(quint32 fid) const
×
623
{
624
    return m_customBackgroundImages.value(fid, QString());
×
625
}
626

627
/*********************************************************************
628
 * Load & Save
629
 *********************************************************************/
630

631
bool MonitorProperties::loadXML(QXmlStreamReader &root, const Doc *mainDocument)
1✔
632
{
633
    if (root.name() != KXMLQLCMonitorProperties)
1✔
634
    {
635
        qWarning() << Q_FUNC_INFO << "Monitor node not found";
×
636
        return false;
×
637
    }
638

639
    QXmlStreamAttributes attrs = root.attributes();
1✔
640

641
    if (attrs.hasAttribute(KXMLQLCMonitorDisplay) == false)
1✔
642
    {
643
        qWarning() << Q_FUNC_INFO << "Cannot determine Monitor display mode !";
×
644
        return false;
×
645
    }
646

647
    setDisplayMode(DisplayMode(attrs.value(KXMLQLCMonitorDisplay).toString().toInt()));
1✔
648
    if (attrs.hasAttribute(KXMLQLCMonitorShowLabels))
1✔
649
    {
650
        if (attrs.value(KXMLQLCMonitorShowLabels).toString() == "1")
2✔
651
            setLabelsVisible(true);
×
652
        else
653
            setLabelsVisible(false);
1✔
654
    }
655

656
    while (root.readNextStartElement())
6✔
657
    {
658
        QXmlStreamAttributes tAttrs = root.attributes();
5✔
659
        if (root.name() == KXMLQLCMonitorFont)
5✔
660
        {
661
            QFont fn;
1✔
662
            fn.fromString(root.readElementText());
1✔
663
            setFont(fn);
1✔
664
        }
1✔
665
        else if (root.name() == KXMLQLCMonitorChannels)
4✔
666
            setChannelStyle(ChannelStyle(root.readElementText().toInt()));
1✔
667
        else if (root.name() == KXMLQLCMonitorValues)
3✔
668
            setValueStyle(ValueStyle(root.readElementText().toInt()));
1✔
669
        else if (root.name() == KXMLQLCMonitorCommonBackground)
2✔
670
            setCommonBackgroundImage(mainDocument->denormalizeComponentPath(root.readElementText()));
×
671
        else if (root.name() == KXMLQLCMonitorCustomBgItem)
2✔
672
        {
673
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemID))
×
674
            {
675
                quint32 fid = tAttrs.value(KXMLQLCMonitorItemID).toString().toUInt();
×
676
                setCustomBackgroundItem(fid, mainDocument->denormalizeComponentPath(root.readElementText()));
×
677
            }
678
        }
679
        else if (root.name() == KXMLQLCMonitorGrid)
2✔
680
        {
681
            int w = 5, h = 3, d = 5;
1✔
682
            if (tAttrs.hasAttribute(KXMLQLCMonitorGridWidth))
1✔
683
                w = tAttrs.value(KXMLQLCMonitorGridWidth).toString().toInt();
1✔
684
            if (tAttrs.hasAttribute(KXMLQLCMonitorGridHeight))
1✔
685
                h = tAttrs.value(KXMLQLCMonitorGridHeight).toString().toInt();
1✔
686
            if (tAttrs.hasAttribute(KXMLQLCMonitorGridDepth))
1✔
687
                d = tAttrs.value(KXMLQLCMonitorGridDepth).toString().toInt();
1✔
688
            else
689
                d = h; // backward compatibility
×
690

691
            if (tAttrs.hasAttribute(KXMLQLCMonitorGridUnits))
1✔
692
                setGridUnits(GridUnits(tAttrs.value(KXMLQLCMonitorGridUnits).toString().toInt()));
1✔
693

694
            if (tAttrs.hasAttribute(KXMLQLCMonitorPointOfView))
1✔
695
                setPointOfView(PointOfView(tAttrs.value(KXMLQLCMonitorPointOfView).toString().toInt()));
×
696
            else
697
                setPointOfView(Undefined);
1✔
698

699
            setGridSize(QVector3D(w, h, d));
1✔
700
            root.skipCurrentElement();
1✔
701
        }
702
        else if (root.name() == KXMLQLCMonitorStageItem)
1✔
703
        {
704
            setStageType(StageType(root.readElementText().toInt()));
×
705
        }
706
        else if (root.name() == KXMLQLCMonitorFixtureItem)
1✔
707
        {
708
            // Fixture ID is mandatory. Skip the whole entry if not found.
709
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemID) == false)
×
710
            {
711
                root.skipCurrentElement();
×
712
                continue;
×
713
            }
714

715
            PreviewItem item;
×
716
            quint32 fid = tAttrs.value(KXMLQLCMonitorItemID).toString().toUInt();
×
717
            quint16 headIndex = 0;
×
718
            quint16 linkedIndex = 0;
×
719
            QVector3D pos(0, 0, 0);
×
720
            QVector3D rot(0, 0, 0);
×
721

722
            item.m_flags = 0;
×
723
            item.m_zoom = 0;
×
724

725
            if (tAttrs.hasAttribute(KXMLQLCMonitorFixtureHeadIndex))
×
726
                headIndex = tAttrs.value(KXMLQLCMonitorFixtureHeadIndex).toString().toUInt();
×
727

728
            if (tAttrs.hasAttribute(KXMLQLCMonitorFixtureLinkedIndex))
×
729
            {
730
                linkedIndex = tAttrs.value(KXMLQLCMonitorFixtureLinkedIndex).toString().toUInt();
×
731

732
                if (tAttrs.hasAttribute(KXMLQLCMonitorItemName))
×
733
                    item.m_name = tAttrs.value(KXMLQLCMonitorItemName).toString();
×
734
            }
735

736
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemXPosition))
×
737
                pos.setX(tAttrs.value(KXMLQLCMonitorItemXPosition).toString().toDouble());
×
738
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemYPosition))
×
739
                pos.setY(tAttrs.value(KXMLQLCMonitorItemYPosition).toString().toDouble());
×
740
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemZPosition))
×
741
                pos.setZ(tAttrs.value(KXMLQLCMonitorItemZPosition).toString().toDouble());
×
742
            item.m_position = pos;
×
743

744
            if (tAttrs.hasAttribute(KXMLQLCMonitorFixtureRotation)) // check legacy first
×
745
            {
746
                rot.setY(tAttrs.value(KXMLQLCMonitorFixtureRotation).toString().toDouble());
×
747
            }
748
            else
749
            {
750
                if (tAttrs.hasAttribute(KXMLQLCMonitorItemXRotation))
×
751
                    rot.setX(tAttrs.value(KXMLQLCMonitorItemXRotation).toString().toDouble());
×
752
                if (tAttrs.hasAttribute(KXMLQLCMonitorItemYRotation))
×
753
                    rot.setY(tAttrs.value(KXMLQLCMonitorItemYRotation).toString().toDouble());
×
754
                if (tAttrs.hasAttribute(KXMLQLCMonitorItemZRotation))
×
755
                    rot.setZ(tAttrs.value(KXMLQLCMonitorItemZRotation).toString().toDouble());
×
756
            }
757
            item.m_rotation = rot;
×
758

759
            if (tAttrs.hasAttribute(KXMLQLCMonitorFixtureGelColor))
×
760
                item.m_color = QColor(tAttrs.value(KXMLQLCMonitorFixtureGelColor).toString());
×
761

762
            if (tAttrs.hasAttribute(KXMLQLCMonitorFixtureFixedZoom))
×
763
                item.m_zoom = tAttrs.value(KXMLQLCMonitorFixtureFixedZoom).toString().toInt();
×
764

765
            if (tAttrs.hasAttribute(KXMLQLCMonitorFixtureHiddenFlag))
×
766
                item.m_flags |= HiddenFlag;
×
767
            if (tAttrs.hasAttribute(KXMLQLCMonitorFixtureInvPanFlag))
×
768
                item.m_flags |= InvertedPanFlag;
×
769
            if (tAttrs.hasAttribute(KXMLQLCMonitorFixtureInvTiltFlag))
×
770
                item.m_flags |= InvertedTiltFlag;
×
771

772
            setFixtureItem(fid, headIndex, linkedIndex, item);
×
773
            root.skipCurrentElement();
×
774

775
        }
×
776
        else if (root.name() == KXMLQLCMonitorLightItem)
1✔
777
        {
778
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemRes) == false)
1✔
779
            {
NEW
780
                root.skipCurrentElement();
×
NEW
781
                continue;
×
782
            }
783

784
            LightItem item;
1✔
785
            QString resource = tAttrs.value(KXMLQLCMonitorItemRes).toString();
1✔
786
            quint16 headIndex = 0;
1✔
787
            QVector3D position(0, 0, 0);
1✔
788

789
            if (tAttrs.hasAttribute(KXMLQLCMonitorFixtureHeadIndex))
1✔
NEW
790
                headIndex = tAttrs.value(KXMLQLCMonitorFixtureHeadIndex).toString().toUInt();
×
791

792
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemXPosition))
1✔
793
                position.setX(tAttrs.value(KXMLQLCMonitorItemXPosition).toString().toDouble());
1✔
794
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemYPosition))
1✔
795
                position.setY(tAttrs.value(KXMLQLCMonitorItemYPosition).toString().toDouble());
1✔
796
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemZPosition))
1✔
797
                position.setZ(tAttrs.value(KXMLQLCMonitorItemZPosition).toString().toDouble());
1✔
798

799
            item.m_position = position;
1✔
800
            setLightItem(resource, headIndex, item);
1✔
801
            root.skipCurrentElement();
1✔
802
        }
1✔
UNCOV
803
        else if (root.name() == KXMLQLCMonitorMeshItem)
×
804
        {
805
            // Item ID is mandatory. Skip the whole entry if not found.
806
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemID) == false)
×
807
            {
808
                root.skipCurrentElement();
×
809
                continue;
×
810
            }
811

812
            PreviewItem item;
×
813
            quint32 itemID = tAttrs.value(KXMLQLCMonitorItemID).toString().toUInt();
×
814
            QVector3D pos(0, 0, 0);
×
815
            QVector3D rot(0, 0, 0);
×
816
            QVector3D scale(1.0, 1.0, 1.0);
×
817

818
            item.m_flags = 0;
×
819

820
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemXPosition))
×
821
                pos.setX(tAttrs.value(KXMLQLCMonitorItemXPosition).toString().toDouble());
×
822
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemYPosition))
×
823
                pos.setY(tAttrs.value(KXMLQLCMonitorItemYPosition).toString().toDouble());
×
824
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemZPosition))
×
825
                pos.setZ(tAttrs.value(KXMLQLCMonitorItemZPosition).toString().toDouble());
×
826
            item.m_position = pos;
×
827

828
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemXRotation))
×
829
                rot.setX(tAttrs.value(KXMLQLCMonitorItemXRotation).toString().toDouble());
×
830
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemYRotation))
×
831
                rot.setY(tAttrs.value(KXMLQLCMonitorItemYRotation).toString().toDouble());
×
832
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemZRotation))
×
833
                rot.setZ(tAttrs.value(KXMLQLCMonitorItemZRotation).toString().toDouble());
×
834
            item.m_rotation = rot;
×
835

836
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemXScale))
×
837
                scale.setX(tAttrs.value(KXMLQLCMonitorItemXScale).toString().toDouble());
×
838
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemYScale))
×
839
                scale.setY(tAttrs.value(KXMLQLCMonitorItemYScale).toString().toDouble());
×
840
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemZScale))
×
841
                scale.setZ(tAttrs.value(KXMLQLCMonitorItemZScale).toString().toDouble());
×
842
            item.m_scale = scale;
×
843

844
            if (tAttrs.hasAttribute(KXMLQLCMonitorFixtureHiddenFlag))
×
845
                item.m_flags |= HiddenFlag;
×
846

847
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemRes))
×
848
                item.m_resource = tAttrs.value(KXMLQLCMonitorItemRes).toString();
×
849

850
            if (tAttrs.hasAttribute(KXMLQLCMonitorItemName))
×
851
                item.m_name = tAttrs.value(KXMLQLCMonitorItemName).toString();
×
852

853
            m_genericItems[itemID] = item;
×
854
            root.skipCurrentElement();
×
855
        }
×
856
        else
857
        {
858
            qWarning() << Q_FUNC_INFO << "Unknown MonitorProperties tag:" << root.name();
×
859
            root.skipCurrentElement();
×
860
        }
861
    }
5✔
862
    return true;
1✔
863
}
1✔
864

865
bool MonitorProperties::saveXML(QXmlStreamWriter *doc, const Doc *mainDocument) const
2✔
866
{
867
    Q_ASSERT(doc != NULL);
2✔
868

869
    /* Create the master Monitor node */
870
    doc->writeStartElement(KXMLQLCMonitorProperties);
4✔
871
    doc->writeAttribute(KXMLQLCMonitorDisplay, QString::number(displayMode()));
4✔
872
    doc->writeAttribute(KXMLQLCMonitorShowLabels, QString::number(labelsVisible()));
4✔
873

874
    /* Font */
875
    doc->writeTextElement(KXMLQLCMonitorFont, font().toString());
4✔
876
    /* Channels style */
877
    doc->writeTextElement(KXMLQLCMonitorChannels, QString::number(channelStyle()));
4✔
878
    /* Values style */
879
    doc->writeTextElement(KXMLQLCMonitorValues, QString::number(valueStyle()));
4✔
880

881
    /* Background */
882
    if (commonBackgroundImage().isEmpty() == false)
2✔
883
    {
884
        doc->writeTextElement(KXMLQLCMonitorCommonBackground,
×
885
                              mainDocument->normalizeComponentPath(commonBackgroundImage()));
×
886
    }
887
    else if (customBackgroundList().isEmpty() == false)
2✔
888
    {
889
        QMapIterator <quint32, QString> it(customBackgroundList());
×
890
        while (it.hasNext() == true)
×
891
        {
892
            it.next();
×
893
            doc->writeStartElement(KXMLQLCMonitorCustomBgItem);
×
894
            quint32 fid = it.key();
×
895
            doc->writeAttribute(KXMLQLCMonitorItemID, QString::number(fid));
×
896
            doc->writeCharacters(mainDocument->normalizeComponentPath(it.value()));
×
897
            doc->writeEndElement();
×
898
        }
899
    }
×
900

901
    doc->writeStartElement(KXMLQLCMonitorGrid);
4✔
902
    doc->writeAttribute(KXMLQLCMonitorGridWidth, QString::number(gridSize().x()));
4✔
903
    doc->writeAttribute(KXMLQLCMonitorGridHeight, QString::number(gridSize().y()));
4✔
904
    doc->writeAttribute(KXMLQLCMonitorGridDepth, QString::number(gridSize().z()));
4✔
905
    doc->writeAttribute(KXMLQLCMonitorGridUnits, QString::number(gridUnits()));
4✔
906
    if (m_pointOfView != Undefined)
2✔
907
        doc->writeAttribute(KXMLQLCMonitorPointOfView, QString::number(pointOfView()));
×
908

909
    doc->writeEndElement();
2✔
910

911
#ifdef QMLUI
912
    doc->writeTextElement(KXMLQLCMonitorStageItem, QString::number(stageType()));
913
#endif
914

915
    // ***********************************************************
916
    // *                write fixtures information               *
917
    // ***********************************************************
918

919
    foreach (quint32 fid, fixtureItemsID())
4✔
920
    {
921
        foreach (quint32 subID, fixtureIDList(fid))
×
922
        {
923
            quint16 headIndex = fixtureHeadIndex(subID);
×
924
            quint16 linkedIndex = fixtureLinkedIndex(subID);
×
925
            PreviewItem item = fixtureItem(fid, headIndex, linkedIndex);
×
926

927
            doc->writeStartElement(KXMLQLCMonitorFixtureItem);
×
928
            doc->writeAttribute(KXMLQLCMonitorItemID, QString::number(fid));
×
929

930
            if (headIndex)
×
931
                doc->writeAttribute(KXMLQLCMonitorFixtureHeadIndex, QString::number(headIndex));
×
932

933
            if (linkedIndex)
×
934
            {
935
                doc->writeAttribute(KXMLQLCMonitorFixtureLinkedIndex, QString::number(linkedIndex));
×
936
                if (item.m_name.isEmpty() == false)
×
937
                    doc->writeAttribute(KXMLQLCMonitorItemName, item.m_name);
×
938
            }
939

940
            // write flags, if present
941
            if (item.m_flags & HiddenFlag)
×
942
                doc->writeAttribute(KXMLQLCMonitorFixtureHiddenFlag, KXMLQLCTrue);
×
943
            if (item.m_flags & InvertedPanFlag)
×
944
                doc->writeAttribute(KXMLQLCMonitorFixtureInvPanFlag, KXMLQLCTrue);
×
945
            if (item.m_flags & InvertedTiltFlag)
×
946
                doc->writeAttribute(KXMLQLCMonitorFixtureInvTiltFlag, KXMLQLCTrue);
×
947

948
            // always write position
949
            doc->writeAttribute(KXMLQLCMonitorItemXPosition, QString::number(item.m_position.x()));
×
950
            doc->writeAttribute(KXMLQLCMonitorItemYPosition, QString::number(item.m_position.y()));
×
951

952
#ifdef QMLUI
953
            doc->writeAttribute(KXMLQLCMonitorItemZPosition, QString::number(item.m_position.z()));
954

955
            // write rotation, if set
956
            if (item.m_rotation.x() != 0)
957
                doc->writeAttribute(KXMLQLCMonitorItemXRotation, QString::number(item.m_rotation.x()));
958
            if (item.m_rotation.y() != 0)
959
                doc->writeAttribute(KXMLQLCMonitorItemYRotation, QString::number(item.m_rotation.y()));
960
            if (item.m_rotation.z() != 0)
961
                doc->writeAttribute(KXMLQLCMonitorItemZRotation, QString::number(item.m_rotation.z()));
962
#else
963
            if (item.m_rotation != QVector3D(0, 0, 0))
×
964
                doc->writeAttribute(KXMLQLCMonitorFixtureRotation, QString::number(item.m_rotation.y()));
×
965
#endif
966
            if (item.m_color.isValid())
×
967
                doc->writeAttribute(KXMLQLCMonitorFixtureGelColor, item.m_color.name());
×
968

969
            if (item.m_zoom > 0)
×
970
                doc->writeAttribute(KXMLQLCMonitorFixtureFixedZoom, QString::number(item.m_zoom));
×
971

972
            doc->writeEndElement();
×
973
        }
×
974
    }
2✔
975

976
    foreach (QString resource, lightResources())
5✔
977
    {
978
        foreach (quint32 headIndex, lightHeadList(resource))
3✔
979
        {
980
            if (containsLightItem(resource, headIndex) == false)
1✔
NEW
981
                continue;
×
982

983
            LightItem item = lightItem(resource, headIndex);
1✔
984

985
            if (resource.isEmpty())
1✔
NEW
986
                continue;
×
987

988
            doc->writeStartElement(KXMLQLCMonitorLightItem);
2✔
989
            doc->writeAttribute(KXMLQLCMonitorItemRes, resource);
2✔
990

991
            if (headIndex)
1✔
NEW
992
                doc->writeAttribute(KXMLQLCMonitorFixtureHeadIndex, QString::number(headIndex));
×
993

994
            doc->writeAttribute(KXMLQLCMonitorItemXPosition, QString::number(item.m_position.x()));
2✔
995
            doc->writeAttribute(KXMLQLCMonitorItemYPosition, QString::number(item.m_position.y()));
2✔
996
            doc->writeAttribute(KXMLQLCMonitorItemZPosition, QString::number(item.m_position.z()));
2✔
997

998
            doc->writeEndElement();
1✔
999
        }
1✔
1000
    }
3✔
1001
#ifdef QMLUI
1002
    QDir dir = QDir::cleanPath(QLCFile::systemDirectory(MESHESDIR).path());
1003
    QString meshDirAbsPath = dir.absolutePath() + QDir::separator();
1004
#endif
1005

1006
    // ***********************************************************
1007
    // *             write generic items information             *
1008
    // ***********************************************************
1009
    QMapIterator<quint32, PreviewItem> it(m_genericItems);
2✔
1010
    while (it.hasNext())
2✔
1011
    {
1012
        it.next();
×
1013
        quint32 itemID = it.key();
×
1014
        PreviewItem item = it.value();
×
1015

1016
        doc->writeStartElement(KXMLQLCMonitorMeshItem);
×
1017
        doc->writeAttribute(KXMLQLCMonitorItemID, QString::number(itemID));
×
1018

1019
        // write flags, if present
1020
        if (item.m_flags & HiddenFlag)
×
1021
            doc->writeAttribute(KXMLQLCMonitorFixtureHiddenFlag, KXMLQLCTrue);
×
1022

1023
        // always write position
1024
        doc->writeAttribute(KXMLQLCMonitorItemXPosition, QString::number(item.m_position.x()));
×
1025
        doc->writeAttribute(KXMLQLCMonitorItemYPosition, QString::number(item.m_position.y()));
×
1026
        doc->writeAttribute(KXMLQLCMonitorItemZPosition, QString::number(item.m_position.z()));
×
1027

1028
        // write rotation, if set
1029
        if (item.m_rotation.x() != 0)
×
1030
            doc->writeAttribute(KXMLQLCMonitorItemXRotation, QString::number(item.m_rotation.x()));
×
1031
        if (item.m_rotation.y() != 0)
×
1032
            doc->writeAttribute(KXMLQLCMonitorItemYRotation, QString::number(item.m_rotation.y()));
×
1033
        if (item.m_rotation.z() != 0)
×
1034
            doc->writeAttribute(KXMLQLCMonitorItemZRotation, QString::number(item.m_rotation.z()));
×
1035

1036
        // write scale, if set
1037
        if (item.m_scale.x() != 1.0)
×
1038
            doc->writeAttribute(KXMLQLCMonitorItemXScale, QString::number(item.m_scale.x()));
×
1039
        if (item.m_scale.y() != 1.0)
×
1040
            doc->writeAttribute(KXMLQLCMonitorItemYScale, QString::number(item.m_scale.y()));
×
1041
        if (item.m_scale.z() != 1.0)
×
1042
            doc->writeAttribute(KXMLQLCMonitorItemZScale, QString::number(item.m_scale.z()));
×
1043

1044
        if (item.m_resource.isEmpty() == false)
×
1045
        {
1046
            // perform normalization depending on the mesh location
1047
            // (mesh folder, project path, absolute path)
1048
            QFileInfo res(item.m_resource);
×
1049

1050
            if (res.isRelative())
×
1051
            {
1052
                doc->writeAttribute(KXMLQLCMonitorItemRes, item.m_resource);
×
1053
            }
1054
#ifdef QMLUI
1055
            else if (item.m_resource.startsWith(meshDirAbsPath))
1056
            {
1057
                item.m_resource.remove(meshDirAbsPath);
1058
                doc->writeAttribute(KXMLQLCMonitorItemRes, item.m_resource);
1059
            }
1060
#endif
1061
            else
1062
            {
1063
                doc->writeAttribute(KXMLQLCMonitorItemRes, mainDocument->normalizeComponentPath(item.m_resource));
×
1064
            }
1065
        }
×
1066

1067
        if (item.m_name.isEmpty() == false)
×
1068
            doc->writeAttribute(KXMLQLCMonitorItemName, item.m_name);
×
1069

1070
        doc->writeEndElement();
×
1071
    }
×
1072

1073
    doc->writeEndElement();
2✔
1074

1075
    return true;
2✔
1076
}
2✔
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