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

mcallegari / qlcplus / 16350436608

17 Jul 2025 04:18PM UTC coverage: 34.215% (-0.07%) from 34.286%
16350436608

Pull #1782

github

web-flow
Merge 131a05ba3 into 30458f6f0
Pull Request #1782: Feature: Control RGB Matrix script properties with VC Knobs in animation widget

7 of 124 new or added lines in 5 files covered. (5.65%)

7 existing lines in 4 files now uncovered.

17704 of 51744 relevant lines covered (34.21%)

19388.54 hits per line

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

0.0
/ui/src/virtualconsole/vcmatrixproperties.cpp
1
/*
2
  Q Light Controller Plus
3
  vcmatrixproperties.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 <QColorDialog>
21
#include <QInputDialog>
22
#include <QTreeWidget>
23
#include <QMap>
24

25
#include "vcmatrixpresetselection.h"
26
#include "inputselectionwidget.h"
27
#include "vcmatrixproperties.h"
28
#include "selectinputchannel.h"
29
#include "functionselection.h"
30
#include "inputpatch.h"
31
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
32
 #include "rgbscript.h"
33
#else
34
 #include "rgbscriptv4.h"
35
#endif
36

37
VCMatrixProperties::VCMatrixProperties(VCMatrix* matrix, Doc* doc)
×
38
    : QDialog(matrix)
39
    , m_doc(doc)
×
40
{
41
    Q_ASSERT(matrix != NULL);
×
42
    Q_ASSERT(doc != NULL);
×
43

44
    setupUi(this);
×
45

46
    m_lastAssignedID = 0;
×
47

48
    /* Matrix text and function */
49
    m_matrix = matrix;
×
50
    m_nameEdit->setText(m_matrix->caption());
×
51
    slotSetFunction(m_matrix->function());
×
52

53
    if (m_matrix->instantChanges())
×
54
        m_instantCheck->setChecked(true);
×
55

56
    /* Matrix connections */
57
    connect(m_attachFunction, SIGNAL(clicked()), this, SLOT(slotAttachFunction()));
×
58
    connect(m_detachFunction, SIGNAL(clicked()), this, SLOT(slotSetFunction()));
×
59

60
    /* Slider external input */
61
    m_sliderInputSource = m_matrix->inputSource();
×
62
    updateSliderInputSource();
×
63

64
    connect(m_autoDetectInputButton, SIGNAL(toggled(bool)),
×
65
            this, SLOT(slotAutoDetectSliderInputToggled(bool)));
66
    connect(m_chooseInputButton, SIGNAL(clicked()),
×
67
            this, SLOT(slotChooseSliderInputClicked()));
68

69
    /* Visibility */
70
    quint32 visibilityMask = m_matrix->visibilityMask();
×
71
    if (visibilityMask & VCMatrix::ShowSlider) m_sliderCheck->setChecked(true);
×
72
    if (visibilityMask & VCMatrix::ShowLabel) m_labelCheck->setChecked(true);
×
73
    if (visibilityMask & VCMatrix::ShowColor1Button) m_mtxColor1ButtonCheck->setChecked(true);
×
74
    if (visibilityMask & VCMatrix::ShowColor2Button) m_mtxColor2ButtonCheck->setChecked(true);
×
75
    if (visibilityMask & VCMatrix::ShowColor3Button) m_mtxColor3ButtonCheck->setChecked(true);
×
76
    if (visibilityMask & VCMatrix::ShowColor4Button) m_mtxColor4ButtonCheck->setChecked(true);
×
77
    if (visibilityMask & VCMatrix::ShowColor5Button) m_mtxColor5ButtonCheck->setChecked(true);
×
78
    if (visibilityMask & VCMatrix::ShowPresetCombo) m_presetComboCheck->setChecked(true);
×
79

80
    /* Custom controls */
81
    foreach (const VCMatrixControl *control, m_matrix->customControls())
×
82
    {
83
        m_controls.append(new VCMatrixControl(*control));
×
84
        if (control->m_id > m_lastAssignedID)
×
85
            m_lastAssignedID = control->m_id;
×
86
    }
×
87

88
    m_controlsTree->setSelectionMode(QAbstractItemView::SingleSelection);
×
89

90
    updateTree();
×
91
    slotColorComboActivated();
×
92

93
    connect(m_controlsTree, SIGNAL(itemClicked(QTreeWidgetItem*,int)),
×
94
            this, SLOT(slotTreeSelectionChanged()));
