void MyButton::paintEvent( QPaintEvent *e)
{
Qrect updateQ=e->rect();
}
paintEvent是 QT自身的构造函数,是一个inline内联函数实现:
293 class Q_GUI_EXPORT QPaintEvent : public QEvent
294 {
295 public:
296 QPaintEvent(const QRegion& paintRegion);
297 QPaintEvent(const QRect &paintRect);
298 ~QPaintEvent();
299
300 inline const QRect &rect() const { return m_rect; }
301 inline const QRegion ®ion() const { return m_region; }
302
303 #ifdef QT3_SUPPORT
304 QT3_SUPPORT_CONSTRUCTOR QPaintEvent(const QRegion &paintRegion, const QRect &paintRect);
305 inline QT3_SUPPORT bool erased() const { return m_erased; }
306 inline QT3_SUPPORT void setErased(bool b) { m_erased = b; }
307 #endif
308
309 protected:
310 friend class QApplication;
311 friend class QCoreApplication;
312 QRect m_rect;
313 QRegion m_region;
314 bool m_erased;
315 };
编译时总是出错:invalied use the incomplte struct : paintevebt.
那位好心人士帮忙指出错误的原因,不胜感激!我是一个菜鸟,赶着交作业,请大侠们帮忙,谢谢