0

I would like to know what methods I can use to change my QwtPlot after it has been created and also how to use. By now I'm using QwtPlot->setCanvasBackground() in my constructor, however in my program the user have the option to change the background color of the plot with some others graphical options that are all setted in a specific method that belongs to class that inherits from QwtPlot. Any advices? Thanks for your support.

Vitor Santos
  • 137
  • 2
  • 5

2 Answers2

4

You can use Qt StyleSheets. The following code sets the canvas background color to gray:

    QwtPlotCanvas { background: #888888; } 
c_k
  • 1,746
  • 1
  • 20
  • 35
0

Another option to change the QwtPlot canvas color:

plot->setAutoFillBackground(false);
plot->canvas()->setPalette(color);
K13
  • 21
  • 5