95

96
    connect(m_colorsCombo, SIGNAL(activated(int)),
×
97
            this, SLOT(slotColorComboActivated()));
98
    connect(m_addColorButton, SIGNAL(clicked()),
×
99
            this, SLOT(slotAddColorClicked()));
100
    connect(m_addColorKnobsButton, SIGNAL(clicked()),
×
101
            this, SLOT(slotAddColorKnobsClicked()));
102
    connect(m_addColorResetButton, SIGNAL(clicked()),
×
103
            this, SLOT(slotAddColorResetClicked()));
104

105
    connect(m_addPresetButton, SIGNAL(clicked()),
×
106
            this, SLOT(slotAddAnimationClicked()));
107
    connect(m_addTextButton, SIGNAL(clicked()),
×
108
            this, SLOT(slotAddTextClicked()));
109

110
    connect(m_removeButton, SIGNAL(clicked()),
×
111
            this, SLOT(slotRemoveClicked()));
112

113
    m_presetInputWidget = new InputSelectionWidget(m_doc, this);
×
114
    m_presetInputWidget->setCustomFeedbackVisibility(true);
×
115
    m_presetInputWidget->setWidgetPage(m_matrix->page());
×
116
    m_presetInputWidget->show();
×
117
    m_presetInputLayout->addWidget(m_presetInputWidget);
×
118

119
    connect(m_presetInputWidget, SIGNAL(inputValueChanged(quint32,quint32)),
×
120
            this, SLOT(slotInputValueChanged(quint32,quint32)));
121
    connect(m_presetInputWidget, SIGNAL(keySequenceChanged(QKeySequence)),
×
122
            this, SLOT(slotKeySequenceChanged(QKeySequence)));
123
}
×
124

125
VCMatrixProperties::~VCMatrixProperties()
×
126
{
127
    foreach (VCMatrixControl* control, m_controls)
×
128
        delete control;
×
129

130
    delete m_presetInputWidget;
×
131
}
×
132

133
/*********************************************************************
134
 * RGB Matrix attachment
135
 *********************************************************************/
136

137
void VCMatrixProperties::slotAttachFunction()
×
138
{
139
    FunctionSelection fs(this, m_doc);
×
140
    fs.setMultiSelection(false);
×
141
    fs.setFilter(Function::RGBMatrixType);
×
142
    fs.disableFilters(Function::SceneType | Function::ChaserType | Function::EFXType |
×
143
                      Function::ShowType | Function::ScriptType | Function::CollectionType |
144
                      Function::AudioType | Function::VideoType);
145

146
    if (fs.exec() == QDialog::Accepted && fs.selection().size() > 0)
×
147
        slotSetFunction(fs.selection().first());
×
148
}
×
149

150
void VCMatrixProperties::slotSetFunction(quint32 fid)
×
151
{
152
    m_function = fid;
×
153
    Function* func = m_doc->function(m_function);
×
154

155
    if (func == NULL)
×
156
    {
157
        m_functionEdit->setText(tr("No function"));
×
158
    }
159
    else
160
    {
161
        m_functionEdit->setText(func->name());
×
162
        if (m_nameEdit->text().simplified().contains(QString::number(m_matrix->id())))
×
163
            m_nameEdit->setText(func->name());
×
164
    }
165
}
×
166

167
/*********************************************************************
168
 * Slider External input
169
 *********************************************************************/
170

171
void VCMatrixProperties::slotAutoDetectSliderInputToggled(bool checked)
×
172
{
173
    if (checked == true)
×
174
    {
175
        connect(m_doc->inputOutputMap(), SIGNAL(inputValueChanged(quint32,quint32,uchar)),
×
176
                this, SLOT(slotSliderInputValueChanged(quint32,quint32)));
177
    }
178
    else
179
    {
180
        disconnect(m_doc->inputOutputMap(), SIGNAL(inputValueChanged(quint32,quint32,uchar)),
×
181
                   this, SLOT(slotSliderInputValueChanged(quint32,quint32)));
182
    }
183
}
×
184

185
void VCMatrixProperties::slotSliderInputValueChanged(quint32 universe, quint32 channel)
×
186
{
187
    m_sliderInputSource = QSharedPointer<QLCInputSource>(new QLCInputSource(universe, (m_matrix->page() << 16) | channel));
×
188
    updateSliderInputSource();
×
189
}
×
190

