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

mcallegari / qlcplus / 14809507932

03 May 2025 09:13AM UTC coverage: 31.879% (+0.03%) from 31.845%
14809507932

push

github

web-flow
Merge pull request #1745 from mcallegari/qmluiqt6

Port QML UI to Qt6

2 of 9 new or added lines in 3 files covered. (22.22%)

3720 existing lines in 174 files now uncovered.

16422 of 51513 relevant lines covered (31.88%)

19079.9 hits per line

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

0.0
/ui/src/remapwidget.cpp
1
/*
2
  Q Light Controller Plus
3
  remapwidget.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 <QTreeWidgetItem>
21
#include <QPainter>
22
#include <QDebug>
23

24
#include "fixtureremap.h"
25
#include "remapwidget.h"
26

27
RemapWidget::RemapWidget(QTreeWidget *src, QTreeWidget *target, QWidget *parent)
×
28
    : QWidget(parent)
29
    , m_sourceTree(src)
×
30
    , m_targetTree(target)
×
31
{
32
    setMaximumWidth(100);
×
33
}
×
34

35
RemapWidget::~RemapWidget()
×
36
{
37
}
×
38

39
void RemapWidget::setRemapList(QList<RemapInfo> list)
×
40
{
41
    m_list = list;
×
42
    update();
×
43
}
×
44

45
void RemapWidget::resizeEvent(QResizeEvent *e)
×
46
{
47
    QWidget::resizeEvent(e);
×
48
}
×
49

50
void RemapWidget::paintEvent(QPaintEvent *e)
×
51
{
52
    Q_UNUSED(e)
53

54
    QPainter painter(this);
×
55
    painter.setBrush(QBrush(Qt::white));
×
56
    painter.drawRect(0, 0, width(), height());
×
57
    painter.setPen(QPen(Qt::black));
×
58

59
    int yOffset = m_sourceTree->header()->height() + 10;
×
60

61
    foreach (RemapInfo info, m_list)
×
62
    {
63
        QRect srcRect = m_sourceTree->visualItemRect(info.source);
×
64
        QRect tgtRect = m_targetTree->visualItemRect(info.target);
×
65

UNCOV
66
        if (srcRect.isEmpty())
×
67
            srcRect = m_sourceTree->visualItemRect(info.source->parent());
×
68

UNCOV
69
        if (tgtRect.isEmpty())
×
70
            tgtRect = m_targetTree->visualItemRect(info.target->parent());
×
71

72
        //qDebug() << "Source rect:" << srcRect << ", target rect:" << tgtRect;
73

74
        painter.drawLine(0, srcRect.y() + yOffset, 10, srcRect.y() + yOffset);
×
75
        painter.drawLine(10, srcRect.y() + yOffset, 90, tgtRect.y() + yOffset);
×
UNCOV
76
        painter.drawLine(90, tgtRect.y() + yOffset, 100, tgtRect.y() + yOffset);
×
UNCOV
77
    }
×
78
}
×
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