Important: Please read the Qt Code of Conduct -

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:


    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]

  • Have you checkout the qwt docs:

    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}");

Log in to reply