Main Page
Namespaces
Classes
Files
File List
File Members
src
time_plot_widget.cpp
Go to the documentation of this file.
1
// *****************************************************************************
2
//
3
// Copyright (c) 2015, Southwest Research Institute® (SwRI®)
4
// All rights reserved.
5
//
6
// Redistribution and use in source and binary forms, with or without
7
// modification, are permitted provided that the following conditions are met:
8
// * Redistributions of source code must retain the above copyright
9
// notice, this list of conditions and the following disclaimer.
10
// * Redistributions in binary form must reproduce the above copyright
11
// notice, this list of conditions and the following disclaimer in the
12
// documentation and/or other materials provided with the distribution.
13
// * Neither the name of Southwest Research Institute® (SwRI®) nor the
14
// names of its contributors may be used to endorse or promote products
15
// derived from this software without specific prior written permission.
16
//
17
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20
// ARE DISCLAIMED. IN NO EVENT SHALL Southwest Research Institute® BE LIABLE
21
// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22
// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
24
// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
// LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26
// OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
27
// DAMAGE.
28
//
29
// *****************************************************************************
30
#include <
swri_profiler_tools/time_plot_widget.h
>
31
32
#include <QPainter>
33
#include <QMouseEvent>
34
35
#include <
swri_profiler_tools/profile_database.h
>
36
37
namespace
swri_profiler_tools
38
{
39
TimePlotWidget::TimePlotWidget
(QWidget *parent)
40
:
41
QWidget(parent),
42
db_(NULL)
43
{
44
setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
45
}
46
47
TimePlotWidget::~TimePlotWidget
()
48
{
49
}
50
51
QSize
TimePlotWidget::sizeHint
()
const
52
{
53
return
QSize(200, 200);
54
}
55
56
void
TimePlotWidget::setDatabase
(
ProfileDatabase
*db)
57
{
58
if
(
db_
) {
59
// note(exjohnson): we can implement this later if desired, but
60
// currently no use case for it.
61
qWarning(
"TimePlotWidget: Cannot change the profile database."
);
62
return
;
63
}
64
65
db_
= db;
66
}
67
68
void
TimePlotWidget::setActiveNode
(
int
profile_key,
int
node_key)
69
{
70
}
71
72
void
TimePlotWidget::enterEvent
(QEvent *event)
73
{
74
}
75
76
void
TimePlotWidget::leaveEvent
(QEvent *event)
77
{
78
}
79
80
void
TimePlotWidget::mouseMoveEvent
(QMouseEvent *event)
81
{
82
}
83
84
void
TimePlotWidget::mousePressEvent
(QMouseEvent *event)
85
{
86
}
87
88
void
TimePlotWidget::mouseDoubleClickEvent
(QMouseEvent *event)
89
{
90
}
91
92
void
TimePlotWidget::paintEvent
(QPaintEvent *)
93
{
94
QPainter painter(
this
);
95
96
painter.setPen(Qt::NoPen);
97
painter.fillRect(0, 0, width(), height(), QColor(255, 255, 255));
98
painter.setPen(Qt::black);
99
100
}
101
}
// namespace swri_profiler_tools
swri_profiler_tools::TimePlotWidget::enterEvent
void enterEvent(QEvent *)
Definition:
time_plot_widget.cpp:72
swri_profiler_tools::TimePlotWidget::leaveEvent
void leaveEvent(QEvent *)
Definition:
time_plot_widget.cpp:76
time_plot_widget.h
profile_database.h
swri_profiler_tools::TimePlotWidget::paintEvent
void paintEvent(QPaintEvent *)
Definition:
time_plot_widget.cpp:92
swri_profiler_tools::TimePlotWidget::setDatabase
void setDatabase(ProfileDatabase *db)
Definition:
time_plot_widget.cpp:56
swri_profiler_tools
Definition:
database_key.h:34
swri_profiler_tools::TimePlotWidget::mousePressEvent
void mousePressEvent(QMouseEvent *)
Definition:
time_plot_widget.cpp:84
swri_profiler_tools::TimePlotWidget::db_
ProfileDatabase * db_
Definition:
time_plot_widget.h:47
swri_profiler_tools::TimePlotWidget::setActiveNode
void setActiveNode(int profile_key, int node_key)
Definition:
time_plot_widget.cpp:68
swri_profiler_tools::TimePlotWidget::mouseMoveEvent
void mouseMoveEvent(QMouseEvent *)
Definition:
time_plot_widget.cpp:80
swri_profiler_tools::TimePlotWidget::mouseDoubleClickEvent
void mouseDoubleClickEvent(QMouseEvent *)
Definition:
time_plot_widget.cpp:88
swri_profiler_tools::TimePlotWidget::TimePlotWidget
TimePlotWidget(QWidget *parent=0)
Definition:
time_plot_widget.cpp:39
swri_profiler_tools::ProfileDatabase
Definition:
profile_database.h:42
swri_profiler_tools::TimePlotWidget::~TimePlotWidget
~TimePlotWidget()
Definition:
time_plot_widget.cpp:47
swri_profiler_tools::TimePlotWidget::sizeHint
QSize sizeHint() const
Definition:
time_plot_widget.cpp:51
swri_profiler_tools
Author(s):
autogenerated on Fri Nov 27 2020 03:44:18