projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
MainWindow, View::View: Fix two memory errors reported by valgrind
[pulseview.git]
/
pv
/
view
/
trace.hpp
diff --git
a/pv/view/trace.hpp
b/pv/view/trace.hpp
index c9582c61218409616c7119d1cc894f6ae0cecafd..9f0ecd44c2a54ca82706775887db0e453792c6fa 100644
(file)
--- a/
pv/view/trace.hpp
+++ b/
pv/view/trace.hpp
@@
-18,8
+18,8
@@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef PULSEVIEW_PV_VIEW_TRACE_HPP
-#define PULSEVIEW_PV_VIEW_TRACE_HPP
+#ifndef PULSEVIEW_PV_VIEW
S_TRACEVIEW
_TRACE_HPP
+#define PULSEVIEW_PV_VIEW
S_TRACEVIEW
_TRACE_HPP
#include <QColor>
#include <QPainter>
#include <QColor>
#include <QPainter>
@@
-31,6
+31,8
@@
#include "tracetreeitem.hpp"
#include "tracetreeitem.hpp"
+#include "pv/data/signalbase.hpp"
+
class QFormLayout;
namespace pv {
class QFormLayout;
namespace pv {
@@
-39,7
+41,8
@@
namespace widgets {
class Popup;
}
class Popup;
}
-namespace view {
+namespace views {
+namespace TraceView {
class Trace : public TraceTreeItem
{
class Trace : public TraceTreeItem
{
@@
-49,45
+52,28
@@
private:
static const QPen AxisPen;
static const int LabelHitPadding;
static const QPen AxisPen;
static const int LabelHitPadding;
- static const QColor BrightBGColour;
- static const QColor DarkBGColour;
+ static const QColor Bright
Gray
BGColour;
+ static const QColor Dark
Gray
BGColour;
protected:
protected:
- Trace(
QString name
);
+ Trace(
std::shared_ptr<data::SignalBase> channel
);
public:
public:
- /**
- * Gets the name of this signal.
- */
- QString name() const;
-
/**
* Sets the name of the signal.
*/
virtual void set_name(QString name);
/**
* Sets the name of the signal.
*/
virtual void set_name(QString name);
- /**
- * Get the colour of the signal.
- */
- QColor colour() const;
-
/**
* Set the colour of the signal.
*/
/**
* Set the colour of the signal.
*/
- void set_colour(QColor colour);
+ v
irtual v
oid set_colour(QColor colour);
/**
* Enables or disables the coloured background for this trace.
*/
void set_coloured_bg(bool state);
/**
* Enables or disables the coloured background for this trace.
*/
void set_coloured_bg(bool state);
- /**
- * Computes the outline rectangle of the viewport hit-box.
- * @param rect the rectangle of the viewport area.
- * @return Returns the rectangle of the hit-box.
- */
- QRectF hit_box_rect(const ViewItemPaintParams &pp) const;
-
/**
* Paints the signal label.
* @param p the QPainter to paint into.
/**
* Paints the signal label.
* @param p the QPainter to paint into.
@@
-129,16
+115,20
@@
protected:
virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
virtual void populate_popup_form(QWidget *parent, QFormLayout *form);
-pr
ivate
Q_SLOTS:
- v
oid on_text
_changed(const QString &text);
+pr
otected
Q_SLOTS:
+ v
irtual void on_name
_changed(const QString &text);
- void on_colour_changed(const QColor &colour);
+ v
irtual v
oid on_colour_changed(const QColor &colour);
void on_popup_closed();
void on_popup_closed();
+private Q_SLOTS:
+ void on_nameedit_changed(const QString &name);
+
+ void on_colouredit_changed(const QColor &colour);
+
protected:
protected:
- QString name_;
- QColor colour_, bgcolour_;
+ std::shared_ptr<data::SignalBase> base_;
bool coloured_bg_, coloured_bg_state_;
private:
bool coloured_bg_, coloured_bg_state_;
private:
@@
-146,7
+136,8
@@
private:
QFormLayout *popup_form_;
};
QFormLayout *popup_form_;
};
-} // namespace view
+} // namespace TraceView
+} // namespace views
} // namespace pv
} // namespace pv
-#endif // PULSEVIEW_PV_VIEW_TRACE_HPP
+#endif // PULSEVIEW_PV_VIEW
S_TRACEVIEW
_TRACE_HPP