Vitor Santos
Vitor Santos

Reputation: 137

Methods that allow me to change a QwtPlot color background

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.

Upvotes: 0

Views: 2460

Answers (2)

K13
K13

Reputation: 39

Another option to change the QwtPlot canvas color:

plot->setAutoFillBackground(false);
plot->canvas()->setPalette(color);

Upvotes: 0

c_k
c_k

Reputation: 1766

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

    QwtPlotCanvas { background: #888888; } 

Upvotes: 4

Related Questions