191
void VCMatrixProperties::slotChooseSliderInputClicked()
×
192
{
193
    SelectInputChannel sic(this, m_doc->inputOutputMap());
×
194
    if (sic.exec() == QDialog::Accepted)
×
195
    {
196
        m_sliderInputSource = QSharedPointer<QLCInputSource>(new QLCInputSource(sic.universe(), sic.channel()));
×
197
        updateSliderInputSource();
×
198
    }
199
}
×
200

201
void VCMatrixProperties::updateSliderInputSource()
×
202
{
203
    QString uniName;
×
204
    QString chName;
×
205

206
    if (m_doc->inputOutputMap()->inputSourceNames(m_sliderInputSource, uniName, chName) == false)
×
207
    {
208
        uniName = KInputNone;
×
209
        chName = KInputNone;
×
210
    }
211

212
    m_inputUniverseEdit->setText(uniName);
×
213
    m_inputChannelEdit->setText(chName);
×
214
}
×
215

216
/*********************************************************************
217
 * Custom controls
218
 *********************************************************************/
219

220
void VCMatrixProperties::updateTree()
×
221
{
222
    m_controlsTree->blockSignals(true);
×
223
    m_controlsTree->clear();
×
224
    foreach (VCMatrixControl *control, m_controls)
×
225
    {
226
        QTreeWidgetItem *item = new QTreeWidgetItem(m_controlsTree);
×
227
        item->setData(0, Qt::UserRole, control->m_id);
×
228

229
        switch(control->m_type)
×
230
        {
231
            case VCMatrixControl::Color1:
×
232
                item->setIcon(0, QIcon(":/color.png"));
×
233
                item->setText(0, tr("Color 1"));
×
234
                item->setText(1, control->m_color.name());
×
235
                item->setBackground(1, QBrush(control->m_color));
×
236
            break;
×
237
            case VCMatrixControl::Color1Knob:
×
238
                item->setIcon(0, QIcon(":/knob.png"));
×
239
                item->setText(0, tr("Color 1 Knob"));
×
240
                item->setText(1, control->m_color.name());
×
241
                item->setBackground(1, QBrush(control->m_color));
×
242
            break;
×
243
            case VCMatrixControl::Color1Reset:
×
244
            break;
×
245
            case VCMatrixControl::Color2:
×
246
                item->setIcon(0, QIcon(":/color.png"));
×
247
                item->setText(0, tr("Color 2"));
×
248
                item->setText(1, control->m_color.name());
×
249
                item->setBackground(1, QBrush(control->m_color));
×
250
            break;
×
251
            case VCMatrixControl::Color2Knob:
×
252
                item->setIcon(0, QIcon(":/knob.png"));
×
253
                item->setText(0, tr("Color 2 Knob"));
×
254
                item->setText(1, control->m_color.name());
×
255
                item->setBackground(1, QBrush(control->m_color));
×
256
            break;
×
257
            case VCMatrixControl::Color2Reset:
×
258
                item->setIcon(0, QIcon(":/fileclose.png"));
×
259
                item->setText(0, tr("Color 2 Reset"));
×
260
            break;
×
261
            case VCMatrixControl::Color3:
×
262
                item->setIcon(0, QIcon(":/color.png"));
×
263
                item->setText(0, tr("Color 3"));
×
264
                item->setText(1, control->m_color.name());
×
265
                item->setBackground(1, QBrush(control->m_color));
×
266
            break;
×
267
            case VCMatrixControl::Color3Knob:
×
268
                item->setIcon(0, QIcon(":/knob.png"));
×
269
                item->setText(0, tr("Color 3 Knob"));
×
270
                item->setText(1, control->m_color.name());
×
271
                item->setBackground(1, QBrush(control->m_color));
×
272
            break;
×
273
            case VCMatrixControl::Color3Reset:
×
274
                item->setIcon(0, QIcon(":/fileclose.png"));
×
275
                item->setText(0, tr("Color 3 Reset"));
×
276
            break;
×
277
            case VCMatrixControl::Color4:
×
278
                item->setIcon(0, QIcon(":/color.png"));
×
279
                item->setText(0, tr("Color 4"));
×
280
                item->setText(1, control->m_color.name());
×
281
                item->setBackground(1, QBrush(control->m_color));
×
282
            break;
×
283
            case VCMatrixControl::Color4Knob:
×
284
                item->setIcon(0, QIcon(":/knob.png"));
×
285
                item->setText(0, tr("Color 4 Knob"));
×
286
                item->setText(1, control->m_color.name());
×
287
                item->setBackground(1, QBrush(control->m_color));
×
288
            break;
×
289
            case VCMatrixControl::Color4Reset:
×
290
                item->setIcon(0, QIcon(":/fileclose.png"));
×
291
                item->setText(0, tr("Color 4 Reset"));
×
292
            break;
×
293
            case VCMatrixControl::Color5:
×
294
                item->setIcon(0, QIcon(":/color.png"));
×
295
                item->setText(0, tr("Color 5"));
×
296
                item->setText(1, control->m_color.name());
×
297
                item->setBackground(1, QBrush(control->m_color));
×
298
            break;
×
299
            case VCMatrixControl::Color5Knob:
×
300
                item->setIcon(0, QIcon(":/knob.png"));
×
301
                item->setText(0, tr("Color 5 Knob"));
×
302
                item->setText(1, control->m_color.name());
×
303
                item->setBackground(1, QBrush(control->m_color));
×
304
            break;
×
305
            case VCMatrixControl::Color5Reset:
×
306
                item->setIcon(0, QIcon(":/fileclose.png"));
×
307
                item->setText(0, tr("Color 5 Reset"));
×
308
            break;
×
309
            case VCMatrixControl::Animation:
×
310
            {
311
                item->setIcon(0, QIcon(":/script.png"));
×
312
                item->setText(0, tr("Animation"));
×
313
                QString presetName = control->m_resource;
×
314
                if (!control->m_properties.isEmpty())
×
315
                {
316
                    presetName += " (";
×
317
                    QMapIterator<QString, QString> it(control->m_properties);
×
318
                    while (it.hasNext())
×
319
                    {
320
                        it.next();
×
321
                        presetName += it.value();
×
322
                        if (it.hasNext())
×
323
                            presetName += ",";
×
324
                    }
325
                    presetName += ")";
×
326
                }
×
327
                item->setText(1, presetName);
×
328
            }
×
329
            break;
×
NEW
330
            case VCMatrixControl::AnimationKnob:
×
NEW
331
                item->setIcon(0, QIcon(":/knob.png"));
×
NEW
332
                item->setText(0, tr("Animation Knob"));
×
NEW
333
                item->setText(1, control->m_resource);
×
NEW
334
            break;
×
335
            case VCMatrixControl::Image:
×
336
            break;
×
337
            case VCMatrixControl::Text:
×
338
                item->setIcon(0, QIcon(":/fonts.png"));
×
339
                item->setText(0, tr("Text"));
×
340
                item->setText(1, control->m_resource);
×
341
            break;
×
342
        }
343
    }
×
344
    m_controlsTree->resizeColumnToContents(0);
×
345
    m_controlsTree->blockSignals(false);
×
346
}
×
347

