hello all,
i want to paint some thing (in this example , i do nothing) to a QwtPlotCanvas, so i subclass MyCanvas, in class MyCanvas constructor function , i configure object and implement paintEvent, However, the displaying QwtPlotCanvas is not correct as my except . Wrong result.JPG

my code is listed as following.

in mycanvas.h
Qt Code:
  1. #ifndef MYCANVAS_H
  2. #define MYCANVAS_H
  3. #include <qwt_plot_canvas.h>
  4. #include<QPainter>
  5.  
  6. class MyCanvas:public QwtPlotCanvas
  7. {
  8. public:
  9. MyCanvas();
  10. void paintEvent(QPaintEvent *event);
  11. };
  12. #endif // MYCANVAS_H
To copy to clipboard, switch view to plain text mode 
in mycanvas.cpp
Qt Code:
  1. #include "mycanvas.h"
  2.  
  3. MyCanvas::MyCanvas()
  4. {
  5. this->setBorderRadius( 15 );
  6. }
  7. void MyCanvas::paintEvent(QPaintEvent *event)
  8. {
  9. }
To copy to clipboard, switch view to plain text mode 
in mainwindow.h
Qt Code:
  1. #define MAINWINDOW_H
  2. #include <QMainWindow>
  3. #include"mycanvas.h"
  4. namespace Ui {
  5. class MainWindow;
  6. }
  7.  
  8. class MainWindow : public QMainWindow
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit MainWindow(QWidget *parent = 0);
  13. ~MainWindow();
  14. private:
  15. Ui::MainWindow *ui;
  16. MyCanvas * canvas;
  17. };
  18. #endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode 

in mainwindow.cpp
Qt Code:
  1. #include "mainwindow.h"
  2. #include "ui_mainwindow.h"
  3. #include <qwt_plot_canvas.h>
  4.  
  5. MainWindow::MainWindow(QWidget *parent) :
  6. QMainWindow(parent),
  7. ui(new Ui::MainWindow),
  8. canvas(new MyCanvas)
  9. {
  10. ui->setupUi(this);
  11. ui->qwtPlot->setCanvas(canvas);
  12. }
  13. MainWindow::~MainWindow()
  14. {
  15. delete ui;
  16. }
To copy to clipboard, switch view to plain text mode 
any suggestions?