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

5
  Copyright (c) Jano Svitok
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 <QDebug>
21
#include <QPoint>
22
#include <QSettings>
23

24
#include "positiontool.h"
25
#include "vcxypadarea.h"
26

27
#define SETTINGS_GEOMETRY "positiontool/geometry"
28

29
/*****************************************************************************
30
 * Initialization
31
 *****************************************************************************/
32

33
PositionTool::PositionTool(const QPointF & initial, QRectF degreesRange, QWidget* parent)
×
34
    : QDialog(parent)
×
35
{
36
    setupUi(this);
×
37
    m_area = new VCXYPadArea(this);
×
38
    setPosition(initial);
×
39
    m_area->setMode(Doc::Operate); // to activate the area
×
40
    m_area->setWindowTitle("");
×
41
    m_area->setDegreesRange(degreesRange);
×
42
    m_area->setFocus();
×
43
    m_gridLayout->addWidget(m_area, 0, 0);
×
44

NEW
45
    QSettings settings;
×
NEW
46
    QVariant geometrySettings = settings.value(SETTINGS_GEOMETRY);
×
NEW
47
    if (geometrySettings.isValid() == true)
×
NEW
48
        restoreGeometry(geometrySettings.toByteArray());
×
49

UNCOV
50
    connect(m_area, SIGNAL(positionChanged(const QPointF &)),
×
51
            this, SLOT(slotPositionChanged(const QPointF &)));
52
}
×
53

54
PositionTool::~PositionTool()
×
55
{
NEW
56
    QSettings settings;
×
NEW
57
    settings.setValue(SETTINGS_GEOMETRY, saveGeometry());
×
UNCOV
58
}
×
59

60
/*****************************************************************************
61
 * Current XY position
62
 *****************************************************************************/
63

64
QPointF PositionTool::position() const
×
65
{
66
    if (m_area == NULL)
×
67
        return QPointF(127, 127);
×
68

69
    return m_area->position();
×
70
}
71

72
void PositionTool::setPosition(const QPointF & position)
×
73
{
74
    m_area->setPosition(position);
×
75
}
×
76

77
void PositionTool::slotPositionChanged(const QPointF & position)
×
78
{
79
    emit currentPositionChanged(position);
×
80
}
×
81

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