diff options
author | Tom Rondeau <trondeau@vt.edu> | 2012-10-03 22:27:23 -0400 |
---|---|---|
committer | Tom Rondeau <trondeau@vt.edu> | 2012-10-03 22:27:23 -0400 |
commit | 62ab0377d5ba26ac63f97c8e3802c7cd1a92f18c (patch) | |
tree | 8c147520279cc788d8c1c1317727024ef788c51a /gr-qtgui/lib/DisplayPlot.cc | |
parent | 48feecf3eaf2b16d0e211dcb5690aeb0f22d9c0d (diff) |
qtgui: adding menu option to qtgui sinks to set transparency (alpha) value on lines/markers.
Diffstat (limited to 'gr-qtgui/lib/DisplayPlot.cc')
-rw-r--r-- | gr-qtgui/lib/DisplayPlot.cc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/gr-qtgui/lib/DisplayPlot.cc b/gr-qtgui/lib/DisplayPlot.cc index 1199b6456e..ca3f7899be 100644 --- a/gr-qtgui/lib/DisplayPlot.cc +++ b/gr-qtgui/lib/DisplayPlot.cc @@ -186,6 +186,33 @@ DisplayPlot::setLineMarker(int which, QwtSymbol::Style marker) } void +DisplayPlot::setMarkerAlpha(int which, int alpha) +{ + // Get the pen color + QPen pen(_plot_curve[which]->pen()); + QColor color = pen.color(); + + // Set new alpha and update pen + color.setAlpha(alpha); + pen.setColor(color); + _plot_curve[which]->setPen(pen); + + // And set the new color for the markers +#if QWT_VERSION < 0x060000 + //_plot_curve[which]->setBrush(QBrush(QColor(color))); + _plot_curve[which]->setPen(pen); + + QwtSymbol sym = (QwtSymbol)_plot_curve[which]->symbol(); + setLineMarker(which, sym.style()); +#else + QwtSymbol *sym = (QwtSymbol*)_plot_curve[which]->symbol(); + sym->setColor(color); + sym->setPen(pen); + _plot_curve[which]->setSymbol(sym); +#endif +} + +void DisplayPlot::setStop(bool on) { _stop = on; |