Hello everybody,

I created a child widget in a QMainWindow. In this widget, I overloaded the mousePressEvent but that not work.

Here is the code:

widget.h

class myWidget : public QWidget {
Q_OBJECT
private:

protected:
void paintEvent(QPaintEvent *event);
void mousePressEvent(QMouseEvent *event);

public:
BoardWidget(QWidget *parent);
~BoardWidget();
};

widget cpp:

void myWidget::
mousePressEvent(QMouseEvent *event)
{
qDebug()<<"pass";
}

The widget is created in the constructor of my MainWindow:

widget = new myWidget(this);
widget->setGeometry(...);
widget->show();

I am using qt 4.7.3 on a mac.

Thank you,

Pat