August 17, 2012

DBoosalis DBoosalis
Lab Rat
16 posts

Updating QwtPlot colors

 

I am trying to change the color of a QwtPlot through a user selection from a QColorDialog. The first time I change the color I see it in the Plot’s canvas, but after that I do not see it. I know the code is getting executed but the color only changes for the first time. Any ideas on how to work around this.

I do something like this from my plot widget:

setCanvasBackground(bgColor);

Any info very much appreicated.

[Moderator note: This thread has been split from the unrelated thread in which it was originally posted. Please open new threads for new questions. Thanks. — mlong]

1 reply

August 21, 2012

Juergen_M Juergen_M
Hobby Entomologist
116 posts

Have you checkout the qwt docs:
http://qwt.sourceforge.net/class_qwt_plot.html#adb0b2e68d86039f86e3240fb399fa0fe

Using canvas()->setPalette() is a more powerful way to set these colors.

or you can make a test with stylesheet technik, like:
QwtPlot::setStyleSheet(” QwtPlot {background-color: #FF0000}”);

 
  ‹‹ Creating video files?      QTW (QWT) install ››

You must log in to post a reply. Not a member yet? Register here!