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]



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


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.