• 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/virtualconsole/addvcslidermatrix.cpp
1
/*
2
  Q Light Controller
3
  addvcslidermatrix.cpp
4

5
  Copyright (C) Heikki Junnila
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
#include <QSpinBox>
22
#include <QAction>
23

24
#include "addvcslidermatrix.h"
25
#include "vcpropertieseditor.h"
26

27
#define SETTINGS_GEOMETRY "addvcslidermatrix/geometry"
28
#define SETTINGS_SLIDER_MATRIX_SIZE "slidermatrix/defaultSize"
29

30
AddVCSliderMatrix::AddVCSliderMatrix(QWidget* parent)
×
31
    : QDialog(parent)
UNCOV
32
    , m_amount(1)
×
UNCOV
33
    , m_height(100)
×
34
    , m_width(60)
×
35
{
36
    setupUi(this);
×
37

38
    QAction* action = new QAction(this);
×
39
    action->setShortcut(QKeySequence(QKeySequence::Close));
×
40
    connect(action, SIGNAL(triggered(bool)), this, SLOT(reject()));
×
41
    addAction(action);
×
42

43
    QSettings settings;
×
44
    QVariant userVar = settings.value(SETTINGS_SLIDER_SIZE);
×
45
    if (userVar.isValid() == true)
×
46
    {
47
        QSize userSize = userVar.toSize();
×
48
        m_height = userSize.height();
×
49
        m_width = userSize.width();
×
50
    }
51

52
    QVariant var = settings.value(SETTINGS_SLIDER_MATRIX_SIZE);
×
53
    if (var.isValid() == true)
×
54
    {
55
        QSize size = var.toSize();
×
56
        m_amount = size.width();
×
57
        m_height = size.height();
×
58
    }
59

NEW
60
    QVariant geometrySettings = settings.value(SETTINGS_GEOMETRY);
×
NEW
61
    if (geometrySettings.isValid() == true)
×
NEW
62
        restoreGeometry(geometrySettings.toByteArray());
×
63

64
    m_amountSpin->setValue(m_amount);
×
65
    m_heightSpin->setValue(m_height);
×
66
    m_widthSpin->setValue(m_width);
×
67
}
×
68

69
AddVCSliderMatrix::~AddVCSliderMatrix()
×
70
{
NEW
71
    QSettings settings;
×
NEW
72
    settings.setValue(SETTINGS_GEOMETRY, saveGeometry());
×
UNCOV
73
}
×
74

75
int AddVCSliderMatrix::amount() const
×
76
{
77
    return m_amount;
×
78
}
79

80
int AddVCSliderMatrix::height() const
×
81
{
82
    return m_height;
×
83
}
84

85
int AddVCSliderMatrix::width() const
×
86
{
87
    return m_width;
×
88
}
89

90
void AddVCSliderMatrix::accept()
×
91
{
92
    m_amount = m_amountSpin->value();
×
93
    m_height = m_heightSpin->value();
×
94
    m_width = m_widthSpin->value();
×
95

96
    QSettings settings;
×
97
    QSize size(m_amount, m_height);
×
98
    settings.setValue(SETTINGS_SLIDER_MATRIX_SIZE, size);
×
99

100
    QDialog::accept();
×
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