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

mcallegari / qlcplus / 12611954629

04 Jan 2025 04:17PM UTC coverage: 31.468% (-0.5%) from 31.963%
12611954629

Pull #1649

github

web-flow
Merge d17d3ec9b into 3ed321c32
Pull Request #1649: Function Wizard: create Effects

2 of 53 new or added lines in 2 files covered. (3.77%)

2597 existing lines in 15 files now uncovered.

14093 of 44785 relevant lines covered (31.47%)

26791.82 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

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

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

43
    setupUi(this);
×
44

45
    m_lastAssignedID = 0;
×
46

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

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

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

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

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

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

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

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

UNCOV
89
    updateTree();
×
UNCOV
90
    slotColorComboActivated();
×
91

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

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

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

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

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

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

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

UNCOV
129
    delete m_presetInputWidget;
×
UNCOV
130
}
×
131

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

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

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

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

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

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

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

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

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

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

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

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

215
/*********************************************************************
216
 * Custom controls
217
 *********************************************************************/
218

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

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

342
VCMatrixControl *VCMatrixProperties::getSelectedControl()
×
343
{
344
    if (m_controlsTree->selectedItems().isEmpty())
×
345
        return NULL;
346

UNCOV
347
    QTreeWidgetItem * item = m_controlsTree->selectedItems().first();
×
348
    if (item != NULL)
×
349
    {
350
        quint8 ctlID = item->data(0, Qt::UserRole).toUInt();
×
UNCOV
351
        foreach (VCMatrixControl *control, m_controls)
×
352
        {
353
            if (control->m_id == ctlID)
×
354
                return control;
355
        }
356
    }
357

358
    Q_ASSERT(false);
359
    return NULL;
360
}
361

362
QList<QColor> VCMatrixProperties::rgbColorList()
×
363
{
364
    QList<QColor> colors;
365
    colors.append(QColor(Qt::red));
×
366
    colors.append(QColor(Qt::green));
×
367
    colors.append(QColor(Qt::blue));
×
368
    return colors;
×
369
}
370

371
void VCMatrixProperties::addControl(VCMatrixControl *control)
×
372
{
373
    m_controls.append(control);
×
UNCOV
374
}
×
375

UNCOV
376
void VCMatrixProperties::removeControl(quint8 id)
×
377
{
378
    for (int i = 0; i < m_controls.count(); i++)
×
379
    {
380
        if (m_controls.at(i)->m_id == id)
×
381
        {
382
            m_controls.removeAt(i);
×
383
            return;
×
384
        }
385
    }
386
}
387

388
void VCMatrixProperties::slotAddColorClicked()
×
389
{
390
    QColor col = QColorDialog::getColor();
×
391
    if (col.isValid() == true)
×
392
    {
393
        VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
UNCOV
394
        newControl->m_type = VCMatrixControl::ControlType(int(VCMatrixControl::Color1) + m_colorsCombo->currentIndex());
×
395
        newControl->m_color = col;
×
UNCOV
396
        addControl(newControl);
×
397
        updateTree();
×
398
    }
399
}
×
400

401
void VCMatrixProperties::slotAddColorKnobsClicked()
×
402
{
403
    foreach (QColor col, VCMatrixProperties::rgbColorList())
×
404
    {
UNCOV
405
        VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
406
        newControl->m_type = VCMatrixControl::ControlType(int(VCMatrixControl::Color1Knob) + m_colorsCombo->currentIndex());
×
UNCOV
407
        newControl->m_color = col;
×
408
        addControl(newControl);
×
409
    }
UNCOV
410
    updateTree();
×
411
}
×
412

413
void VCMatrixProperties::slotAddColorResetClicked()
×
414
{
UNCOV
415
    VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
416
    newControl->m_type = VCMatrixControl::ControlType(int(VCMatrixControl::Color1Reset) + m_colorsCombo->currentIndex());
×
417
    addControl(newControl);
×
418
    updateTree();
×
419
}
×
420

UNCOV
421
void VCMatrixProperties::slotAddAnimationClicked()
×
422
{
UNCOV
423
    VCMatrixPresetSelection ps(m_doc, this);
×
424

UNCOV
425
    if (ps.exec() == QDialog::Accepted)
×
426
    {
UNCOV
427
        VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
428
        newControl->m_type = VCMatrixControl::Animation;
×
429
        newControl->m_resource = ps.selectedPreset();
×
UNCOV
430
        newControl->m_properties = ps.customizedProperties();
×
UNCOV
431
        addControl(newControl);
×
UNCOV
432
        updateTree();
×
433
    }
434
}
×
435

UNCOV
436
void VCMatrixProperties::slotAddTextClicked()
×
437
{
438
    bool ok;
UNCOV
439
    QString text = QInputDialog::getText(this, tr("Enter a text"),
×
440
                                      tr("Text"), QLineEdit::Normal,
×
UNCOV
441
                                      "Q Light Controller+", &ok);
×
442
    if (ok && !text.isEmpty())
×
443
    {
UNCOV
444
        VCMatrixControl *newControl = new VCMatrixControl(++m_lastAssignedID);
×
445
        newControl->m_type = VCMatrixControl::Text;
×
UNCOV
446
        newControl->m_resource = text;
×
447
        addControl(newControl);
×
448
        updateTree();
×
449
    }
450
}
×
451

