C++ (Qt)class calendar: public QCalendarWidget{public: explicit calendar(QWidget *parent = 0); private: bool event(QEvent *event); void mousePressEvent(QMouseEvent *event);};
C++ (Qt)#include "calendar.h" calendar::calendar(QWidget *parent):QCalendarWidget(parent){} void calendar::mousePressEvent(QMouseEvent *event){ QMessageBox::about(0,"","Событие от мышки"); } bool calendar::event(QEvent *event){ if (event->type() == QEvent::MouseButtonDblClick) { QMessageBox::about(0,"","Двойной щелчек"); } return QCalendarWidget::event(event);}