summaryrefslogtreecommitdiff
path: root/gr-qtgui/lib/DisplayPlot.cc
diff options
context:
space:
mode:
authorTom Rondeau <trondeau@vt.edu>2012-10-03 22:27:23 -0400
committerTom Rondeau <trondeau@vt.edu>2012-10-03 22:27:23 -0400
commit62ab0377d5ba26ac63f97c8e3802c7cd1a92f18c (patch)
tree8c147520279cc788d8c1c1317727024ef788c51a /gr-qtgui/lib/DisplayPlot.cc
parent48feecf3eaf2b16d0e211dcb5690aeb0f22d9c0d (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.cc27
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;