452
void VCMatrixProperties::slotRemoveClicked()
×
453
{
UNCOV
454
    if (m_controlsTree->selectedItems().isEmpty())
×
455
        return;
UNCOV
456
    QTreeWidgetItem *selItem = m_controlsTree->selectedItems().first();
×
UNCOV
457
    quint8 ctlID = selItem->data(0, Qt::UserRole).toUInt();
×
458

459
    {
460
        // For R/G/B Knobs:
461
        // Remove the two others
UNCOV
462
        VCMatrixControl *control = getSelectedControl();
×
463
        if (control != NULL)
×
464
        {
UNCOV
465
            if (control->m_type == VCMatrixControl::Color1Knob
×
466
                    || control->m_type == VCMatrixControl::Color2Knob
467
                    || control->m_type == VCMatrixControl::Color3Knob
468
                    || control->m_type == VCMatrixControl::Color4Knob
UNCOV
469
                    || control->m_type == VCMatrixControl::Color5Knob)
×
470
            {
UNCOV
471
                if (control->m_color == Qt::red)
×
472
                {
UNCOV
473
                    removeControl(ctlID + 1);
×
474
                    removeControl(ctlID + 2);
×
475
                }
UNCOV
476
                else if (control->m_color == Qt::green)
×
477
                {
UNCOV
478
                    removeControl(ctlID - 1);
×
479
                    removeControl(ctlID + 1);
×
480
                }
481
                else if (control->m_color == Qt::blue)
×
482
                {
483
                    removeControl(ctlID - 2);
×
484
                    removeControl(ctlID - 1);
×
485
                }
486
                else
487
                {
488
                    Q_ASSERT(false);
489
                }
490
            }
491
        }
492
    }
493

494
    removeControl(ctlID);
×
495
    updateTree();
×
496
}
497

498
void VCMatrixProperties::slotInputValueChanged(quint32 universe, quint32 channel)
×
499
{
500
    Q_UNUSED(universe);
501
    Q_UNUSED(channel);
502

503
    VCMatrixControl *preset = getSelectedControl();
×
504

UNCOV
505
    if (preset != NULL) {
×
UNCOV
506
        preset->m_inputSource = m_presetInputWidget->inputSource();
×
507
    }
UNCOV
508
}
×
509

UNCOV
510
void VCMatrixProperties::slotKeySequenceChanged(QKeySequence key)
×
511
{
512
    VCMatrixControl *preset = getSelectedControl();
×
513

514
    if (preset != NULL)
×
UNCOV
515
        preset->m_keySequence = key;
×
516
}
×
517

518

519
void VCMatrixProperties::slotTreeSelectionChanged()
×
520
{
UNCOV
521
    VCMatrixControl *control = getSelectedControl();
×
522

523
    if (control != NULL)
×
524
    {
525
        m_presetInputWidget->setInputSource(control->m_inputSource);
×
526
        m_presetInputWidget->setKeySequence(control->m_keySequence.toString(QKeySequence::NativeText));
×
527
        if (control->widgetType() == VCMatrixControl::Button)
×
528
        {
UNCOV
529
            m_presetInputWidget->setCustomFeedbackVisibility(true);
×
UNCOV
530
            m_presetInputWidget->setKeyInputVisibility(true);
×
531
        }
532
        else
533
        {
UNCOV
534
            m_presetInputWidget->setCustomFeedbackVisibility(false);
×
UNCOV
535
            m_presetInputWidget->setKeyInputVisibility(false);
×
536
        }
537
    }
UNCOV
538
}
×
539

UNCOV
540
void VCMatrixProperties::slotColorComboActivated()
×
541
{
UNCOV
542
    if (m_colorsCombo->currentIndex() == 0)
×
UNCOV
543
        m_addColorResetButton->setEnabled(false);
×
544
    else
UNCOV
545
        m_addColorResetButton->setEnabled(true);
×
UNCOV
546
}
×
547

UNCOV
548
void VCMatrixProperties::accept()
×
549
{
UNCOV
550
    m_matrix->setCaption(m_nameEdit->text());
×
UNCOV
551
    m_matrix->setFunction(m_function);
×
UNCOV
552
    if (m_instantCheck->isChecked())
×
UNCOV
553
        m_matrix->setInstantChanges(true);
×
554
    else
UNCOV
555
        m_matrix->setInstantChanges(false);
×
556

557
    /* External input */
UNCOV
558
    m_matrix->setInputSource(m_sliderInputSource);
×
559

560
    /* Visibility */
561
    quint32 visibilityMask = 0;
UNCOV
562
    if (m_sliderCheck->isChecked()) visibilityMask |= VCMatrix::ShowSlider;
×
UNCOV
563
    if (m_labelCheck->isChecked()) visibilityMask |= VCMatrix::ShowLabel;
×
UNCOV
564
    if (m_mtxColor1ButtonCheck->isChecked()) visibilityMask |= VCMatrix::ShowColor1Button;
×
UNCOV
565
    if (m_mtxColor2ButtonCheck->isChecked()) visibilityMask |= VCMatrix::ShowColor2Button;
×
UNCOV
566
    if (m_mtxColor3ButtonCheck->isChecked()) visibilityMask |= VCMatrix::ShowColor3Button;
×
UNCOV
567
    if (m_mtxColor4ButtonCheck->isChecked()) visibilityMask |= VCMatrix::ShowColor4Button;
×
UNCOV
568
    if (m_mtxColor5ButtonCheck->isChecked()) visibilityMask |= VCMatrix::ShowColor5Button;
×
UNCOV
569
    if (m_presetComboCheck->isChecked()) visibilityMask |= VCMatrix::ShowPresetCombo;
×
UNCOV
570
    m_matrix->setVisibilityMask(visibilityMask);
×
571

572
    /* Controls */
UNCOV
573
    m_matrix->resetCustomControls();
×
UNCOV
574
    for (int i = 0; i < m_controls.count(); i++)
×
UNCOV
575
        m_matrix->addCustomControl(*m_controls.at(i));
×
576

577
    /* Close dialog */
UNCOV
578
    QDialog::accept();
×
UNCOV
579
}
×
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