348
VCMatrixControl *VCMatrixProperties::getSelectedControl()
×
349
{
350
    if (m_controlsTree->selectedItems().isEmpty())
×
351
        return NULL;
×
352

353
    QTreeWidgetItem * item = m_controlsTree->selectedItems().first();
×
354
    if (item != NULL)
×
355
    {
356
        quint8 ctlID = item->data(0, Qt::UserRole).toUInt();
×
357
        foreach (VCMatrixControl *control, m_controls)
×
358
        {
359
            if (control->m_id == ctlID)
×
360
                return control;
×
361
        }
×
362
    }
363

364
    Q_ASSERT(false);
×
365
    return NULL;
366
}
367

368
QList<QColor> VCMatrixProperties::rgbColorList()
×
369
{
370
    QList<QColor> colors;
×
371
    colors.append(QColor(Qt::red));
×
372
    colors.append(QColor(Qt::green));
×
373
    colors.append(QColor(Qt::blue));
×
374
    return colors;
×
375
}
×
376

377
void VCMatrixProperties::addControl(VCMatrixControl *control)
×
378
{
379
    m_controls.append(control);
×
380
}
×
381

382
void VCMatrixProperties::removeControl(quint8 id)
×
383
{
384
    for (int i = 0; i < m_controls.count(); i++)
×
385
    {
386
        if (m_controls.at(i)->m_id == id)
×
387
        {
388
            m_controls.removeAt(i);
×
389
            return;
×
390
        }
391
    }
392
}
393

