diff options
author | Johnathan Corgan <johnathan@corganlabs.com> | 2015-05-10 20:02:23 -0700 |
---|---|---|
committer | Johnathan Corgan <johnathan@corganlabs.com> | 2015-05-10 20:02:23 -0700 |
commit | fa247a9f587651dedfa74ac2b56dc9c3e86a171e (patch) | |
tree | 62c2bd45d9ce1e09ff089087f9db295e62265b31 /gr-qtgui/lib/TimeDomainDisplayPlot.cc | |
parent | ef6485cbbec903250821bc4b70bd5ae70099d15e (diff) | |
parent | 6af7eb5d2db7cecca4aa18b3d0959af630ec00da (diff) |
Merge branch 'maint'
Diffstat (limited to 'gr-qtgui/lib/TimeDomainDisplayPlot.cc')
-rw-r--r-- | gr-qtgui/lib/TimeDomainDisplayPlot.cc | 50 |
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) |