Without knowing about the declaration/assignment of the plotpage variable nobody can tell you if your code is correct. IMO the only reasonable situation where your cast makes sense is something like this:

Qt Code:
  1. QWidget *plotpage = plot1; // something derived from QwtPlot
  2. // ...
  3. QwtPlot *plot2 = dynamic_cast<QwtPlot *>(plotpage);
To copy to clipboard, switch view to plain text mode 
As long as you don't have rtti disabled don't use static_casts for situations like this.

Uwe