QT学习一之画板制作(解决绘画卡顿)
)擦除。 创建画板界面 鼠标拖动模拟画笔 右键擦除所有绘画 class VDCSketchpadWidget : public QWidget { Q_OBJECT public : explicit VDCSketchpadWidget ( QWidget *parent = 0 ); ~ VDCSketchpadWidget (); private : void paintEvent ( QPaintEvent *event); private : Ui :: VDCSketchpadWidget * ui ; }; setWindowFlags( Qt :: BypassWindowManagerHint | Qt :: Drawer ); //全无边框;画板 setWindowState( Qt :: WindowFullScreen ); //全屏 2.实现鼠标拖动模拟画笔 现附上代码 class VDCSketchpadWidget : public QWidget { Q_OBJECT public : explicit VDCSketchpadWidget ( QWidget *parent = 0 ); ~ VDCSketchpadWidget (); private : void paintEvent ( QPaintEvent *event); void