程序
//.h
#ifndef SHAPEWIDGET_H
#define SHAPEWIDGET_H
#include <QWidget>
#include <QMouseEvent>
#include <QPainter>
#include <QPixmap>
#include <QBitmap>
class ShapeWidget : public QWidget
{
Q_OBJECT
public:
ShapeWidget(QWidget *parent = 0);
~ShapeWidget();
protected:
void mousePressEvent(QMouseEvent *);
<