394
void VCMatrixProperties::slotAddColorClicked()
×
395
{
396
    QColor col = QColorDialog::getColor();
×
397
    if (col.isValid() == true)
×
398
    {
399
        VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
400
        newControl->m_type = VCMatrixControl::ControlType(int(VCMatrixControl::Color1) + m_colorsCombo->currentIndex());
×
401
        newControl->m_color = col;
×
402
        addControl(newControl);
×
403
        updateTree();
×
404
    }
405
}
×
406

407
void VCMatrixProperties::slotAddColorKnobsClicked()
×
408
{
409
    foreach (QColor col, VCMatrixProperties::rgbColorList())
×
410
    {
411
        VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
412
        newControl->m_type = VCMatrixControl::ControlType(int(VCMatrixControl::Color1Knob) + m_colorsCombo->currentIndex());
×
413
        newControl->m_color = col;
×
414
        addControl(newControl);
×
415
    }
×
416
    updateTree();
×
417
}
×
418

419
void VCMatrixProperties::slotAddColorResetClicked()
×
420
{
421
    VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
422
    newControl->m_type = VCMatrixControl::ControlType(int(VCMatrixControl::Color1Reset) + m_colorsCombo->currentIndex());
×
423
    addControl(newControl);
×
424
    updateTree();
×
425
}
×
426

427
void VCMatrixProperties::slotAddAnimationClicked()
×
428
{
429
    VCMatrixPresetSelection ps(m_doc, this);
×
430

431
    if (ps.exec() == QDialog::Accepted)
×
432
    {
NEW
433
        QMap<QString, bool> dynProps = ps.dynamicProperties();
×
NEW
434
        if (dynProps.isEmpty())
×
435
        {
NEW
436
            VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
NEW
437
            newControl->m_type = VCMatrixControl::Animation;
×
NEW
438
            newControl->m_resource = ps.selectedPreset();
×
NEW
439
            newControl->m_properties = ps.customizedProperties();
×
NEW
440
            newControl->m_dynamicProperties = ps.dynamicProperties();
×
NEW
441
            addControl(newControl);
×
442
        }
443
        else
444
        {
NEW
445
            QMapIterator<QString, bool> it(dynProps);
×
NEW
446
            while (it.hasNext())
×
447
            {
NEW
448
                it.next();
×
NEW
449
                if (it.value() == true)
×
450
                {
NEW
451
                    VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
NEW
452
                    newControl->m_type = VCMatrixControl::AnimationKnob;
×
NEW
453
                    newControl->m_resource = it.key();
×
NEW
454
                    addControl(newControl);
×
455
                }
456
            }
NEW
457
        }
×
UNCOV
458
        updateTree();
×
UNCOV
459
    }
×
460
}
×
461

462
void VCMatrixProperties::slotAddTextClicked()
×
463
{
464
    bool ok;
465
    QString text = QInputDialog::getText(this, tr("Enter a text"),
×
466
                                      tr("Text"), QLineEdit::Normal,
×
467
                                      "Q Light Controller+", &ok);
×
468
    if (ok && !text.isEmpty())
×
469
    {
470
        VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
471
        newControl->m_type = VCMatrixControl::Text;
×
472
        newControl->m_resource = text;
×
473
        addControl(newControl);
×
474
        updateTree();
×
475
    }
476
}
×
477

478
void VCMatrixProperties::slotRemoveClicked()
×
479
{
480
    if (m_controlsTree->selectedItems().isEmpty())
×
481
        return;
×
482
    QTreeWidgetItem *selItem = m_controlsTree->selectedItems().first();
×
483
    quint8 ctlID = selItem->data(0, Qt::UserRole).toUInt();
×
484

485
    {
486
        // For R/G/B Knobs:
487
        // Remove the two others
488
        VCMatrixControl *control = getSelectedControl();
×
489
        if (control != NULL)
×
490
        {
491
            if (control->m_type == VCMatrixControl::Color1Knob
×
492
                    || control->m_type == VCMatrixControl::Color2Knob
×
493
                    || control->m_type == VCMatrixControl::Color3Knob
×
494
                    || control->m_type == VCMatrixControl::Color4Knob
×
495
                    || control->m_type == VCMatrixControl::Color5Knob)
×
496
            {
497
                if (control->m_color == Qt::red)
×
498
                {
499
                    removeControl(ctlID + 1);
×
500
                    removeControl(ctlID + 2);
×
501
                }
502
                else if (control->m_color == Qt::green)
×
503
                {
504
                    removeControl(ctlID - 1);
×
505
                    removeControl(ctlID + 1);
×
506
                }
507
                else if (control->m_color == Qt::blue)
×
508
                {
509
                    removeControl(ctlID - 2);
×
510
                    removeControl(ctlID - 1);
×
511
                }
512
                else
513
                {
514
                    Q_ASSERT(false);
×
515
                }
516
            }
517
        }
518
    }
519

520
    removeControl(ctlID);
×
521
    updateTree();
×
522
}
523

