PDA

View Full Version : Problem in capturing the event double click on a "QDateEdit".



bhodi78
28th April 2010, 10:29
Hello everyone,
I have a problem I would like to capture the event double click on the widget QDateEdit, to do this I wrote the following code:


class MyDateEdit : public QDateEdit{
Q_OBJECT
public:
MyDateEdit(QWidget *parent);
~MyDateEdit();
virtual voidmouseDoubleClickEvent(QMouseEvent *e);
};



#include "mydateedit.h"
MyDateEdit::MyDateEdit(QWidget *parent): QDateEdit(parent){
}
MyDateEdit::~MyDateEdit(){
}
void MyDateEdit::mouseDoubleClickEvent(QMouseEvent *e){
QMessageBox::information(0,"","I captured the event double click");
}


then I expect that at any point of the QDateEdit if I make a double click would display the message "I captured the event double click" ..... but it is not. In fact the message only appears if I do double click on the arrows to increase and decrease QDateEdit. Some of you could explain to me what's wrong?

Thank you all.
Bye.

bhodi78
3rd May 2010, 09:25
Hello,
Please could you tell me if that the code I attached, it behaves like me. Or you work correctly : that at any point in the QDateEdit you do a double click you see the message "I captured the event double click".