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

mcallegari / qlcplus / 18357067171

08 Oct 2025 08:16PM UTC coverage: 34.26% (+2.2%) from 32.066%
18357067171

push

github

mcallegari
Merge branch 'master' into filedialog

1282 of 4424 new or added lines in 152 files covered. (28.98%)

1342 existing lines in 152 files now uncovered.

17704 of 51675 relevant lines covered (34.26%)

19430.31 hits per line

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

0.0
/ui/src/functionliveeditdialog.cpp
1
/*
2
  Q Light Controller Plus
3
  functionliveeditdialog.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 <QSettings>
21

22
#include "functionliveeditdialog.h"
23
#include "rgbmatrixeditor.h"
24
#include "chasereditor.h"
25
#include "sceneeditor.h"
26
#include "efxeditor.h"
27
#include "rgbmatrix.h"
28
#include "chaser.h"
29
#include "scene.h"
30
#include "doc.h"
31
#include "efx.h"
32

33
#define SETTINGS_GEOMETRY "funcliveedit/geometry"
34

35
FunctionLiveEditDialog::FunctionLiveEditDialog(Doc *doc, quint32 fid, QWidget *parent)
×
36
  : QDialog(parent)
UNCOV
37
  , m_doc(doc)
×
38
  , m_editor(NULL)
×
39
{
40
    Q_ASSERT(doc != NULL);
×
41

42
    Function *func = m_doc->function(fid);
×
43
    Q_ASSERT(func != NULL);
×
44

45
    setWindowTitle(tr("Function Live Edit"));
×
46
    setWindowIcon(QIcon(":/liveedit.png"));
×
47

48
    QSettings settings;
×
49
    QVariant var = settings.value(SETTINGS_GEOMETRY);
×
50
    if (var.isValid() == true)
×
51
        restoreGeometry(var.toByteArray());
×
52

53
    /* Master layout for toolbar and scroll area */
54
    new QVBoxLayout(this);
×
55
    setContentsMargins(0, 0, 0, 0);
×
56

57
    /* Scroll area that contains the editor widget */
58
    m_scrollArea = new QScrollArea(parent);
×
59
    m_scrollArea->setWidgetResizable(true);
×
60
    m_scrollArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
×
61
    layout()->addWidget(m_scrollArea);
×
62

63
    switch(func->type())
×
64
    {
65
        case Function::SceneType:
×
66
        {
67
            bool blindMode = true;
×
68
            if (func->isRunning())
×
69
                blindMode = false;
×
70
            SceneEditor *sceneEditor = new SceneEditor(m_scrollArea, qobject_cast<Scene*> (func), m_doc, true);
×
71
            sceneEditor->setBlindModeEnabled(blindMode);
×
72
            m_editor = sceneEditor;
×
73
        }
74
        break;
×
75
        case Function::ChaserType:
×
76
        case Function::SequenceType:
77
            m_editor = new ChaserEditor(m_scrollArea, qobject_cast<Chaser*> (func), m_doc, true);
×
78
        break;
×
79
        case Function::EFXType:
×
80
            m_editor = new EFXEditor(m_scrollArea, qobject_cast<EFX*> (func), m_doc);
×
81
        break;
×
82
        case Function::RGBMatrixType:
×
83
            m_editor = new RGBMatrixEditor(m_scrollArea, qobject_cast<RGBMatrix*> (func), m_doc);
×
84
        break;
×
85
        default:
×
86
        break;
×
87
    }
88

89
    if (m_editor != NULL)
×
90
    {
91
        m_scrollArea->setWidget(m_editor);
×
92
        m_editor->show();
×
93
        m_scrollArea->show();
×
94
    }
95
}
×
96

97
FunctionLiveEditDialog::~FunctionLiveEditDialog()
×
98
{
99
    QSettings settings;
×
100
    settings.setValue(SETTINGS_GEOMETRY, saveGeometry());
×
101
}
×
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