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

mcallegari / qlcplus / 8961243534

05 May 2024 09:23PM UTC coverage: 32.068% (+4.0%) from 28.094%
8961243534

push

github

mcallegari
Merge branch 'master' into qmltoqt6

902 of 2557 new or added lines in 140 files covered. (35.28%)

166 existing lines in 76 files now uncovered.

15395 of 48008 relevant lines covered (32.07%)

22949.67 hits per line

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

0.0
/ui/src/groupsconsole.cpp
1
/*
2
  Q Light Controller
3
  groupsconsole.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 <QHBoxLayout>
21
#include <QToolButton>
22
#include <QSpinBox>
23
#include <QSlider>
24
#include <QDebug>
25
#include <QIcon>
26
#include <QList>
27

28
#include "consolechannel.h"
29
#include "clickandgoslider.h"
30
#include "groupsconsole.h"
31
#include "doc.h"
32

33
/*****************************************************************************
34
 * Initialization
35
 *****************************************************************************/
36

37
GroupsConsole::GroupsConsole(QWidget* parent, Doc* doc, QList <quint32> ids, QList<uchar> levels)
×
38
    : QWidget(parent)
39
    , m_doc(doc)
40
    , m_ids(ids)
41
    , m_levels(levels)
×
42
{
43
    Q_ASSERT(doc != NULL);
×
44
    new QHBoxLayout(this);
×
45

46
    init();
×
47
}
×
48

49
GroupsConsole::~GroupsConsole()
×
50
{
51
}
×
52

53
QList<ConsoleChannel *> GroupsConsole::groups()
×
54
{
55
    return m_groups;
×
56
}
57

58
void GroupsConsole::init()
×
59
{
60
    int idx = 0;
×
NEW
61
    foreach (quint32 id, m_ids)
×
62
    {
63
        ChannelsGroup *grp = m_doc->channelsGroup(id);
×
64
        if (grp != NULL && grp->getChannels().count() > 0)
×
65
        {
66
            SceneValue scv = grp->getChannels().at(0);
×
67

68
            ConsoleChannel* cc = new ConsoleChannel(this, m_doc, scv.fxi, scv.channel, false);
×
69
            cc->setLabel(grp->name());
×
70
            cc->setChannelsGroup(id);
×
71
            cc->setChannelStyleSheet(CNG_DEFAULT_STYLE);
×
72
            if (idx < m_levels.count())
×
73
                cc->setValue(m_levels.at(idx));
×
74
            layout()->addWidget(cc);
×
75
            m_groups.append(cc);
×
76

77
            connect(cc, SIGNAL(groupValueChanged(quint32, uchar)),
×
78
                    this, SIGNAL(groupValueChanged(quint32, uchar)));
79
            idx++;
×
80
        }
81
    }
82
    /* Make a spacer item eat excess space to justify channels left */
83
    layout()->addItem(new QSpacerItem(0, 0, QSizePolicy::Expanding));
×
UNCOV
84
}
×
85

86

87

88

89

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

© 2025 Coveralls, Inc