summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/TimeDomainDisplayPlot.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.cc')
-rw-r--r--gr-qtgui/lib/TimeDomainDisplayPlot.cc50
1 files changed, 49 insertions, 1 deletions
diff --git a/gr-qtgui/lib/TimeDomainDisplayPlot.cc b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
index 16ba4a39c6..bc9f630235 100644
--- a/gr-qtgui/lib/TimeDomainDisplayPlot.cc
+++ b/gr-qtgui/lib/TimeDomainDisplayPlot.cc
@@ -135,6 +135,10 @@ TimeDomainDisplayPlot::TimeDomainDisplayPlot(int nplots, QWidget* parent)
d_xdata = new double[d_numPoints];
memset(d_xdata, 0x0, d_numPoints*sizeof(double));
+ d_tag_text_color = Qt::black;
+ d_tag_background_color = Qt::white;
+ d_tag_background_style = Qt::NoBrush;
+
d_zoomer = new TimeDomainDisplayZoomer(canvas(), 0);
#if QWT_VERSION < 0x060000
@@ -381,7 +385,14 @@ TimeDomainDisplayPlot::plotNewData(const std::vector<double*> dataPoints,
QString orig = (*mitr)->label().text();
s << std::endl;
orig.prepend(s.str().c_str());
- (*mitr)->setLabel(orig);
+
+ QwtText newtext(orig);
+ newtext.setColor(getTagTextColor());
+
+ QBrush brush(getTagBackgroundColor(), getTagBackgroundStyle());
+ newtext.setBackgroundBrush(brush);
+
+ (*mitr)->setLabel(newtext);
}
}
@@ -598,6 +609,43 @@ TimeDomainDisplayPlot::enableTagMarker(int which, bool en)
throw std::runtime_error("TimeDomainDisplayPlot: enabled tag marker does not exist.\n");
}
+const QColor
+TimeDomainDisplayPlot::getTagTextColor()
+{
+ return d_tag_text_color;
+}
+
+const QColor
+TimeDomainDisplayPlot::getTagBackgroundColor()
+{
+ return d_tag_background_color;
+}
+
+const Qt::BrushStyle
+TimeDomainDisplayPlot::getTagBackgroundStyle()
+{
+ return d_tag_background_style;
+}
+
+void
+TimeDomainDisplayPlot::setTagTextColor(QColor c)
+{
+ d_tag_text_color = c;
+}
+
+void
+TimeDomainDisplayPlot::setTagBackgroundColor(QColor c)
+{
+ d_tag_background_color = c;
+}
+
+void
+TimeDomainDisplayPlot::setTagBackgroundStyle(Qt::BrushStyle b)
+{
+ d_tag_background_style = b;
+}
+
+
void
TimeDomainDisplayPlot::setYLabel(const std::string &label,
const std::string &unit)