524
void VCMatrixProperties::slotInputValueChanged(quint32 universe, quint32 channel)
×
525
{
526
    Q_UNUSED(universe);
527
    Q_UNUSED(channel);
528

529
    VCMatrixControl *preset = getSelectedControl();
×
530

531
    if (preset != NULL) {
×
532
        preset->m_inputSource = m_presetInputWidget->inputSource();
×
533
    }
534
}
×
535

536
void VCMatrixProperties::slotKeySequenceChanged(QKeySequence key)
×
537
{
538
    VCMatrixControl *preset = getSelectedControl();
×
539

540
    if (preset != NULL)
×
541
        preset->m_keySequence = key;
×
542
}
×
543

544

545
void VCMatrixProperties::slotTreeSelectionChanged()
×
546
{
547
    VCMatrixControl *control = getSelectedControl();
×
548

549
    if (control != NULL)
×
550
    {
551
        m_presetInputWidget->setInputSource(control->m_inputSource);
×
552
        m_presetInputWidget->setKeySequence(control->m_keySequence.toString(QKeySequence::NativeText));
×
553
        if (control->widgetType() == VCMatrixControl::Button)
×
554
        {
555
            m_presetInputWidget->setCustomFeedbackVisibility(true);
×
556
            m_presetInputWidget->setKeyInputVisibility(true);
×
557
        }
558
        else
559
        {
560
            m_presetInputWidget->setCustomFeedbackVisibility(false);
×
561
            m_presetInputWidget->setKeyInputVisibility(false);
×
562
        }
563
    }
564
}
×
565

566
void VCMatrixProperties::slotColorComboActivated()
×
567
{
568
    if (m_colorsCombo->currentIndex() == 0)
×
569
        m_addColorResetButton->setEnabled(false);
×
570
    else
571
        m_addColorResetButton->setEnabled(true);
×
572
}
×
573

574
void VCMatrixProperties::accept()
×
575
{
576
    m_matrix->setCaption(m_nameEdit->text());
×
577
    m_matrix->setFunction(m_function);
×
578
    if (m_instantCheck->isChecked())
×
579
        m_matrix->setInstantChanges(true);
×
580
    else
581
        m_matrix->setInstantChanges(false);
×
582

583
    /* External input */
584
    m_matrix->setInputSource(m_sliderInputSource);
×
585

586
    /* Visibility */
587
    quint32 visibilityMask = 0;
×
588
    if (m_sliderCheck->isChecked()) visibilityMask |= VCMatrix::ShowSlider;
×
589
    if (m_labelCheck->isChecked()) visibilityMask |= VCMatrix::ShowLabel;
×
590
    if (m_mtxColor1ButtonCheck->isChecked()) visibilityMask |= VCMatrix::ShowColor1Button;
×
591
    if (m_mtxColor2ButtonCheck->isChecked()) visibilityMask |= VCMatrix::ShowColor2Button;
×
592
    if (m_mtxColor3ButtonCheck->isChecked()) visibilityMask |= VCMatrix::ShowColor3Button;
×
593
    if (m_mtxColor4ButtonCheck->isChecked()) visibilityMask |= VCMatrix::ShowColor4Button;
×
594
    if (m_mtxColor5ButtonCheck->isChecked()) visibilityMask |= VCMatrix::ShowColor5Button;
×
595
    if (m_presetComboCheck->isChecked()) visibilityMask |= VCMatrix::ShowPresetCombo;
×
596
    m_matrix->setVisibilityMask(visibilityMask);
×
597

598
    /* Controls */
599
    m_matrix->resetCustomControls();
×
600
    for (int i = 0; i < m_controls.count(); i++)
×
601
        m_matrix->addCustomControl(*m_controls.at(i));
×
602

603
    /* Close dialog */
604
    QDialog::accept();
×
605
}
×
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