src
kvh_status_painter.cpp
Go to the documentation of this file.
1
/*********************************************************************
2
* Software License Agreement (Apache 2.0)
3
*
4
* Copyright (c) 2019, The MITRE Corporation.
5
* All rights reserved.
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
* https://www.apache.org/licenses/LICENSE-2.0
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
* Sections of this project contains content developed by The MITRE Corporation.
20
* If this code is used in a deployment or embedded within another project,
21
* it is requested that you send an email to opensource@mitre.org in order to
22
* let us know where this software is being used.
23
*********************************************************************/
24
34
#include "
kvh_status_painter.hpp
"
35
36
namespace
kvh
37
{
45
StatusPainter::StatusPainter
(QWidget* parent)
46
: QWidget(parent)
47
{
48
}
49
59
void
StatusPainter::paintEvent
(QPaintEvent* event)
60
{
61
QPainter painter(
this
);
62
QColor enabled;
63
64
if
(isEnabled())
65
{
66
enabled = Qt::green;
67
}
68
else
69
{
70
enabled = Qt::red;
71
}
72
73
74
painter.setBrush(enabled);
75
76
int
w = width();
77
int
h = height();
78
79
painter.drawEllipse(0, h/2-3, 10, 10);
80
}
81
}
kvh::StatusPainter::paintEvent
virtual void paintEvent(QPaintEvent *event)
The custom paintEvent for our QWidget.
Definition:
kvh_status_painter.cpp:59
kvh
Definition:
kvh_geo_fog_3d_status_panel.hpp:43
kvh_status_painter.hpp
KVH Geo Fog 3D RVIZ plugin painter object.
kvh::StatusPainter::StatusPainter
StatusPainter(QWidget *parent=0)
Initialize our Qt StatusPainter.
Definition:
kvh_status_painter.cpp:45
kvh_geo_fog_3d_rviz
Author(s): Zach LaCelle
autogenerated on Wed Mar 2 2022 00:29:02