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:
Q_OBJECT
public:
~MyDateEdit();
};
class MyDateEdit : public QDateEdit{
Q_OBJECT
public:
MyDateEdit(QWidget *parent);
~MyDateEdit();
virtual voidmouseDoubleClickEvent(QMouseEvent *e);
};
To copy to clipboard, switch view to plain text mode
#include "mydateedit.h"
}
MyDateEdit::~MyDateEdit(){
}
void MyDateEdit
::mouseDoubleClickEvent(QMouseEvent *e
){ QMessageBox::information(0,
"",
"I captured the event double click");
}
#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");
}
To copy to clipboard, switch view to plain text mode
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.
Bookmarks